Data classification identification method, device and equipment and readable storage medium
By using a sentinel model for pseudo-label annotation and meta-learning training on image data of rare objects or rare diseases, the problem of labeling difficulties in rare datasets is solved, and the training efficiency and accuracy of classification models are improved.
Patent Information
- Application Number
- CN202110703613.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-24
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2041-06-24
AI Technical Summary
In existing technologies, it is difficult to obtain a large number of labeled samples for image data of rare objects or rare diseases, resulting in low training efficiency of classification models.
The sentinel model is obtained by supervising the training of the first dataset, and then pseudo-labels are applied to the second dataset using the sentinel model for meta-learning training to build a data classification model.
It improves the training efficiency and accuracy of data classification models, reduces the amount of labeled sample data, and enhances the performance and accuracy of the models.
Smart Images

Figure CN113821668B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of machine learning, and in particular to a data classification and identification method and device, equipment and a readable storage medium. BACKGROUND
[0002] Data classification and identification is commonly used in image content recognition, speech content recognition and other fields. For example, in image content recognition, a machine learning model is usually pre-trained to achieve image recognition. After inputting a to-be-identified image into the machine learning model, the machine learning model outputs the identification result corresponding to the to-be-identified image.
[0003] In related technologies, in the training process of a machine learning model, a large number of sample images labeled with sample labels are needed. After inputting the sample images into the machine learning model for identification, the predicted results are compared with the sample labels, so as to train the machine learning model according to the comparison difference.
[0004] However, for some difficult-to-collect samples, such as rare bird images, rare plant images, rare disease scan images, and new type of disease cell images, it is difficult to obtain a large number of samples, resulting in low training efficiency of the classification model. SUMMARY
[0005] Embodiments of the present application provide a data classification and identification method, device, equipment and readable storage medium, which can improve the training efficiency of an identification model for identifying and classifying rare diseases. The technical solution is as follows.
[0006] In one aspect, a data classification and identification method is provided, which comprises:
[0007] obtaining a first data set and a second data set, wherein the first data set comprises first data labeled with sample labels, and the first data belongs to a target classification set, and the second data set comprises second data;
[0008] training a sentinel model by supervised training of the first data;
[0009] inputting the second data into the sentinel model to output a pseudo-label corresponding to the second data;
[0010] performing meta-learning training on the sentinel model by using the second data labeled with the pseudo-label to obtain a data classification model;
[0011] performing classification prediction on target data by using the data classification model to obtain a classification result of the target data in the target classification set.
[0012] In another aspect, a data classification and identification device is provided, which comprises:
[0013] an acquisition module configured to acquire a first data set and a second data set, the first data set including first data labeled with a sample label, the first data belonging to a target classification set, and the second data set including second data;
[0014] a training module configured to train a sentinel model by supervised training of the first data;
[0015] a processing module configured to input the second data into the sentinel model and output a pseudo label corresponding to the second data;
[0016] The training module is further configured to perform meta-learning training on the sentinel model by using the second data labeled with the pseudo label, to obtain a data classification model.
[0017] a prediction module configured to perform classification prediction on target data by using the data classification model, to obtain a classification result of the target data in the target classification set.
[0018] In another aspect, a computer device is provided, which includes a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by the processor to implement the data classification and identification method according to any one of the above embodiments of the present application.
[0019] In another aspect, a computer readable storage medium is provided, which stores at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by a processor to implement the data classification and identification method according to any one of the above embodiments of the present application.
[0020] In another aspect, a computer program product or a computer program is provided, which includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the data classification and identification method according to any one of the above embodiments.
[0021] The technical solutions provided by the embodiments of the present application have at least the following beneficial effects:
[0022] The first data with labels is used for supervised training to obtain a sentinel model, pseudo labels are labeled for the second data through the sentinel model, and meta-learning training is performed on the sentinel model through the pseudo labels, so that a data classification model with higher performance and precision is finally obtained. In the training, a small amount of sample data with labels and a large amount of unlabeled data are used, the amount of data of the first data with labels is small, the cumbersome process of labeling a large amount of sample data is avoided, and the training efficiency and accuracy of the data classification model are improved. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0024] Figure 1 is a schematic diagram of the overall scheme implementation process provided by an example embodiment of the present application;
[0025] Figure 2 is a schematic diagram of the implementation environment provided by an example embodiment of the present application;
[0026] Figure 3 is a flowchart of a data classification and identification method provided by an example embodiment of the present application;
[0027] Figure 4 is a flowchart of a data classification and identification method provided by another example embodiment of the present application;
[0028] Figure 5 is a data classification and identification method provided by another example embodiment of the present application;
[0029] Figure 6 is a structural block diagram of a data classification and identification device provided by an example embodiment of the present application;
[0030] Figure 7 is a structural block diagram of a data classification and identification device provided by another example embodiment of the present application;
[0031] Figure 8 is a structural block diagram of a server provided by an example embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0033] First, the terms involved in the embodiments of the present application are briefly introduced.
[0034] Artificial Intelligence (AI): is the use of digital computers or digital computer-controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which tries to understand the essence of intelligence and produce a new intelligent machine that can react 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.
[0035] Artificial intelligence technology is a comprehensive discipline, involving a wide range of fields, both hardware and software technologies. Artificial intelligence basic technology generally includes such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology and machine learning / deep learning and other several directions.
[0036] Machine Learning (ML): is a multi-disciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It is dedicated to studying how computers simulate or implement human learning behavior to acquire new knowledge or skills, reorganize existing knowledge structure to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental approach to making computers intelligent, and its applications are widespread in various fields of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning technologies.
[0037] Computer Vision (CV): is a science that studies how to make machines "see", and further, refers to using cameras and computers to replace human eyes to identify, track and measure targets, and further do image processing, so that the computer processing becomes more suitable for human eye observation or image transmission to the instrument detection. As a scientific discipline, computer vision researches related theories and technologies, and tries to establish artificial intelligence systems that can obtain information from images or multidimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, and other technologies, as well as common face recognition, fingerprint recognition and other biometric identification technologies.
[0038] Pseudo label: refers to a label obtained by labeling data based on a prediction result of the data by a trained model. That is, the pseudo label is not a label manually labeled according to the actual situation of the data, but a label with a certain error rate labeled by a trained model.
[0039] In the related art, the identification of an object needs to train a mature classification model, and the training of the classification model needs a large number of sample image data labeled with label information. After the classification model classifies and identifies the sample image data, an identification result is obtained, and the classification model is trained based on the difference between the labeled label information and the identification result. However, due to the rarity of rare diseases or rare objects, it is difficult to obtain sample image data, which requires a large amount of manpower to collect sample image data and label the sample image data with label information, and the training efficiency of the classification model is low.
[0040] In the embodiments of the present application, a data classification and identification method is provided, which improves the training efficiency and accuracy of the data classification model under the condition of less sample quantity.
[0041] Schematically, Figure 1 is a schematic diagram of the overall scheme implementation process provided by an exemplary embodiment of the present application, taking the classification model training process of rare objects (such as rare birds, rare plants, etc.) as an example, as shown in Figure 1 .
[0042] First, a first image data set 110 and a second image data set 120 are acquired, wherein the first image data set 110 includes first sample images of rare objects, and the first sample images in the first image data set 110 are labeled with sample labels; the second image data set 120 includes second sample images of common objects of the same type.
[0043] First, a sentinel model 130 is trained through the first sample images in the first image data set 110; the sentinel model 130 is meta-trained through the second sample images in the second image data set 120, and a data classification model 140 is obtained by fine-tuning the model parameters; finally, the data classification model 140 is used for classification prediction of rare objects.
[0044] In the process of meta-training, the second sample images are input into the sentinel model 130 to obtain pseudo labels 131 corresponding to each second sample image, the second sample images and the pseudo labels 131 form data pairs, a support set 151 is established, and the support set 151 includes the second sample images and the pseudo labels 131 corresponding to each second sample image; the data pairs in the support set 151 are subjected to random augmentation processing to obtain a query set 152. The random augmentation processing refers to random deformation processing of the second sample images in the support set 151, such as enlargement, reduction, addition of a black border, etc. The query set 152 is a set formed by maintaining the pseudo labels 131 unchanged and forming data pairs with the deformed second sample images, and finally the sentinel model 130 is meta-trained through the support set 151 and the query set 152.
[0045] It should be noted that, in the above embodiments, the classification model for rare objects is taken as an example for description, and the classification model can also be implemented as an identification model for other objects, which is not limited in the embodiments of the present application.
[0046] Secondly, an implementation environment involved in the embodiments of the present application is described, for example, a rare disease prediction process, and refer to Figure 2 for example, the implementation environment involves a terminal 210 and a server 220, and the terminal 210 and the server 220 are connected through a communication network 230.
[0047] In some embodiments, the terminal 210 includes a first terminal 211 and a second terminal 212.
[0048] The first terminal 211 is configured to send the medical image to the server 220. Illustratively, the first terminal 211 is a terminal applied by a doctor, the doctor performs auxiliary diagnosis by using the classification model in the process of diagnosing rare diseases by using the medical image, so as to improve the diagnosis accuracy; or the first terminal 211 is a terminal applied by a user, such as a patient himself or a relative of the patient, the user sends the medical image to the server 220, so as to obtain a reference diagnosis result; or the first terminal 211 is a terminal connected with a medical image scanning device, the medical image scanning device transmits the medical image to the first terminal 211 after scanning the medical image, and the first terminal 211 forwards the medical image to the server 220 for auxiliary diagnosis after receiving the medical image.
[0049] The server 220 trains the classification model 221 in the manner shown above, obtains the classification model 221, receives the medical image uploaded by the first terminal 211, and classifies and identifies the medical image by using the classification model, so as to obtain a classification diagnosis result of the medical image in the rare disease classification set. The server 220 feeds back the classification diagnosis result to the first terminal 211 or sends the classification diagnosis result to the second terminal 212. Figure 1
[0050] When the first terminal 211 is implemented as a terminal connected with the medical image scanning device, the server 220 sends the classification diagnosis result to the second terminal 212, and the second terminal 212 is implemented as a terminal applied by a doctor or a terminal applied by a user.
[0051] The terminal described above can be a mobile phone, a tablet computer, a desktop computer, a portable notebook computer, or various forms of terminal devices, and the embodiments of the present application do not limit the terminal.
[0052] It is worth noting that the server described above can be a stand-alone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
[0053] Among them, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, network, etc. in a wide area network or local area network to realize data calculation, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on cloud computing business model application, which can form a resource pool, and can be used on demand, flexibly and conveniently. Cloud computing technology will become an important support. The background service of the technical network system needs a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, every item in the future may have its own identification mark and needs to be transmitted to the background system for logical processing. Different levels of data will be processed separately, and various industry data will need strong system support, which can only be realized through cloud computing.
[0054] In some embodiments, the above-mentioned server can also be implemented as a node in a blockchain system. Blockchain is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. Blockchain is essentially a decentralized database, which is a series of data blocks associated using cryptography. Each data block contains information about a batch of network transactions, which is used to verify the validity of the information (anti-fake) and generate the next block. Blockchain can include blockchain underlying platform, platform product service layer and application service layer.
[0055] In combination with the above introduction of the terms, the application scenarios involved in the embodiments of the present application are exemplified.
[0056] First, for the classification and identification scene of rare diseases.
[0057] That is, the doctor sends the medical image to the server through the terminal, the server classifies and identifies the medical image through the trained classification model, obtains the classification diagnosis result corresponding to the medical image, and feeds back the classification diagnosis result to the terminal applied by the doctor for display, so that the doctor assists in diagnosis through the classification diagnosis result and obtains the final diagnosis result.
[0058] Second, for the classification and identification scene of rare objects.
[0059] That is, in the object recognition scene, for some rare objects, such as rare birds, rare plants, rare natural phenomena, etc., the user can obtain the classification result by uploading the picture. Illustratively, in a plant recognition application, when the user sees a plant that cannot be identified, the user can take a picture of the plant, and upload the picture to the server through the plant recognition application, and the server performs image recognition through a rare plant recognition model to obtain an identification result, and then feeds back the identification result to the terminal display.
[0060] Illustratively, the classification model can also be applied to object recognition scenes, speech recognition scenes, face recognition scenes, etc., and the embodiments of the present application do not limit this.
[0061] In combination with the above-mentioned name introduction and application scenarios, the data classification and recognition method provided by the present application is described. For example, as shown in Figure 3 The method includes the following steps.
[0062] Step 301, obtaining a first data set and a second data set.
[0063] The first data set includes first data labeled with a sample label, and the first data belongs to a target classification set. The second data set includes second data.
[0064] In some embodiments, the second data in the second data set is data that is not labeled with a label, and the first data in the first data set is data that is labeled with a sample label.
[0065] Optionally, the first data belongs to a target classification set, and the second data belongs to a second classification set. The second classification set includes the target classification set, or the target classification set and the second classification set are two classification sets that are parallel but of the same type. Illustratively, the second classification set is birds, and the target classification set is a specified type of rare birds; or the second classification set is ordinary birds, and the target classification set is a specified type of rare birds; or the second classification set is a common disease classification, and the target classification set is a rare disease classification. The common disease and the rare disease are corresponding disease conditions for the same organ or the same body part, or the common disease and the rare disease belong to the same disease type.
[0066] Taking the rare disease classification as an example, in some embodiments, the first data included in the first data set is medical imaging corresponding to a rare disease, such as Computed Tomography (CT) images, X-ray images, ultrasound images, and the like; and the second data included in the second data set is medical imaging corresponding to a common disease, such as CT images, X-ray images, ultrasound images, and the like.
[0067] It is worth noting that the medical images described above are only illustrative examples, and the first data and the second data in the embodiments of the present application can also be implemented as other types of data, and the embodiments of the present application do not limit this.
[0068] The first data amount (i.e., the number of medical images) of the first data in the first data set is less than the second data amount (i.e., the number of medical images) of the second data in the second data set, and optionally, the number of the first data in the first data set is within a required range, such as less than a preset number.
[0069] In some embodiments, the second data set is sampled from the same distribution as the target classification set task.
[0070] In step 302, the first data is used to train the sentinel model through supervised training.
[0071] Since the first data belongs to the target classification set and is labeled with sample labels, the sentinel model obtained through supervised training of the first data is a preliminary trained model for classification prediction in the target classification set.
[0072] In some embodiments, an initial model is obtained, and the initial model is a model initialized for data classification, and the initial model includes initial model parameters. Optionally, the initial model corresponds to the target classification set, and the initial model parameters of the initial model are model parameters obtained by random initialization.
[0073] The first data is input into the initial model to obtain a reference prediction result, and an initial loss value is determined based on the reference prediction result and the sample labels. The initial model parameters are adjusted based on the initial loss value to obtain the sentinel model.
[0074] In some embodiments, the first data in the first data set is iteratively input into the initial model in sequence, and the initial model parameters are iteratively adjusted to finally obtain the sentinel model. The sentinel model is a classification model with model parameters to be adjusted.
[0075] Illustratively, the i-th first data in the first data set is input into the initial model (including the initial model parameters adjusted in the i-1th iteration), and the i-th reference prediction result is output. The i-th initial loss value is determined according to the i-th reference prediction result and the sample labels of the i-th first data, and the initial model parameters adjusted in the i-1th iteration are adjusted according to the i-th initial loss value, and the i+1th iteration is continued until the initial loss value converges.
[0076] In some embodiments, in response to the reference prediction result including a hard label prediction result corresponding to the target classification set of the first data, the initial loss value is determined by a cross-entropy loss function; and in response to the reference prediction result including a soft label prediction result corresponding to the target classification set of the first data, the initial loss value is determined by a divergence function.
[0077] The hard label refers to a way of expressing a prediction result by two polarized value expressions, such as: the value of the target data corresponding to type A is 0, indicating that the target data is predicted not to belong to type A, and the value of the target data corresponding to type B is 0, indicating that the target data is predicted to belong to type B.
[0078] The soft label refers to a way of expressing a prediction result by a probability condition, such as: the value of the target data corresponding to type A is 0.28, indicating that the probability of the target data belonging to type A is 28%.
[0079] Optionally, when adjusting the initial model parameters by the initial loss value, the product of the initial loss value and a preset weight value is used as an adjustment step to adjust the initial model parameters.
[0080] Step 303: inputting the second data into the sentinel model to output a pseudo label corresponding to the second data.
[0081] The second data is unlabeled data, and the sentinel model is a model obtained by preliminary training of the first data. After the second data is input into the sentinel model for classification prediction, a pseudo label corresponding to the second data is output. The sentinel model is used for classification prediction of the second data in the target classification set.
[0082] The pseudo label is a label predicted by the sentinel model in the target classification set, and is not necessarily the correct label corresponding to the second data.
[0083] Step 304: performing meta-learning training on the sentinel model by using the second data labeled with the pseudo label to obtain a data classification model.
[0084] In some embodiments, after the meta-learning training on the sentinel model by using the second data labeled with the pseudo label, a candidate classification model is obtained, and model parameter adjustment is performed on the candidate classification model by using the first data to obtain the data classification model.
[0085] Step 305: performing classification prediction on the target data by using the data classification model to obtain a classification result of the target data in the target classification set.
[0086] After the sentinel model is trained, a data classification model is obtained, and the target data is classified through the data classification model, so as to obtain the classification result of the target data in the target classification set. The target data can be data in actual application, such as medical images in actual application; or the target data can also be data in the test set for testing the data classification model.
[0087] Illustratively, the data classification and identification method provided by the embodiment of the present application is applied to the identification process of rare birds. Then, a first data set is obtained, which includes rare bird images, and the rare bird images correspond to rare bird types; a second data set is obtained, which includes various bird images (including rare birds and common birds), and the bird images in the second data set are not labeled. After the initial model is supervised trained through the rare bird images in the first data set, a sentinel model is obtained, which is used for classification and identification of rare bird images in the rare bird type set. After various bird images in the second data set are input into the sentinel model, the corresponding pseudo-labels of the various bird images are output, so as to construct a support set by combining the pseudo-labels with the corresponding bird images.
[0088] The bird images are randomly enhanced and processed, and the data pairs are constructed by combining the pseudo-labels with the query set. Thus, the sentinel model is meta-trained through the data set and the query set, and a rare bird classification model is obtained. Finally, the bird image to be identified is input into the rare bird classification model, and the classification result corresponding to the bird image is output, which is used to represent the rare bird type corresponding to the image content of the bird image.
[0089] To sum up, the data classification and identification method provided by the embodiment is supervised trained by the first data with labels to obtain a sentinel model, and pseudo-labels are labeled on the second data through the sentinel model, so as to meta-train the sentinel model through the pseudo-labels, and finally obtain a data classification model with higher performance and precision. In the training process, a small amount of sample data with labels and a large amount of unlabeled data are used, the data amount requirement of the first data with labels is small, the tedious process of labeling a large amount of sample data is avoided, and the training efficiency and accuracy of the data classification model are improved.
[0090] In some embodiments, the meta-training process includes an inner loop and an outer loop process, Figure 4 is a flowchart of the data classification and identification method provided by another exemplary embodiment of the present application. As shown in Figure 4 , the method includes the following steps.
[0091] Step 401, obtaining a first data set and a second data set.
[0092] The first data in the first data set includes first data labeled with sample labels, and the first data belongs to the target classification set, and the second data in the second data set includes second data.
[0093] In some embodiments, the second data in the second data set is unlabeled data, and the first data in the first data set is labeled data.
[0094] In step 402, the sentinel model is trained by supervised training of the first data.
[0095] Since the first data is data belonging to the target classification set, and the first data is labeled with sample labels, the sentinel model obtained by supervised training of the first data is a preliminary trained model for classification prediction in the target classification set.
[0096] In some embodiments, an initial model is obtained, the initial model is a model initialized for data classification, and the initial model includes initial model parameters. Optionally, the initial model corresponds to the target classification set, and the initial model parameters of the initial model are model parameters obtained by random initialization.
[0097] The first data is input into the initial model to obtain a reference prediction result, and an initial loss value is determined based on the reference prediction result and the sample labels. The initial model parameters are adjusted based on the initial loss value to obtain the sentinel model.
[0098] In step 403, the second data is input into the sentinel model to output a pseudo label corresponding to the second data.
[0099] The second data is unlabeled data, and the sentinel model is a model obtained by preliminary training of the first data. After classification prediction of the second data input into the sentinel model, a pseudo label corresponding to the second data is output.
[0100] In step 404, the pseudo label and the corresponding second data form a first data pair to obtain a training support set.
[0101] In some embodiments, random sampling is performed from the second data set, the sampled second data is input into the sentinel model to generate a pseudo label. The second data and the corresponding pseudo label are correspondingly formed into a first data pair to generate a training support set.
[0102] For example, the second data set U is sampled N second data x (1) , …, x (N) , N is a positive integer; the N second data sampled are input into the sentinel model for classification prediction to generate a pseudo label corresponding to each second data The training support set is established Wherein, For the kth group of first data pairs, k is a positive integer less than or equal to N.
[0103] At step 405, the first data pairs are randomly augmented to form second data pairs to obtain a training query set.
[0104] In some embodiments, the first data pairs are randomly augmented by a data augmentation function.
[0105] For the kth group of first data pairs, The kth group of second data pairs after the random augmentation is denoted as The data augmentation function is denoted as f. The random augmentation methods include at least one of the following methods: enlarging the second data in the first data pairs, reducing the second data in the first data pairs, randomly cutting out the second data in the first data pairs, and filling black edges to the second data in the first data pairs. The above random augmentation methods are only illustrative examples, and the embodiments of the present application do not limit the random augmentation methods.
[0106] At step 406, the meta-learning training of the sentinel model is performed by using the training support set and the training query set to obtain a candidate classification model.
[0107] In some embodiments, the first data in the training support set is substituted into the sentinel model to perform the first adjustment of the model parameters in the sentinel model, and the second data in the training query set is used to perform the second adjustment of the model parameters. After the parameter adjustment by n tasks pairs, the candidate classification model is obtained, and n is a positive integer.
[0108] In some embodiments, the first data in the training support set is substituted into the sentinel model to perform the first adjustment of the model parameters in the sentinel model, and the process of constructing n tasks pairs to perform the parameter adjustment is an outer loop process, and each outer loop process includes a group of inner loop processes.
[0109] Optionally, the first data pairs in the training support set are iteratively substituted into the sentinel model for m times of gradient descent adjustment, m is a positive integer, and a total loss value is obtained according to the loss values corresponding to the m times of gradient descent adjustment. The model parameters are adjusted by the second data pairs and the total loss value.
[0110] Illustratively, the process of constructing the sentinel model and the training of the candidate classification model is shown in the following pseudo code.
[0111] Input: N: the number of classes of each task, N mini : the number of images used for each gradient descent, N meta : the number of tasks used for each meta-learning training, N adptNumber of inner loop of meta-learning
[0112] Input: U={x}: unlabeled dataset, S={(x, y)}: labeled support set
[0113] Input: γ, α, β: gradient descent hyperparameters
[0114] Input: Data augmentation function
[0115]
[0116]
[0117] where S is a labeled support set, i.e., the data x in S is labeled with a sample label y, and x and y form a data pair. Step 1 refers to initializing the model parameters θ of the initial model.
[0118] Steps 2-5 are the process of training the sentinel model. That is, N mini data is sampled from the labeled support set S, and the initial loss value is calculated by the cross-entropy loss function , so as to update the model parameters θ of the initial model, and finally obtain the sentinel model.
[0119] The calculation of the initial loss value is shown in the following formula one:
[0120] Formula one:
[0121] where f θ is the initial model to be adjusted for model parameters θ, p=f θ (x)=[p1,…,p N ] is the probability distribution of the N classes predicted by the initial model, y=[y1,…,y N ] is the probability distribution of the label y, and ∑ N y n =∑ N p n =1. For hard labels, y is a one-hot vector, i.e., when n=y, y n =1, otherwise y n =0.
[0122] Steps 6-18 are the outer loop process of meta-learning training.
[0123] Step 7 represents a loop process for each set of tasks in meta-learning training. Step 8 represents sampling N data from the unlabeled data set U. Step 9 represents inputting the N data into the trained sentinel model, outputting pseudo labels, and G represents the process of generating pseudo labels. Steps 10 and 11 are the processes of constructing the support set and constructing the query set. Step 12 is the process of constructing the training task according to the support set and the query set. That is, steps 7-12 are the processes of constructing N meta training tasks T with the same structure as the target task from the auxiliary data set.
[0124] Steps 13-17 are the inner loop processes of meta-learning training. Steps 15-17 refer to the model parameters θ being updated to θ' through N adpt gradient descent processes using the generated training tasks. i Step 18 represents updating the total loss calculated by θ' obtained by the model parameters through all tasks.
[0125] wherein the loss function is shown in Equation Two as follows.
[0126] Equation Two:
[0127] wherein L(y, f θ (x)) represents the loss value between the predicted result obtained by inputting the data x into the current model and the label y, and y can be a hard label (scalar) or a soft label (vector). For a hard label, the cross-entropy loss function in Equation One is used; for a soft label, the KL divergence loss is used, as shown in Equation Three as follows.
[0128] Equation Three:
[0129] Step 407 adjusts the model parameters of the candidate classification model through the first data to obtain a data classification model.
[0130] In some embodiments, after training the candidate classification model, the candidate classification model is supervised trained through the first data, the model parameters of the candidate classification model are fine-tuned, and a data classification model is obtained.
[0131] Step 408 classifies the target data through the data classification model to obtain the classification result of the target data in the target classification set.
[0132] After the sentinel model is trained, a data classification model is obtained, and the target data is classified through the data classification model, so that the classification result of the target data in the target classification set is obtained. The target data can be data in actual application, such as medical images in actual application; or the target data can also be data in the test set for testing the data classification model.
[0133] In summary, the data classification and identification method provided by the embodiment provides a sentinel model through supervised training of the first data with labels, and labels the second data with pseudo labels through the sentinel model, so that the sentinel model is trained through the pseudo labels, and finally a data classification model with higher performance and precision is obtained. A small amount of sample data with labels and a large amount of unlabeled data are used in the training, the amount of data of the first data with labels is small, the tedious process of labeling a large amount of sample data is avoided, and the training efficiency and accuracy of the data classification model are improved.
[0134] The method provided by the embodiment trains the sentinel model in a meta-learning training manner through the construction of a training task, thereby training a candidate classification model and further obtaining a data classification model, thereby improving the accurate training of the data classification model when the amount of sample label annotation is small, and improving the prediction accuracy of the data classification model.
[0135] In some embodiments, after the data classification model is trained, the data classification model is tested by a test set. Figure 5 is a flowchart of a data classification and identification method provided by another exemplary embodiment of the application, as shown in the method applied to a server as an example, the method comprises: Figure 5
[0136] Step 501, obtaining a first data set and a second data set.
[0137] Among them, the first data set includes first data labeled with sample labels, and the first data belongs to a target classification set, and the second data set includes second data.
[0138] In some embodiments, the second data in the second data set is data without labels, and the first data in the first data set is data labeled with sample labels.
[0139] Step 502, training a sentinel model through supervised training of the first data.
[0140] Since the first data is data belonging to the target classification set, and the first data is labeled with sample labels, the sentinel model obtained through supervised training of the first data is a model preliminarily trained for classification and prediction in the target classification set.
[0141] In some embodiments, an initial model is obtained, the initial model is a model initialized for data classification, and the initial model includes initial model parameters. Optionally, the initial model corresponds to the target classification set, and the initial model parameters of the initial model are model parameters obtained by random initialization.
[0142] The first data is input into the initial model to obtain a reference prediction result, and an initial loss value is determined based on the reference prediction result and a sample label. The initial model parameters are adjusted based on the initial loss value to obtain a sentinel model.
[0143] In step 503, the second data is input into the sentinel model to obtain a pseudo label corresponding to the second data.
[0144] The second data is unlabeled data, and the sentinel model is a model obtained by preliminary training of the first data. After the second data is input into the sentinel model for classification prediction, a pseudo label corresponding to the second data is output. The sentinel model is used for classification prediction of the second data in the target classification set.
[0145] In step 504, the sentinel model is meta-trained by the second data labeled with the pseudo label to obtain a data classification model.
[0146] In some embodiments, after the sentinel model is meta-trained by the second data labeled with the pseudo label, a candidate classification model is obtained, and the candidate classification model is adjusted in model parameters by the first data to obtain the data classification model.
[0147] In step 505, a test data set is obtained, and test data in the test data set is used to test the training effect of the data classification model.
[0148] In some embodiments, the test data in the test data set is pre-collected data corresponding to the target classification set.
[0149] In step 506, target data is obtained from the test data set, and the target data is labeled with reference classification information.
[0150] The reference classification information is used to represent the classification information of the target data in the target classification set, that is, the reference classification information is used to represent that the target data belongs to a category in the target classification set.
[0151] In step 507, the target data is classified and predicted by the data classification model to obtain a classification result.
[0152] The target data is input into the data classification model for classification prediction to obtain a corresponding classification result.
[0153] In step 508, the training effect data of the data classification model is obtained based on the reference classification information and the classification result.
[0154] Illustratively, a plurality of target data in the test data set is obtained, respectively classified and predicted, and compared with the reference classification information. According to the proportion of correct target data in the total number of tested target data, the training effect is determined, that is, the prediction accuracy of the data classification model is determined.
[0155] In summary, the data classification and identification method provided by the embodiment is used to obtain a sentinel model through supervised training of the first data with labels, and pseudo labels are labeled on the second data through the sentinel model, so that the sentinel model is trained through the pseudo labels, and finally a data classification model with higher performance and precision is obtained. In the training, a small amount of sample data with labels and a large amount of unlabeled data are used, the amount of data of the first data with labels is small, the tedious process of labeling a large amount of sample data is avoided, and the training efficiency and accuracy of the data classification model are improved.
[0156] The method provided by the embodiment further improves the prediction accuracy of the data classification model through the test data set.
[0157] The method provided by the embodiment reduces the amount of data labeled on the training data set, and reduces the labeling burden; and through the connection of the training process and the target task, a better classification effect on the target task is achieved.
[0158] Illustratively, the test process is as follows. The Omniglot small sample classification benchmark data set is tested. The Omniglot data set contains 1623 different handwritten characters from 50 different letters. Each character set contains 20 images drawn by different people.
[0159] The experiments all use a four-layer convolutional network structure, and the optimizer is Adam. The number of images used for each gradient descent of the sentinel model is 5.
[0160] When training the Omniglot data set, the image size input into the network is 28x28, the learning rates of the inner loop and the outer loop of the meta-learning are 0.05 and 0.001 respectively, the number of tasks required for each training N meta is 32; the training is performed 6000 times when the number of categories is 5, and 36000 times when the number of categories is 20; the number of inner loop times of meta-learning N adpt is 1, and the number of test times is 10.
[0161] First, we compared the influence of soft / hard pseudo label strategies on classification accuracy on the Omniglot validation set.
[0162] Table 1
[0163]
[0164]
[0165] (N, K) represents N categories, and K images corresponding to each category.
[0166] According to Table 1, the soft label strategy has a classification accuracy higher than the hard label when the number of categories is 5, and the hard label strategy is better than the soft label when the number of categories increases to 20 categories. Therefore, in the subsequent experiments, the soft label strategy is used when the test task is 5 categories, and the hard label is used when the test task is 20 categories. In addition, in order to study the effectiveness of connecting the target task, the application compares three different pre-training sentinel model methods: pre-training with representative classes, pre-training with randomly selected classes, and random initialization. The representative class is the class with the most similar features to other classes selected from the labeled images in the target task. Experiments show that pre-training with representative classes can achieve better classification results, and the sentinel model with random initialization has the worst result, which verifies the idea proposed in the application: by connecting the target task and the meta-learning process, the classification accuracy of the target task can be improved.
[0167] Table 2 shows the classification performance comparison of the data classification and identification method of the application and other methods applied to the Omniglot test set.
[0168] Table 2
[0169]
[0170]
[0171] The classification accuracy of the data classification and identification method provided by the application is higher than that of training from scratch and vanilla pseudo label, which illustrates the importance of using unlabeled data sets and pseudo label training. In addition, the data classification and identification method provided by the application exceeds all other methods in four experimental settings (different N, K settings). It proves the effectiveness of the method of connecting meta-learning and target task provided by the application.
[0172] Figure 6 is a structural block diagram of a data classification and identification device provided by an exemplary embodiment of the application, as Figure 6 shown, the device comprises:
[0173] The acquisition module 610 is configured to acquire a first data set and a second data set, the first data set comprising first data labeled with sample labels, and the first data belonging to a target classification set, and the second data set comprising second data.
[0174] The training module 620 is configured to train a sentinel model by supervised training of the first data.
[0175] The processing module 630 is configured to input the second data into the sentinel model and output the pseudo label corresponding to the second data.
[0176] The training module 620 is further configured to perform meta-learning training on the sentinel model by using the second data labeled with the pseudo labels, to obtain a data classification model.
[0177] The prediction module 640 is configured to perform classification prediction on target data by using the data classification model, to obtain a classification result of the target data in the target classification set.
[0178] In an optional embodiment, the training module 620 is further configured to perform meta-learning training on the sentinel model by using the second data labeled with the pseudo labels, to obtain a candidate classification model; and perform model parameter adjustment on the candidate classification model by using the first data, to obtain the data classification model.
[0179] In an optional embodiment, as shown in Figure 7 The apparatus further includes:
[0180] The construction module 650 is configured to obtain a training support set by using the pseudo labels and the corresponding second data to form first data pairs.
[0181] The construction module 650 is further configured to obtain a training query set by performing random enhancement processing on the first data pairs to form second data pairs.
[0182] The training module 620 is further configured to perform meta-learning training on the sentinel model by using the training support set and the training query set, to obtain the candidate classification model.
[0183] In an optional embodiment, the training module 620 is further configured to perform first adjustment on model parameters in the sentinel model by substituting the first data pairs in the training support set into the sentinel model; and perform second adjustment on the model parameters by using the second data pairs in the training query set.
[0184] The training module 620 is further configured to obtain the candidate classification model by iteratively performing parameter adjustment on n task pairs formed by n training support sets and n training query sets, where n is a positive integer.
[0185] In an optional embodiment, the training module 620 is further configured to perform m times of gradient descent adjustment on the sentinel model by iteratively substituting the first data pairs in the training support set into the sentinel model for m times, where m is a positive integer.
[0186] The training module 620 is further configured to obtain a total loss value according to loss values corresponding to the m times of gradient descent adjustment; and perform second adjustment on the model parameters by using the second data pairs and the total loss value.
[0187] In an optional embodiment, the obtaining module 610 is further configured to obtain an initial model, the initial model being a model for initializing data classification, and the initial model including initial model parameters.
[0188] The training module 620 is further configured to input the first data into the initial model to obtain a reference prediction result, determine an initial loss value based on the reference prediction result and the sample label, and adjust the initial model parameters based on the initial loss value to obtain the sentinel model.
[0189] In an optional embodiment, the training module 620 is further configured to, in response to the reference prediction result including a hard label prediction result corresponding to the first data and the target classification set, determine the initial loss value by using a cross-entropy loss function.
[0190] The training module 620 is further configured to, in response to the reference prediction result including a soft label prediction result corresponding to the first data and the target classification set, determine the initial loss value by using a divergence function.
[0191] In an optional embodiment, a first data amount of the first data in the first data set is less than a second data amount of the second data in the second data set.
[0192] In an optional embodiment, the obtaining module 610 is further configured to obtain a test data set, test data in the test data set being used to test a training effect of the data classification model, and obtain the target data from the test data set, the target data being labeled with reference classification information.
[0193] The prediction module 640 is further configured to perform classification prediction on target data by using the data classification model to obtain the classification result.
[0194] The obtaining module 610 is further configured to obtain training effect data of the data classification model based on the reference classification information and the classification result.
[0195] In summary, the data classification and recognition apparatus provided in this embodiment obtains a sentinel model through supervised training of labeled first data, labels pseudo labels for second data through the sentinel model, performs meta-learning training on the sentinel model through the pseudo labels, and finally obtains a data classification model with higher performance and precision. In the training, a small amount of sample data with labels and a large amount of unlabeled data are used, the amount of data of the labeled first data is small, the cumbersome process of labeling a large amount of sample data is avoided, and the training efficiency and accuracy of the data classification model are improved.
[0196] It should be noted that the data classification recognition device provided in the above embodiment is only exemplified by the division of the above functional modules. In actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the data classification recognition device and the data classification recognition method provided in the above embodiment belong to the same concept, and the specific implementation process is described in the method embodiment, which will not be described here.
[0197] Figure 8 The structure diagram of the server provided in an example embodiment of the present application is shown.
[0198] Specifically, the server 800 includes a central processing unit (CPU) 801, a system memory 804 including a random access memory (RAM) 802 and a read only memory (ROM) 803, and a system bus 805 connecting the system memory 804 and the central processing unit 801. The server 800 further includes a mass storage device 806 for storing an operating system 813, application programs 814 and other program modules 815.
[0199] The mass storage device 806 is connected to the central processing unit 801 through a mass storage controller (not shown) connected to the system bus 805. The mass storage device 806 and its associated computer readable medium provide non-volatile storage for the server 800. That is, the mass storage device 806 can include a computer readable medium (not shown) such as a hard disk or a compact disc read only memory (CD-ROM) drive.
[0200] Without loss of generality, the computer readable medium can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other solid state memory technology, CD-ROM, Digital Versatile Disc (DVD), or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. It should be understood by those skilled in the art that computer storage media does not limit to the above-mentioned several types. The system memory 804 and the mass storage device 806 mentioned above can be collectively referred to as memory.
[0201] According to various embodiments of the present application, the server 800 can also run on a remote computer connected to the network through a network connection such as the Internet. That is, the server 800 can be connected to the network 812 through the network interface unit 811 connected to the system bus 805, or can be connected to other types of networks or remote computer systems (not shown) using the network interface unit 811.
[0202] The above-mentioned memory further includes one or more programs, one or more programs are stored in the memory and are configured to be executed by the CPU.
[0203] Embodiments of the present application also provide a computer device including a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the data classification and identification method provided by the above-mentioned method embodiments.
[0204] Embodiments of the present application also provide a computer readable storage medium, the computer readable storage medium storing at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the data classification and identification method provided by the above-mentioned method embodiments.
[0205] The embodiment of the present application further provides a computer program product or computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data classification and identification method in any of the above embodiments.
[0206] Optionally, the computer readable storage medium can include a read only memory (ROM), a random access memory (RAM), a solid state disk (SSD), an optical disk, etc. The random access memory can include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0207] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by program instructing relevant hardware to complete, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read only memory, a magnetic disk or an optical disk.
[0208] The above-mentioned is only optional embodiment of the present application, and does not limit the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A data classification recognition method, characterized by, The method comprises: obtaining a first data set and a second data set, the first data set comprising first data labeled with sample labels, the first data belonging to a target classification set, the second data set comprising second data, the first data set comprising first sample images of rare objects, the second data set comprising second sample images of common objects of the same type, and the second data set being sampled from the same distribution as the target classification set task; training a sentinel model by supervised training of the first data; inputting the second data into the sentinel model to output pseudo-labels corresponding to the second data; The sentinel model is subjected to meta-learning training by the second data labeled with the pseudo label to obtain a data classification model, and the meta-learning training includes an inner loop and an outer loop, and the outer loop includes a process of constructing a training task, the inner loop and an updating process. In the process of constructing the training task, data is sampled from an unlabeled data set, a first data pair is formed by the pseudo label and corresponding second data, a support set is obtained, a second data pair is formed by random enhancement processing of the first data pair, a query set is obtained, and a training task is constructed according to the support set and the query set. In the inner loop process, the model parameters θ of the sentinel model are updated by the generated training task through a gradient descent process ; in the updating process, the model parameters θ are updated by the total loss calculated by all tasks . performing classification prediction on target data by the data classification model to obtain a classification result of the target data in the target classification set.
2. The method of claim 1, wherein, The meta-learning training of the sentinel model by the second data labeled with the pseudo-labels to obtain a data classification model comprises: meta-learning training of the sentinel model by the second data labeled with the pseudo-labels to obtain a candidate classification model; adjusting model parameters of the candidate classification model by the first data to obtain the data classification model.
3. The method of claim 2, wherein, The meta-learning training of the sentinel model by the second data labeled with the pseudo-labels to obtain a candidate classification model comprises: forming a first data pair with the pseudo-labels and the corresponding second data to obtain a training support set; performing random enhancement processing on the first data pair to form a second data pair to obtain a training query set; meta-learning training of the sentinel model by the training support set and the training query set to obtain the candidate classification model.
4. The method of claim 3, wherein, The meta-learning training of the sentinel model by the training support set and the training query set to obtain the candidate classification model comprises: substituting the first data pair in the training support set into the sentinel model to perform first adjustment on model parameters in the sentinel model; performing second adjustment on the model parameters by the second data pair in the training query set; after parameter adjustment by n task pairs formed by n training support sets and n training query sets, obtaining the candidate classification model, n being a positive integer.
5. The method of claim 4, wherein, The first adjustment on the model parameters in the sentinel model by substituting the first data pair in the training support set into the sentinel model comprises: iterating m times to substitute the first data pair in the training support set into the sentinel model to perform m times of gradient descent adjustment, m being a positive integer; The second adjustment on the model parameters by the second data pair in the training query set comprises: obtaining a total loss value according to loss values corresponding to m times of gradient descent adjustment; and performing second adjustment on the model parameters by the second data pair and the total loss value.
6. The method according to any one of claims 1 to 5, characterized in that, The training of the sentinel model by supervised training of the first data comprises: obtaining an initial model, the initial model being a model initialized for data classification, the initial model comprising initial model parameters; inputting the first data into the initial model to obtain a reference prediction result; determine an initial loss value based on the reference prediction result and the sample label; adjust the initial model parameter based on the initial loss value to obtain the sentinel model.
7. The method of claim 6, wherein, The method comprises the following steps: in response to the reference prediction result comprising a hard label prediction result corresponding to the first data of the target classification set, determining the initial loss value by using a cross-entropy loss function; in response to the reference prediction result comprising a soft label prediction result corresponding to the first data of the target classification set, determining the initial loss value by using a divergence function.
8. The method of any one of claims 1-5, wherein: the first data amount of the first data in the first data set is less than the second data amount of the second data in the second data set.
9. The method according to any one of claims 1 to 5, characterized in that, The method comprises the following steps: obtaining a test data set, wherein the test data in the test data set is used to test the training effect of the data classification model; obtaining the target data from the test data set, wherein the target data is labeled with reference classification information; obtaining the classification result by classifying the target data through the data classification model; obtaining the training effect data of the data classification model based on the reference classification information and the classification result.
10. A data classification recognition apparatus characterized by comprising: The device comprises: an acquisition module, configured to acquire a first data set and a second data set, wherein the first data set comprises first data labeled with sample labels, and the first data belongs to a target classification set; the second data set comprises second data; the first data set comprises first sample images of rare objects; the second data set comprises second sample images of common objects of the same type; and the second data set is sampled from the same distribution as the target classification set task. a training module, configured to train a sentinel model through supervised training of the first data; a processing module, configured to input the second data into the sentinel model to output pseudo labels corresponding to the second data; The training module is further configured to perform meta-learning training on the sentinel model by using the second data labeled with the pseudo labels to obtain a data classification model, wherein the meta-learning training includes an inner loop and an outer loop, the outer loop includes a process of constructing a training task, the inner loop, and an updating process, in the process of constructing the training task, data is sampled from an unlabeled data set, a first data pair is formed by using the pseudo labels and corresponding second data, a support set is obtained, a second data pair is formed by performing random enhancement processing on the first data pair, a query set is obtained, and a training task is constructed according to the support set and the query set; in the inner loop, the model parameters θ of the sentinel model are updated by using the generated training task through a gradient descent process to obtain ; in the updating process, the model parameters θ are updated by using a total loss calculated by all tasks . a prediction module, configured to classify target data through the data classification model to obtain a classification result of the target data in the target classification set.
11. The apparatus of claim 10, wherein, The training module is further configured to perform meta-learning training on the sentinel model by using the second data labeled with the pseudo labels to obtain a candidate classification model; and perform model parameter adjustment on the candidate classification model by using the first data to obtain the data classification model.
12. The apparatus of claim 11, wherein, The device further comprises: a construction module, configured to construct a first data pair by using the pseudo labels and the corresponding second data to obtain a training support set; the construction module is further configured to perform random enhancement processing on the first data pair to construct a second data pair to obtain a training query set; the training module is further configured to perform meta-learning training on the sentinel model by using the training support set and the training query set to obtain the candidate classification model.
13. A computer device, comprising: The computer device comprises a processor and a memory, and the memory stores at least one program, which is loaded and executed by the processor to implement the data classification and identification method according to any one of claims 1 to 9.
14. A computer-readable storage medium, characterized in that, The storage medium stores at least one program, which is loaded and executed by the processor to implement the data classification and identification method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Image recognition method and device
CN112766323A
Target classification method and device
CN112966701A