Method, apparatus, device, medium and product for processing sample data
By dividing and augmenting training data based on label similarity, the method improves classification model precision in large-scale tasks like face recognition by focusing on underrepresented similar faces.
Patent Information
- Application Number
- CN202210104545.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-01-28
AI Technical Summary
In large-scale classification tasks, the existing technology lacks training sample data due to hardware limitations, resulting in insufficient differences between models learning similar faces, resulting in low model accuracy.
By dividing the sample data set into similar sample groups and independent sample groups, the expanded sample data is obtained from the similar sample groups during sampling, and a training sample set is generated with the target sample data to train the classification model.
The model accuracy of the classification model in large-scale classification scenarios is improved, and the differences between similar labels can be better learned and the identification accuracy is improved.
Smart Images

Figure CN116563658B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and particularly to a method, apparatus, device, medium, and product for processing sample data. Background Art
[0002] The classification task based on Artificial Intelligence (AI) refers to classifying and identifying the input data through a classification model. Among them, when the number of categories corresponding to the classification task is large, the classification task can be regarded as a large-scale classification task. Biometric technology (such as face recognition) can be regarded as a large-scale classification task, that is, the data corresponding to each person is a category.
[0003] In the related art, taking face recognition as an example, the training process of the model is to pre-collect a certain number of training sample data. During the model training process, since the hardware does not support inputting all training data in one training process, it is necessary to randomly sample the training sample data, input the sampled training sample data into the model for training, and through multiple sampling and iterative training processes, the corresponding face recognition model is obtained.
[0004] However, in the actual application of the model, there will be a problem of misidentifying similar faces. Since the amount of training sample data is much larger than the input amount supported by the hardware, and during the sampling process, the probability that the training sample data corresponding to similar faces is sampled into the same training batch is low. Therefore, the differences between similar faces learned by the model during the training process are weak, resulting in a problem of low model accuracy. Summary of the Invention
[0005] Embodiments of this application provide a method, apparatus, device, medium, and product for processing sample data, which improves the model accuracy of the classification model in large-scale classification scenarios. The technical solutions are as follows:
[0006] On the one hand, a method for processing sample data is provided. The method includes:
[0007] Obtain a sample data set, where the sample data in the sample data set is labeled with sample labels, the sample data in the sample data set is divided into similar sample groups or independent sample groups, the similar sample groups are composed of sample data with a similarity relationship between at least two sample labels, and the sample labels corresponding to the sample data in the independent sample group have no such similarity relationship with other sample labels in the sample data set;
[0008] Sample the sample data set to obtain target sample data;
[0009] In response to the target sample data belonging to a target similar sample group, obtain augmented sample data from the target similar sample group;
[0010] Generate a training sample set based on the target sample data and the augmented sample data, where the training sample set is used to train a candidate classification model to obtain a target classification model, and the target classification model is used for data classification and recognition.
[0011] On the other hand, a sample data processing device is provided, and the device includes:
[0012] An acquisition module for acquiring a sample data set, where the sample data in the sample data set is labeled with sample labels, the sample data in the sample data set is divided into a similar sample group or an independent sample group, the similar sample group consists of sample data with a similarity relationship between at least two sample labels, and the sample labels corresponding to the sample data in the independent sample group do not have the similarity relationship with other sample labels in the sample data set;
[0013] A sampling module for sampling the sample data set to obtain target sample data;
[0014] An augmentation module for obtaining augmented sample data from the target similar sample group in response to the target sample data belonging to the target similar sample group;
[0015] A generation module for generating a training sample set based on the target sample data and the augmented sample data, where the training sample set is used to train a candidate classification model to obtain a target classification model, and the target classification model is used for data classification and recognition.
[0016] On the other hand, a computer device is provided, where the terminal includes a processor and a memory, and at least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement any one of the sample data processing methods in the embodiments of the present application.
[0017] On the other hand, a computer-readable storage medium is provided, and at least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by the processor to implement any one of the sample data processing methods in the embodiments of the present application.
[0018] On the other hand, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are 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 processing method of sample data described in any one of the above embodiments.
[0019] The technical solutions provided in this application at least include the following beneficial effects:
[0020] When training a classification model for data classification and recognition, when the target sample data obtained by sampling belongs to a similar sample group in which the sample labels have a similar relationship, a training sample set for training the classification model is jointly generated by the target sample data and the augmented sample data in the similar sample group. That is, when there are other sample data with similar labels in the sample data set of the sampled sample data, augmented sample data is obtained from the other sample data with similar labels, so that in a large-scale classification scenario, the model can fully learn the differences between sample data with similar labels, thereby improving the model accuracy of the classification model. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of this application, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1 It is a schematic diagram of the projection of facial features in the feature space provided by an exemplary embodiment of this application;
[0023] Figure 2 It is a schematic diagram of the actual situation and the expected situation of the projection of feature vectors provided by an exemplary embodiment of this application;
[0024] Figure 3 It is a schematic diagram of the face recognition training process in a related technology of this application;
[0025] Figure 4 It is a schematic diagram of a computer system provided by an exemplary embodiment of this application;
[0026] Figure 5 It is a flowchart of the processing method of sample data provided by an exemplary embodiment of this application;
[0027] Figure 6 It is a schematic diagram of the similarity calculation of sample labels provided by an exemplary embodiment of this application;
[0028] Figure 7 It is a schematic diagram of generating a training sample set provided by an exemplary embodiment of the present application;
[0029] Figure 8 It is a flowchart of a method for processing sample data provided by another exemplary embodiment of the present application;
[0030] Figure 9 It is a schematic diagram of determining augmented sample data provided by an exemplary embodiment of the present application;
[0031] Figure 10 It is a schematic diagram of determining augmented sample data provided by another exemplary embodiment of the present application;
[0032] Figure 11 It is a flowchart of a method for processing sample data provided by another exemplary embodiment of the present application;
[0033] Figure 12 It is a schematic diagram of sample group division provided by an exemplary embodiment of the present application;
[0034] Figure 13 It is a schematic diagram of similar appearances provided by an exemplary embodiment of the present application;
[0035] Figure 14 It is a schematic diagram of similarity caused by posture / accessories provided by an exemplary embodiment of the present application;
[0036] Figure 15 It is a schematic diagram of data division provided by an exemplary embodiment of the application;
[0037] Figure 16 It is a schematic diagram of dividing data to be processed provided by an exemplary embodiment of the present application;
[0038] Figure 17 It is a schematic diagram of the composition of a sample data set provided by an exemplary embodiment of the present application;
[0039] Figure 18 It is a block diagram of the structure of a processing device for sample data provided by an exemplary embodiment of the present application;
[0040] Figure 19 It is a block diagram of the structure of a processing device for sample data provided by another exemplary embodiment of the present application;
[0041] Figure 20 It is a schematic diagram of the structure of a server provided by an exemplary embodiment of the present application. Detailed implementation manners
[0042] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0043] First, briefly introduce the nouns involved in the embodiments of this application:
[0044] Artificial intelligence uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, including theories, methods, technologies, and application systems for perceiving the environment, acquiring knowledge, and using knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines, enabling machines to have the functions of perception, reasoning, and decision-making.
[0045] Artificial intelligence technology is an interdisciplinary subject with a wide range of fields involved, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. The software technologies of artificial intelligence mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning, autonomous driving, and intelligent transportation.
[0046] Machine Learning (ML) is an interdisciplinary subject involving multiple fields such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve their own performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent, and its applications cover all fields of artificial intelligence. Machine learning and deep learning usually include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning from demonstration.
[0047] Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between humans and computers using natural language. Natural language processing is a science that combines linguistics, computer science, and mathematics. Therefore, the research in this field will involve natural language, that is, the language people use in daily life, so it has a close connection with the research of linguistics. Natural language processing technologies usually include text processing, semantic understanding, machine translation, robot question answering, knowledge graph, and other technologies.
[0048] Computer Vision Technology (CV) Computer vision is a science that studies how to enable machines to "see". More specifically, it refers to using cameras and computers to replace human eyes for tasks such as object recognition and measurement in machine vision, and further performing image processing to make the images processed by the computer more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to build artificial intelligence systems that can obtain information from images or multi-dimensional 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 recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality map construction, autonomous driving, intelligent transportation and other technologies, as well as common feature recognition technologies such as face recognition.
[0049] The method for processing sample data provided by the embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, intelligent transportation, assisted driving, etc. For example, it can be applied to large-scale text classification tasks in natural language processing, such as text label annotation tasks, or to large-scale image classification tasks in computer vision technology, such as face recognition tasks, medical image recognition tasks, insect image recognition tasks, etc., and can also be applied to large-scale speech classification tasks in audio processing technology, such as multi-dialect speech recognition tasks, multi-language speech recognition tasks, etc. By enabling the classification model to fully learn the differences in sample data between similar labels during the training process of the classification model, the model accuracy of the classification model can be improved.
[0050] Illustratively, the method for processing sample data provided by the embodiments of the present application is taken as an example in the face recognition scenario for description.
[0051] Among them, face recognition technology is a computer technology that uses the analysis and comparison of face visual feature information for identity authentication. It belongs to biometric recognition technology and uses facial features as features to distinguish biological individuals. Currently, face recognition technology has been widely used in fields such as self-service, security and management of enterprises or residences, and information security.
[0052] Illustratively, face recognition can be regarded as the projection of the feature vector of a face image onto a hypersphere, and different people fall into different regions on the hypersphere. As Figure 1 shown, it shows a schematic diagram of the projection of facial features in the feature space provided by an exemplary embodiment of the present application. The facial feature vector 110 corresponding to person A is projected into region A111 in hypersphere 100, and the facial feature vector 120 corresponding to person B is projected into region B121 in hypersphere 100.
[0053] Among them, the greater the difference in the faces corresponding to different people, the greater the angle or distance between the facial feature vectors. On the contrary, the higher the similarity of the faces corresponding to different people, the smaller the angle or distance between the facial feature vectors. However, in the process of face recognition applications, in order to improve the accuracy of recognizing similar faces and reduce misidentifications between similar faces, it is desired that when the facial feature vectors are projected onto the hypersphere, the distance between similar faces is farther, so that similar faces are more distinguishable during the recognition process. As Figure 2 shown, it shows a schematic diagram of the actual and desired situations of feature vector projection provided by an exemplary embodiment of the present application. In the actual situation 210, person A201 corresponds to projection area A211, person B202 corresponds to projection area B212, and person C203 corresponds to projection area C213. Among them, since the facial features corresponding to task A201 and person B202 are similar, the distances between the corresponding projection areas A211 and projection area B212 are relatively close; while in the ideal situation 220, the distance between the projection area A’221 corresponding to person A201 and the projection area B’222 corresponding to person B202 is farther.
[0054] The training process of the face recognition model can be regarded as an extremely large-scale classification task, with each person corresponding to a category. Assuming that there are 10,000 sample objects participating in the model training, and each person has 100 face images, then the total number of categories is 10,000 categories, and the data volume of the training sample data is 1 million sample facial images. Since the hardware does not support full-category input, therefore, the optimization process for each category is implemented based on random sampling batches (Batch). As Figure 3 shown, it shows a schematic diagram of the face recognition training process in a related technology. The training data 301 undergoes random sampling 302 to obtain a certain number of sampled data 303, and the sampled data 303 is input into the face recognition model 304 for supervised training. After repeating multiple iterative trainings, the trained face recognition model is obtained.
[0055] However, the face recognition model trained by the above process has the following problems: 1. The model optimization direction is the local minimum solution for all categories. The proportion of similar face data in the training set is not high, and the optimization of similar faces is easily overlooked; 2. Similar faces are a corresponding relationship (for example, there is facial similarity between person A and person B). The probability of obtaining a group of similar faces in the randomly sampled training sample data is very low. Then it is very difficult for the model to learn the differences between the features of similar faces during the training process, so similar faces are also difficult to be optimized.
[0056] In the embodiments of the present application, when there are other similar sample facial images in the sample data set that are similar to the sampled sample facial image but do not belong to the same person, an augmented sample facial image is obtained from the above-mentioned similar sample facial images, and the sampled sample facial image and the augmented sample facial image are jointly input into the face recognition model for training, so that the model can fully learn the differences between the sample facial images of similar faces, thereby improving the model accuracy of the face recognition model.
[0057] Alternatively, taking the application in the animal category recognition scenario as an example, for example, a classification model for identifying according to the breed of cats. Schematically, "Siamese cats" and "Colorpoint Shorthair cats" belong to different breeds, but there are similar characteristics between them (the face, ears, feet, and tail show colors different from the body). Through the sample data processing method provided by the embodiments of the present application, when the target sample data randomly sampled during the training of the classification model is the sample data of "Siamese cats", augmented sample data is resampled from the sample data of "Colorpoint Shorthair cats", and the target sample data and the augmented sample data are jointly input into the classification model to participate in the training, so that the classification model can learn the differences between the two and better accurately identify the images of "Siamese cats" and "Colorpoint Shorthair cats" in the actual application process.
[0058] The above only takes the application of the sample data processing method provided by the embodiments of the present application in the face recognition scenario and the animal category recognition scenario as examples for illustration. This method can also be applied to other classification scenarios. For example, in the speech recognition scenario, enhance the differences between similar voices of different people; in the speech-to-text recognition scenario, enhance the differences between similar pronunciation features under different types of languages; in the medical image recognition scenario, enhance the differences between similar lesion images under different disease types, etc. The specific application scenarios are not limited here.
[0059] It should be noted that when this method is applied to classification tasks related to biometric features and involves sample data of human biometric features, when the embodiments provided in the present application are applied to specific products or technologies, the above sample data needs to obtain the permission or consent of the sample object (user), and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.
[0060] Combined with the above explanations of the terms and application scenarios, the implementation environment of the embodiments of the present application is described. As Figure 4 shown, the computer system of this implementation environment includes: a terminal device 410, a server 420, and a communication network 430.
[0061] The terminal device 410 includes devices in various forms such as mobile phones, tablet computers, desktop computers, portable laptops, intelligent voice interaction devices, smart home appliances, in-vehicle terminals, etc. Schematically, the user instructs the server 420 to train the classification model through the terminal device 410.
[0062] The server 420 is used to provide the training function for the classification model, that is, the server 420 can call the corresponding operation module according to the request of the terminal device 410 to train the specified classification model. Optionally, the model architecture corresponding to the classification model can be pre-stored in the server 420, or can be uploaded by the terminal device 410 through a model data file; the training data set for the classification model training can be pre-stored in the server 420, or can be uploaded by the terminal device 410 through a sample data file. In one example, the user uploads the sample data set to the server 420 through the terminal device 410 and sends a training request for the candidate classification model. The training request carries the model identifier (ID) of the candidate classification model. The server 420 reads the model architecture of the candidate classification model corresponding to the model ID from the database according to the model ID in the training request, and trains the candidate classification model through the received sample data set.
[0063] Among them, during the training process, the sample data set is randomly sampled to obtain target sample data. When the target sample belongs to the target similar sample group, additional sample data is further screened out from the target similar sample group. The target sample data and the additional sample data are jointly used as training samples and input into the candidate classification model for training, and finally the target classification model is obtained.
[0064] Schematically, after the server 420 trains the target classification model, the server 420 can send the target classification model to the terminal device 410, or can allocate the target classification model to the model application module. The model application module is a model in the server 420 that provides the application function of the model. For example, the terminal device 410 sends a classification request to the server 420, and the classification request includes the data to be classified. After receiving the classification request, the server 420 forwards it to the above-mentioned model application module. The model application module calls the corresponding target classification model, then inputs the data to be classified in the classification request into the target classification model for data classification and recognition to obtain a classification result, and the server 420 returns the above classification result to the terminal device 410.
[0065] In some embodiments, if the computing power of the terminal device 410 meets the training process of the above candidate classification model, the overall training process of the above candidate classification model can also be realized by the terminal device 410 alone.
[0066] It should be noted that the above-mentioned server 420 can be an independent physical server, or a server cluster or 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, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms.
[0067] Among them, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to achieve data calculation, storage, processing, and sharing. Cloud technology is the general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model, which can form a resource pool, be used on demand, and be flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require 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, in the future, each item may have its own identification mark and needs to be transmitted to the background system for logical processing. Data at different levels will be processed separately, and various industry data requires a powerful system back-end support, which can only be achieved through cloud computing.
[0068] In some embodiments, the above-mentioned server 420 can also be implemented as a node in a blockchain system. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithms.
[0069] Schematically, the terminal device 410 and the server 420 are connected through a communication network 430. Among them, the above-mentioned communication network 430 can be a wired network or a wireless network, which is not limited herein.
[0070] Based on the description of the above application scenarios and implementation environments, please refer to Figure 5 , which shows a flowchart of a method for processing sample data shown in an embodiment of the present application. In the embodiment of the present application, it is assumed that this method is applied to a server as shown in Figure 4 . Of course, this method can also be applied to a terminal device, and only a schematic description is given here without limiting the specific execution entity. The method includes the following steps.
[0071] 501: Obtain a sample data set, and the sample data in the sample data set is labeled with sample labels.
[0072] Schematically, the above sample data set is used in the training process of the candidate classification model, and the sample data set includes a target number of sample data. Among them, the sample labels are used to distinguish the sample categories of the sample data in the classification task corresponding to the candidate classification model. For example, when the above classification task is a face recognition task, the sample data belonging to the same object are labeled with the same sample label, that is, the sample data corresponding to the same object belong to the same sample category.
[0073] Optionally, the model architecture of the above candidate classification model can be a Convolutional Neural Network (CNN) architecture, a Deep Residual Networks (DRN) architecture, a Deep Residual Shrinkage Networks (DRSN) architecture, a Support Vector Machines (SVM) architecture, etc., which are model architectures capable of completing classification tasks.
[0074] Schematically, the sample data set includes sample data corresponding to at least two sample labels, and one sample label corresponds to at least one sample data.
[0075] In some embodiments, the classification task corresponding to the above candidate classification model can be a single classification task, that is, each sample data corresponds to only one sample label. In one example, taking the face recognition task as an example, the sample label marked for the sample data is the corresponding sample object. For example, if sample data A is a face image of person A, then the sample label marked for sample data A is "person A". In some other embodiments, the classification task corresponding to the above candidate classification model can be a multi-classification task, that is, each sample data corresponds to multiple labels. In one example, taking the animal recognition task as an example, the sample labels marked for the sample data include the corresponding sample object and the multi-level classification corresponding to the sample object. For example, if sample data A is an image of a Siamese cat, sample data A is marked with a total of five-level labels, and the multi-level sample labels from top to bottom are "Mammalia", "Carnivora", "Felidae", "Cat", "Siamese cat".
[0076] The sample labels marked for the sample data in the sample data set are determined according to the classification task, that is, the same sample content can be marked with different sample labels according to different classification tasks. For example, when the classification task indicates classifying the input image according to animal species, the sample label of the image of "Siamese cat" is "Cat", and the sample label of the image of "British Shorthair with Colorpoint" is also "Cat". When the classification task indicates classifying the input image according to the breed of the cat, the sample label of the image of "Siamese cat" is "Siamese", and the sample label of the image of "British Shorthair with Colorpoint" is "Colorpoint British Shorthair".
[0077] The sample data in the sample data set are divided into similar sample groups or independent sample groups. Among them, a similar sample group consists of sample data with a similarity relationship between at least two sample labels, and the sample labels corresponding to the sample data in the independent sample group do not have the above similarity relationship with other sample labels in the sample data set.
[0078] Schematically, there is a label similarity relationship between the sample data belonging to the same similar sample group, that is, a similar sample group consists of sample data with a similarity relationship between at least two sample labels. Optionally, the above label similarity relationship can indicate the similarity situation between sample data marked with different sample labels. For example, the similar sample group A includes sample data A marked with sample label 1, sample data B marked with sample label 2, and sample data C marked with sample label 3. Then there is a label similarity relationship between sample data A, sample data B, and sample data C. Specifically, taking the face recognition task as an example, the sample face images marked with sample labels for different sample objects have a similarity relationship, that is, there is a situation of similar facial features between sample objects; and / or the above label similarity relationship can indicate the similarity situation between sample data marked with the same label. For example, the similar sample group B includes sample data D and sample data E marked with sample label 4. Then there is a label similarity relationship between the above sample data D and sample data E.
[0079] Optionally, the similarity relationship between the above sample labels can be determined by the similarity between the sample data corresponding to the sample labels. Schematically, a sample label corresponds to a target number of sample data, and the similarity between two different sample labels can be determined by calculating the similarity between the sample data corresponding to the two sample labels respectively.
[0080] Schematically, when determining the similarity between the above sample labels through the similarity data between sample data, sample data in different data forms can be determined by different similarity data.
[0081] In one example, when the data form of the sample data is text form, the above similarity data can be obtained by at least one of the clause semantic similarity, word segmentation semantic similarity, character similarity, etc. between the text contents of the sample data. Among them, the above clause semantic similarity is the data determined by comparing the semantic similarity between different clauses of two sample data after dividing the text content by sentence; the above word segmentation similarity is the data determined by comparing the semantic similarity between different word segments of two sample data after dividing the text content by word; the above character similarity is the data determined by comparing the similarity between the constituent characters of the text contents of two sample data.
[0082] In another example, when the data form of the sample data is in the form of an image, the above similarity data can be obtained from at least one of the histogram distribution similarity, image feature similarity, pixel array similarity, etc. between the image contents of the sample data. Among them, the above histogram distribution similarity is data determined by comparing the distribution similarity of histograms between the image contents corresponding to the sample data; the above image feature similarity is data determined by calculating the feature angle data or feature distance data between the image features corresponding to different image contents after feature extraction of the image content; the above pixel array similarity is data determined by converting the pixels corresponding to the image content into a grayscale value array and then calculating the similarity between the grayscale value arrays corresponding to different image contents.
[0083] In another example, when the data form of the sample data is in the form of speech, the above similarity data can be obtained from at least one of the acoustic similarity, text conversion semantic similarity, audio feature similarity, etc. between the speech contents of the sample data. Among them, the above acoustic similarity is data determined by dividing the speech content into phonemes and then comparing the similarity between the phonemes corresponding to different speech contents; the above text conversion semantic similarity is data determined by converting the speech content into text content and then comparing the semantic similarity between different text contents; the above audio feature similarity is data determined by converting the speech content into audio features and then calculating the feature angle data or feature distance data between different audio features.
[0084] Specifically, taking the candidate classification model for completing the face recognition classification task as an example, the data form corresponding to the sample data is in the form of an image. In the sample data set, there are a total of 10,000 sample objects, and each sample object corresponds to 100 sample face images. The sample face images of the same sample object are labeled with the same sample label. When calculating the similarity between sample labels, calculate the average similarity data between the sample face images corresponding to each pair of sample objects. Among them, the similarity data between the above sample face images is determined according to the similarity between the face features in the sample face images.
[0085] For example, such as Figure 6As shown, it shows a schematic diagram of the similarity calculation of sample labels provided by an exemplary embodiment of the present application. The sample object A610 corresponds to 100 sample facial images A611, and the sample object B620 corresponds to 100 sample facial images B621. The sample facial images A611 and the sample facial images B621 are input into the pre-trained image similarity detection model 601 in pairs, and 10,000 similarity data 630 are output. The above 10,000 similarity data 630 are averaged to obtain the label similarity 640 representing the similarity between the sample object A610 and the sample object B620.
[0086] Optionally, the similarity relationship between the above sample labels can also be determined by the similarity between the sample labels, that is, by calculating the similarity between the sample labels to determine whether the sample labels satisfy the similarity relationship. In one example, by calculating the text similarity between the sample labels, when the semantic similarity reaches the target threshold, it is determined that the sample labels satisfy the similarity condition. The above text similarity can be calculated by character comparison of the sample labels or can be completed through a pre-trained text similarity calculation model. For example, by calculation, the text similarity between the sample label "panda" and the sample label "lesser panda" is 66.7%, which is higher than the target threshold of 60%, so it is determined that there is a similarity relationship between the sample label "panda" and the sample label "lesser panda". In this case of determining the similarity relationship between sample labels, the sample contents between the sample data with label similarity relationships may be similar or completely different.
[0087] In the embodiment of the present application, when the label similarity between the sample labels satisfies the similarity condition, a corresponding similar sample group is generated according to the sample data corresponding to the sample labels. For example, when the label similarity between the sample label A and the sample label B satisfies the similarity condition, a similar sample group is generated according to the sample data corresponding to the sample label A and the sample data corresponding to the sample label B. The similar sample group also records the mapping relationship between the sample label A and the sample label B.
[0088] In some other embodiments, similar sample groups are obtained through clustering. Schematically, all sample data corresponding to the sample data set are clustered, and the similar sample data obtained through clustering are placed in the same similar sample group. Since the sample data corresponding to the same sample label belong to the same sample object, and the similarity of the sample data within the same sample label is higher than that between sample labels, the sample data belonging to the same sample label also belong to the same similar sample group. Among them, the clustering process of the sample data can be implemented by any one of clustering algorithms such as the k-means clustering algorithm (K-Means Clustering Algorithm, k-means), the bisecting k-means clustering algorithm (Bisecting K-Means Clustering Algorithm, bi-kmeans), the density-based spatial clustering of applications with noise (Density-Based Spatial Clustering of Applications with Noise, DBSCAN), and the ordering points to identify the clustering structure algorithm (Ordering Points to Identify the Clustering Structure, OPTICS).
[0089] In some embodiments, the sample data set further includes independent sample data, and the independent sample data is used to indicate other sample labels for which there is no such similar relationship for the corresponding sample label in the sample data set. For example, taking the face recognition task as an example, among all sample objects, there is an independent sample object that has no similar relationship with all other sample objects, and the sample face image corresponding to the independent sample object is the above-mentioned independent sample data.
[0090] Optionally, the above sample data set can be read from the database of the server or uploaded by the terminal device, which is not limited herein.
[0091] 502: Sample the sample data set to obtain target sample data.
[0092] In some embodiments, the candidate classification model is iteratively trained with the sample data in the input sample data set until the candidate classification model converges, and then the trained target classification model is determined. Schematically, the training process of the candidate classification model includes at least one training stage, or can be called a training batch. In one training stage, a batch of sample data is input into the candidate classification model for training, and the corresponding loss value is determined through the loss function corresponding to the model. Whether to enter the next training stage or determine that the training is completed to obtain the target classification model is determined according to the loss value. Since the number of sample data participating in the training process of the candidate classification model is large, and in one training stage, due to hardware limitations, it is not supported to input all the sample data in the sample data set in full. Therefore, a sampling method is used to determine the sample data input into the candidate classification model for training in the current training stage from the sample data set.
[0093] Optionally, the above-mentioned random sampling can obtain the above-mentioned target sample data by sampling from the complete sample data set in each training stage; or, the above-mentioned random sampling can also be to exclude the sample data that participated in the training in the historical training stage from the sample data set in the current training stage to obtain a filtered sample data set, and then randomly sample from the above-mentioned filtered sample data set to obtain the target sample data.
[0094] In some embodiments, the first quantity of target sample data is drawn from the sample data set. Optionally, the first quantity can be preset by the system or customized by the terminal device. In some embodiments, when the first quantity is preset by the system, it can be determined according to the training sample capacity corresponding to the hardware conditions. The above-mentioned training sample capacity is used to indicate the range of the quantity requirements of the sample data in one training stage of the candidate classification model, that is, it can be determined that under the current hardware conditions, the maximum quantity of sample data allowed to be input in one training stage of the candidate classification model is determined as the training sample capacity, and the first quantity corresponding to the target sample data obtained by sampling is determined according to the training sample capacity.
[0095] 503: In response to the target sample data belonging to the target similar sample group, obtain augmented sample data from the target similar sample group.
[0096] Among them, the target sample data is labeled with a first sample label, and the augmented sample data is labeled with a second sample label, and there is a similarity relationship between the above-mentioned first sample label and the second sample label. Optionally, the first sample label and the second sample label can be the same sample label or different sample labels.
[0097] Optionally, the above target sample data may be sample data specified by the terminal device, that is, the terminal device instructs the server to use the specified sample data in the sample data set for training the candidate classification model. For example, when sending a model training request to the server, the model training request carries the sample ID corresponding to the target sample data; or, the target sample data is sample data randomly sampled by the server from all the sample data in the sample data set.
[0098] In an embodiment of the present application, when it is determined that the target sample data belongs to the target similar sample group in the sample data set, it indicates that there is sample data in the sample data set that has a label similarity relationship with the target sample data. The augmented sample data is determined from the sample data that has a label similarity relationship with the target sample data, and the augmented sample data is used together with the target sample data as training sample data to participate in the model training in the current training stage of the candidate classification model.
[0099] In some embodiments, the sample group corresponds to identification information, which is used to record the sample group ID, the sample ID of the sample data in the sample group, and the label ID of the sample label. When determining whether the target sample data belongs to a certain sample group, the identification information corresponding to each sample group can be read, and the sample ID of the sample data recorded in the identification information is compared with the target sample ID of the target sample data. If the identification information of a certain sample group includes the above target sample ID and this sample group is a similar sample group, then this sample group is determined as the target similar sample group; or, the label ID recorded in the identification information can also be read, and the above label ID is compared with the target label ID corresponding to the first sample label. If the identification information of a certain sample group includes the above target label ID and this sample group is a similar sample group, then this sample group is determined as the target similar sample group.
[0100] After it is determined that the target sample data belongs to the target similar sample group, the augmented sample data can be determined from the target similar sample group. In some embodiments, the sample data in the target similar sample group whose sample label is different from the first sample label is randomly sampled to obtain the augmented sample data.
[0101] In some embodiments, a second quantity of augmented sample data is obtained from the target similar sample group according to the target sample data. Optionally, the second quantity can be preset by the system or customized by the user through a terminal device. Optionally, the first quantity and the second quantity can be set separately. For example, the terminal device respectively indicates the values corresponding to the first quantity and the second quantity, that is, the first quantity and the second quantity are independent of each other; or, there may be a specified multiple relationship between the first quantity and the second quantity. For example, the first quantity and the second quantity are the same, or the second quantity is three times the first quantity, which can be specifically set according to actual needs.
[0102] In some embodiments, when the above first quantity and second quantity are preset by the system, they can be determined according to the training sample capacity corresponding to the hardware conditions. Illustratively, the training sample capacity of the candidate classification model is obtained, and the first quantity and the second quantity are determined based on the training sample capacity. The first quantity is used to indicate the quantity of the target sample data, and the second quantity is used to indicate the quantity of the augmented sample data corresponding to the target sample data. For example, if the hardware conditions indicate that 256 sample data can be input into the candidate classification model simultaneously, the preset first quantity is 64 and the second quantity is 192. For another example, both the first quantity and the second quantity are 128, or the first quantity is 192 and the second quantity is 64. In the case where the second quantity is less than the first quantity, the target sample data sampled needs to be resampled or screened to determine the target sample data for which the augmented sample data needs to be determined.
[0103] In some embodiments, when the first quantity is specified by the terminal device, the second quantity can also be determined according to the first quantity and the hardware conditions. For example, if the terminal device specifies the first quantity as 128 and the hardware conditions indicate that 256 sample data can be input into the candidate classification model simultaneously, the second quantity corresponds to 128.
[0104] 504: Generate a training sample set based on the target sample data and the augmented sample data.
[0105] Among them, the above training sample set is used to train the candidate classification model to obtain a target classification model, and the target classification model is used for data classification and recognition.
[0106] In some embodiments, the training sample data in the above training sample set is the sample data used by the candidate classification model during the current training stage. Illustratively, as Figure 7As shown, it shows a schematic diagram of generating a training sample set provided by an exemplary embodiment of the present application. The sample data set 710 includes a target number of sample data. After random sampling, a first number of target sample data 720 is obtained. Then, a second number of augmented sample data 730 is determined through the target sample data 720. The training sample set 740 is jointly generated by the above-mentioned first number of target sample data 720 and the corresponding second number of augmented sample data 730 respectively. The sample data in the training sample set 740 is input into the candidate classification model 750 for training.
[0107] Schematically, the training sample data in the training sample set is input into the candidate classification model, and a predicted classification result is output. Based on the difference between the sample label corresponding to the training sample data and the predicted classification result, the loss value of the predicted classification result is determined. Based on the loss value, the candidate classification model is iteratively trained to obtain the target classification model. Among them, the loss value corresponding to the above-mentioned predicted classification result can be obtained through a training loss function, and the training loss function can be any one of loss functions such as the 0-1 loss function (Zero-One Loss), square loss function, cross-entropy loss function, maximum likelihood loss function, etc., which is not limited here. Schematically, it can be determined whether the candidate classification model is trained based on whether the loss value is less than a preset loss threshold. When the currently output loss value is less than or equal to the preset loss threshold, it is determined that the candidate classification model is trained to obtain the target classification model. When the currently output loss value is greater than the preset loss threshold, the model parameters of the candidate classification model are modified according to the loss value, and the training sample set is continuously obtained to complete the training of the candidate classification model.
[0108] In some embodiments, the generation process of the training sample set and the training process of the candidate classification model can be completed in parallel. In one example, the model training module of the server includes a sample screening unit and a model training unit. Among them, the sample screening unit is used to complete the generation process of the above-mentioned training sample set. The sample screening unit continuously generates the training sample set and sequentially transmits the generated training sample set to the model training unit. The model training unit completes the training of the model according to the sample data in the training sample set, that is, the overall efficiency of the model training process is improved through a parallel method.
[0109] In the application process of the target classification model, the server obtains the data to be classified, which is the data that needs to be classified and recognized. Through the target classification model, based on the matching relationship between the data characteristics of the data to be classified and the candidate categories, the target classification result corresponding to the data to be classified is determined. Among them, the above-mentioned candidate categories correspond to the classification tasks corresponding to the target classification model. For example, when the classification task is the task of identifying the breeds of cats, the candidate categories are various breeds of cats.
[0110] Schematically, taking the classification task as an example of the face recognition task, the data to be classified received by the server is the face image to be recognized, and the above-mentioned target classification model is a face recognition model. In one example, the face recognition model is used to extract features from the face image to be recognized, obtaining a face feature representation. Based on the matching relationship between the face feature representation and the candidate mapping region, the target identity is determined from the candidate identities. Among them, the candidate mapping region is the mapping region of the candidate identity in the feature space, and the target identity is used to indicate the identity information corresponding to the face features in the face image to be recognized. The target identity is output as the target classification result. Optionally, the above-mentioned face feature representation can be a feature vector or a feature matrix, which is not limited herein. Among them, the above-mentioned face recognition can be either the face recognition of real humans or the face recognition of virtual characters (such as anime characters), which is not limited herein. It should be noted that when the above-mentioned face image to be recognized is a human face image, when the embodiments provided in this application are applied to specific products or technologies, the above-mentioned face image to be recognized needs to obtain the permission or consent of the user, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.
[0111] In some embodiments, after the target classification model is trained, in order to apply it to the classification and recognition of objects other than the sample objects in the sample data set, the classification layer in the trained target classification model can be removed, and the features output by the previous layer are used as the data representation features of the data to be recognized, so as to realize the application of the model to recognize objects other than the sample objects.
[0112] In summary, for the method for processing sample data provided by the embodiments of the present application, when training a classification model for data classification and recognition, when the sampled target sample data belongs to a similar sample group with a similar relationship in sample labels, the training sample set for training the classification model is jointly generated by the target sample data and the augmented sample data in the similar sample group. That is, when there are other sample data with similar labels in the sampled sample data in the sample data set, the augmented sample data is obtained from the other sample data with similar labels, so that in a large-scale classification scenario, the model can fully learn the differences between the sample data with similar labels, thereby improving the model accuracy of the classification model.
[0113] Please refer to Figure 8 , which shows a flowchart of the method for processing sample data provided by an exemplary embodiment of the present application. In the embodiments of the present application, sampling the sample data set to obtain a training sample set is schematically illustrated. The method includes the following steps.
[0114] 801: Obtain a sample data set.
[0115] Among them, the sample data in the above sample data set is labeled with sample labels, and the sample labels are used to distinguish the sample categories of the sample data in the classification task corresponding to the candidate classification model. For example, when the above classification task is a face recognition task, the sample data belonging to the same object is labeled with the same sample label, that is, the sample data corresponding to the same object belongs to the same sample category.
[0116] The sample data in the sample data set is divided into a similar sample group or an independent sample group. Among them, the similar sample group is composed of sample data in which there is a similarity relationship between at least two sample labels, and the sample labels corresponding to the sample data in the independent sample group do not have the above similarity relationship with other sample labels in the sample data set.
[0117] 802: Sample the sample data set to obtain target sample data.
[0118] The above target sample data is labeled with a first sample label.
[0119] In the embodiment of the present application, the server randomly samples the sample data in the sample data set to obtain a first quantity of target sample data. Among them, the above first quantity is determined according to the training sample size, and the training sample size is used to indicate the range of the quantity requirements of the sample data in a training stage of the candidate classification model.
[0120] 8031: In response to the target sample data belonging to the target similar sample group, obtain the similarity mapping data corresponding to the target similar sample group.
[0121] In the embodiment of the present application, the similar sample group corresponds to similarity mapping data, and the similarity mapping data is used to record the mapping relationship between the sample labels with a similarity relationship in the similar sample group.
[0122] In some embodiments, all sample groups corresponding to the sample data set are determined as candidate similar sample groups, and the candidate similar sample groups are screened according to a preset sample group screening method to determine target similar sample groups. Schematically, the sample groups in the sample data set correspond to mapping center labels, and the mapping center labels are used to indicate the mapping center of the mapping relationship recorded in the similar mapping data corresponding to the candidate similar sample groups. The mapping center labels are determined during the generation process of the sample groups. In one example, when generating sample groups from the to-be-processed data provided as training data, the sample labels corresponding to the to-be-processed data are traversed, and the currently traversed sample label is used as the mapping center label. Similar sample labels having a similar relationship with the mapping center label are determined from other to-be-processed data, and similar sample groups are generated according to the sample data corresponding to the mapping center label and the similar sample labels, that is, there is a one-to-one correspondence between the similar sample groups and the mapping center labels. For example, the similar sample group A includes the sample data corresponding to the sample label A, the sample data corresponding to the sample label B, and the sample data corresponding to the sample label C. The mapping center label corresponding to the similar sample group A is the sample label A, which indicates that there is a label similarity relationship between the sample data corresponding to the sample label B and the sample data corresponding to the sample label A, and there is a label similarity relationship between the sample data corresponding to the sample label C and the sample data corresponding to the sample label A.
[0123] Schematically, the mapping center label of the candidate similar sample group is obtained. In response to the first sample label matching the mapping center label of the candidate similar sample group, the candidate similar sample group is determined as the target similar sample group, and the similar mapping data corresponding to the target similar sample group is obtained. That is, after determining that the target sample data is the sample data in the target similar sample group, the similar mapping data corresponding to the target similar sample group is obtained.
[0124] 8032: Obtain augmented sample data from the target similar sample group based on the similar mapping data.
[0125] In the embodiments of the present application, after determining the target similar sample group corresponding to the target sample data, it is necessary to obtain augmented sample data from the target similar sample group. Schematically, candidate sample data is obtained from the target similar sample group, where the candidate sample label corresponding to the candidate sample data is different from the first sample label, and augmented sample data is obtained from the candidate sample data. The above method for obtaining augmented sample data may be a random sampling method.
[0126] Optionally, the sampling process of randomly sampling to obtain the augmented sample data may be sampling for the sample data, or sampling for the sample labels and the sample data.
[0127] When the above sampling process is for sampling of sample data, the sample data in the target similar sample group except the sample data corresponding to the first sample label is determined as candidate sample data, and random sampling is performed on the above candidate sample data to obtain the second quantity of augmented sample data. As Figure 9 shown, it shows a schematic diagram for determining augmented sample data provided by an exemplary embodiment of the present application. The target similar sample group 900 includes the sample data A910 corresponding to the sample label A, the sample data B920 corresponding to the sample label B, the sample data C930 corresponding to the sample label C, and the sample data D940 corresponding to the sample label D. Among them, the target sample data 911 is included in the sample data A910. Then, the sample data B920, the sample data C930, and the sample data D940 are jointly determined as candidate sample data 950, and then random sampling is performed from the candidate sample data 950 to obtain the augmented sample data 960.
[0128] When the above sampling process is for sampling of sample labels and sample data, first, candidate sample labels are determined from the sample labels in the target similar sample group corresponding to those other than the first sample label, sampling is performed on the candidate sample labels to obtain the third quantity of target sample labels, and the sample data corresponding to the third quantity of target sample labels is determined as candidate sample data. Among them, the above third quantity can be the same as the second quantity or less than the second quantity. When the third quantity and the second quantity are the same, one sample data can be randomly sampled from the candidate sample data corresponding to each target sample label as the augmented sample data. When the third quantity is less than the second quantity, the augmented sample data can be randomly sampled from the candidate sample data jointly composed of the sample data corresponding to the third quantity of target sample labels. As Figure 10 shown, it shows a schematic diagram for determining augmented sample data provided by another exemplary embodiment of the present application. The target similar sample group 1000 includes the sample data A1010 corresponding to the sample label A1001, the sample data B1020 corresponding to the sample label B1002, the sample data C1030 corresponding to the sample label C1003, and the sample data D1040 corresponding to the sample label D1004. Among them, the target sample data 1011 is included in the sample data A1010. Then, two (taking two as an example) candidate sample labels 1050 are randomly sampled from the sample labels B1002, C1003, and D1004. The sample data corresponding to the candidate sample labels 1050 is the candidate sample data 1060, and one augmented sample data 1070 is randomly sampled from the candidate sample data 1060 corresponding to each candidate sample label 1050. Optionally, there may be the same sample labels or non-repeating sample labels among the above third quantity of candidate sample labels, which is not limited herein.
[0129] 804: In response to the target sample data belonging to the independent sample group, sample the sample data set to obtain augmented sample data.
[0130] Illustratively, the sample data set further includes independent sample data classified into the independent sample group. The independent sample data is used to indicate sample data for which there is no similarity relationship between the sample label in the sample data set and the sample labels of other sample data. That is, the above-mentioned independent sample data corresponds to a third sample label, and there is no similarity relationship between the third sample label and other sample labels in the sample data set.
[0131] In an embodiment of the present application, the obtaining method of obtaining the augmented sample data from the sample data set may be a random sampling obtaining method.
[0132] Optionally, the sample label corresponding to the augmented sample data and the sample label corresponding to the target sample data may be different or the same. That is, the sample data participating in the random sampling may include sample data with the same label, or the augmented sample data may be sampled only from the sample data corresponding to the sample labels other than the sample label corresponding to the augmented sample data.
[0133] In an embodiment of the present application, when traversing all the mapping center labels corresponding to the similar sample groups in the sample data set and no mapping center label matching the first sample label is determined, the target sample data is determined as independent sample data, that is, the target sample data belongs to the independent sample group.
[0134] 805: Generate a training sample set based on the target sample data and the augmented sample data.
[0135] Among them, the above-mentioned training sample set is used to train a candidate classification model to obtain a target classification model, and the target classification model is used for data classification and recognition.
[0136] Optionally, to save hardware resources, the training sample set may be used to record the sample IDs corresponding to the target sample data and the augmented sample data. When the model training unit receives the training sample set, it obtains the corresponding training sample data from the sample data set according to the sample IDs in the training sample set, and inputs the training sample data into the candidate classification model for training.
[0137] In summary, for the method for processing sample data provided in the embodiments of the present application, when training a classification model for data classification and recognition, when the sampled target sample data belongs to a similar sample group composed of sample data with similar relationships in sample labels, a training sample set for training the classification model is jointly generated by the target sample data and the augmented sample data in the similar sample group, where there is a similar relationship between the first sample label of the target sample data and the second sample label of the augmented sample data. That is, when there are other sample data with similar labels in the sample data set of the sampled sample data, augmented sample data is obtained from the other sample data with similar labels, so that in a large-scale classification scenario, the model can fully learn the differences between sample data with similar labels, thereby improving the model accuracy of the classification model.
[0138] In the embodiments of the present application, by determining whether the sampled target sample data belongs to a similar sample group or an independent sample group to determine how to obtain augmented sample data, the randomness of the sample data participating in the training can be ensured, as well as the learning of the differences between sample data with similar labels by the model. At the same time, when the target sample data belongs to the target similar sample group, the augmented sample data is determined through the similar mapping data corresponding to the target similar sample group, which improves the determination efficiency of the augmented sample data.
[0139] Please refer to Figure 11 , which shows a flowchart of a method for processing sample data provided in an exemplary embodiment of the present application. In the embodiments of the present application, a preprocessing process for generating a sample data set is schematically described. The method includes the following steps.
[0140] 1101: Obtain the data to be processed corresponding to the candidate classification model.
[0141] Optionally, the above data to be processed can be uploaded by the terminal device, or after receiving a model training request sent by the terminal device, the corresponding data to be processed can be read from the database according to the model training request.
[0142] 1102: Label the sample labels of the data to be processed based on the sample objects corresponding to the data to be processed.
[0143] The above sample labels are used to distinguish the sample data between different sample objects. Among them, the sample data corresponding to one sample object is a classification category corresponding to the classification task. Schematically, after label annotation, all the data to be processed correspond to N sample labels, that is, the data to be processed is divided into N classification categories, and N is a positive integer.
[0144] In some embodiments, the data to be processed corresponds to a sample object ID, and the server labels the data to be processed corresponding to the same sample object ID with the same sample label. Schematically, the above sample label can be a label composed of numbers or characters. Among them, the sample object ID corresponding to the data to be processed is the information stored correspondingly when the data to be processed is stored in the database.
[0145] 1103: Based on the similarity of sample labels between the data to be processed, divide the data to be processed into a similar sample group or an independent sample group.
[0146] Among them, the similar sample group is composed of at least two sample data with a label similarity relationship, and the independent sample group is used to store independent sample data, and the independent sample data is used to indicate that the corresponding sample label does not have the above similarity relationship with other sample labels in the sample data set.
[0147] Schematically, obtain the similarity data between the i-th data to be processed and the candidate data to be processed (the i-th data to be processed and the candidate data to be processed are correspondingly labeled with different sample labels). In response to the similarity data satisfying the similarity condition, generate the k-th similar sample group based on the i-th data to be processed and the candidate data to be processed; or, in response to the similarity data not matching the similarity condition, divide the i-th data to be processed into the independent sample group, where both i and k are positive integers. Among them, the above similarity condition is used to determine the similarity between the sample labels corresponding to different data to be processed.
[0148] In some embodiments, the similarity data corresponding to the sample data between the above different sample labels is obtained by a similarity detection model, that is, by inputting the sample data in pairs into the similarity detection model, the similarity data between two sample data can be output. Schematically, the above similarity detection model corresponds to the data form of the sample data. For example, when the data form of the sample data is an image form, the similarity detection model corresponds to an image similarity detection model.
[0149] Optionally, the similarity between two sample labels can be obtained by obtaining the similarity data between the pairwise sample data between the two sample labels and taking the mean of the corresponding similarity data. For example, if sample label A corresponds to sample data 1 and sample data 2, and sample label B corresponds to sample data 3 and sample data 4, then the similarity between sample label A and sample label B can be obtained by obtaining the similarity data between sample data 1 and sample data 3, the similarity data between sample data 1 and sample data 4, the similarity data between sample data 2 and sample data 3, and the similarity data between sample data 2 and sample data 4, and taking the mean of the above four similarity data.
[0150] After determining the similarity between sample labels, the above similarity can be compared with the similarity condition to determine whether the sample data between two sample labels is label-similar data. Optionally, the above similarity condition can be indicated by the terminal device or preset by the system, and is not limited herein. In some embodiments, the above similarity condition is to compare the similarity between sample labels with a similarity threshold. If the similarity between sample labels reaches the similarity threshold, it is determined that there is a similarity relationship between the two sample labels. If the similarity between sample labels does not reach the similarity threshold, it is determined that there is no similarity relationship between the two sample labels.
[0151] As Figure 12 shown, it shows a schematic diagram of sample group division provided by an exemplary embodiment of the present application. The to-be-processed data set 1210 includes to-be-processed data corresponding to N sample labels. The to-be-processed data set 1210 is traversed according to the sample labels. In response to traversing to the i-th sample label 1211, the similarity 1201 between the i-th sample label 1211 and the j-th sample label 1212 in the to-be-processed data set 1210 is compared with the similarity threshold 1202. If the similarity 1201 is greater than or equal to the similarity threshold 1202, the to-be-processed data corresponding to the i-th sample label 1211 and the to-be-processed data corresponding to the j-th sample label 1212 are determined to be the sample data in the similar sample group 1203 corresponding to the i-th sample label 1211. If the similarity 1201 is less than the similarity threshold 1202, the to-be-processed data corresponding to the i-th sample label 1211 is divided into the independent sample group 1204, where the above j-th sample label 1212 is a sample label other than the i-th sample label 1211 among the N sample labels, and i, j, and N are all positive integers.
[0152] In some other embodiments, determining whether there is a similarity relationship between sample labels can also be determined based on the comparison result between the similarity data between each pair of sample data and the similarity threshold. Schematically, the count value is initialized to 0, and the similarity data between pairwise sample data between sample labels is determined. When the similarity data reaches the similarity threshold, the count value is incremented. By counting, the number of pairs of sample data between sample labels that reach the similarity threshold is obtained. When the above number reaches the sample threshold, it is determined that there is a similarity relationship between the two sample labels. When the above number does not reach the sample threshold, it is determined that there is no similarity relationship between the two sample labels.
[0153] Schematically, taking the face recognition task as an example, the sample data corresponding to each sample label is the sample face image corresponding to the same sample object. By generating corresponding similar sample groups for the sample data with similar facial features between different people, that is, by using similar sample groups to store the sample data corresponding to similar facial features.
[0154] In actual situations, facial feature similarity includes two cases: similar looks and similarity caused by poses / accessories.
[0155] Among them, similar looks refer to the similarity of facial features between different people. For example, Figure 13 as shown, it shows a schematic diagram of similar looks provided by an exemplary embodiment of the present application. The people A1310 and B1320 are similar in looks. Among them, the face shape feature A1311 of person A1310 is similar to the face shape feature B1321 of person B1320, the eye shape feature A1312 of person A1310 is similar to the eye shape feature B1322 of person B1320, and the lip feature A1313 of person A1310 is similar to the lip feature B1323 of person B1320. Therefore, overall visually, people A1310 and B1320 are similar. After the facial recognition model extracts features from them, the obtained facial feature vectors will also be close in distance (or have a small angle) in the vector space. Between sample objects with similar looks, most of their corresponding sample facial images are also similar. Therefore, similar sample groups can be generated based on the overall similarity of the sample data between the above sample labels.
[0156] Similarity caused by poses / accessories means the similarity between face images due to poses or accessories. For example, Figure 14 as shown, it shows a schematic diagram of similarity caused by poses / accessories provided by an exemplary embodiment of the present application. Among them, case 1401 is the case where similarity is caused by poses. The frontal face images A1411 and B1421 corresponding to people A1410 and B1420 are not similar, that is, the facial features are quite different. However, in the side face pose, the corresponding side face images A1412 and B1422 are relatively similar; case 1402 is the case where similarity is caused by accessories. The frontal face images C1431 and D1441 corresponding to people C1430 and D1440 are not similar, but when both of them wear accessory sunglasses, the corresponding face images C1432 and D1442 with accessories are relatively similar.
[0157] In the case of similarity caused by poses / accessories, the overall similarity between the sample facial images corresponding to the sample objects may not be high, and only some of the sample facial images are similar. In view of the above situation, when generating a similar sample group of the sample data corresponding to the sample labels with a similar relationship, the similar sample group can be generated according to the similarity of the specific sample data between different sample labels, that is, only the sample data with the similarity data between the sample labels reaching the similarity threshold is generated into a similar sample group. For example, as Figure 15As shown, it shows a schematic diagram of data partitioning provided by an exemplary embodiment of the present application. The data to be processed includes the sample facial images (1 to 100) 1511 corresponding to the sample object A1510, the sample facial images (101 to 200) 1521 corresponding to the sample object B1520, the sample facial images (201 to 300) 1531 corresponding to the sample object C1530, and the sample facial images (301 to 400) 1541 corresponding to the sample object D1540. When traversing to the sample object A1510, the sample facial images (1 to 100) 1511 corresponding to the sample object A1510 are respectively compared pairwise with the sample facial images corresponding to the sample objects B1520, C1530, and D1540 to determine sample pairs 1501 with similarity data greater than the similarity threshold. Then, based on the above sample pairs 1501, a similar sample group 1502 corresponding to the sample object A1510 is generated. The similar sample group 1502 stores the sample data with label similarity relationships among the sample facial images (1 to 100) 1511 corresponding to the sample object A1510 in the data to be processed, as well as the mapping relationships between the sample data. The remaining sample facial images 1512 of the sample object A1510 are partitioned into the independent sample group 1550.
[0158] When the similar sample group consists of some sample data between sample labels, the identification information corresponding to the similar sample group needs to record the sample label ID, the sample ID between the mutually corresponding sample data, and the mapping relationship between the sample IDs. In this case, when determining whether the target sample data belongs to a certain similar sample group, after determining a certain similar sample group according to the sample label, it is also necessary to match the target sample ID corresponding to the target sample data with the sample IDs corresponding to the sample data recorded in the similar sample group to determine whether to determine this similar sample group as the target similar sample group. At the same time, in the process of determining the expanded sample data, the candidate sample data should be the sample data corresponding to the target sample data in the target similar sample group. In an example, after determining the candidate similar sample group according to the first sample label of the target sample data, it is determined whether the sample IDs recorded in the candidate similar sample group include the target sample ID of the target sample data. If so, the sample ID mapping relationship corresponding to the target sample ID is read. For example, if the sample IDs having a mapping relationship with the target sample ID include sample AID, sample DID, and sample MID, then the sample data A corresponding to the above sample AID, the sample data D corresponding to the sample DID, and the sample data M corresponding to the sample MID are determined as the candidate sample data, and the expanded sample data corresponding to the target sample data is determined from the above candidate sample data.
[0159] 1104: Generate a sample data set based on the similar sample group and the independent sample group.
[0160] Schematically, asFigure 16 As shown, it shows a schematic diagram of dividing data to be processed in an exemplary embodiment of the present application. For the data 1610 to be processed corresponding to sample labels of N categories, the data 1610 to be processed corresponding to different sample labels are input into the similarity detection model 1620. According to the output result of the similarity detection model 1620, the data 1610 to be processed of sample labels of N categories are divided into a similar sample group 1630 and an independent sample group 1640. Among them, the similar sample group 1630 includes sample data corresponding to X sample labels, and the independent sample group 1640 includes sample data corresponding to Y sample labels. N, X, and Y are all positive integers, and N = X + Y.
[0161] Among them, the sample group in the above-mentioned similar sample group stores the mapping relationship between sample labels, while the independent sample group stores the sample labels corresponding to independent sample data. As Figure 17 shown, it shows a schematic diagram of the composition of a sample data set provided in an exemplary embodiment of the present application. The sample data set 1700 includes a similar sample group 1710 and an independent sample group 1720. Among them, the similar sample group 1710 includes the mapping relationship between sample labels. For example, the X1th sample label has a similar relationship with the ith sample label and the jth sample label, and the X2th sample label has a similar relationship with the ith sample label; the independent sample group 1720 includes the sample labels corresponding to each independent sample data. For example, the Y1th sample label, the Y2th sample label, and the Y3th sample label.
[0162] In summary, the method for processing sample data provided in the embodiment of the present application divides sample labels and data to be processed into a similar sample group and an independent sample group according to the similarity data between the data to be processed corresponding to different sample labels. The similar sample group and the independent sample group jointly form a sample data set for use in the training process of the candidate classification model. By preprocessing the data to be processed and then generating a training sample set, while ensuring the recognition accuracy of the model among the sample data corresponding to sample labels with similar relationships, the overall training efficiency of the model is improved.
[0163] Please refer to Figure 18 , which shows a structural block diagram of a device for processing sample data provided in an exemplary embodiment of the present application. The device includes the following modules:
[0164] An acquisition module 1810, configured to acquire a sample data set, where the sample data in the sample data set is labeled with sample labels, the sample data in the sample data set is divided into similar sample groups or independent sample groups, the similar sample groups are composed of sample data with a similar relationship between at least two sample labels, and the sample labels corresponding to the sample data in the independent sample groups have no such similar relationship with other sample labels in the sample data set;
[0165] A sampling module 1820, configured to sample the sample data set to obtain target sample data;
[0166] An expansion module 1830, configured to obtain expansion sample data from the target similar sample group in response to the target sample data belonging to a target similar sample group;
[0167] A generation module 1840, configured to generate a training sample set based on the target sample data and the expansion sample data, where the training sample set is used to train a candidate classification model to obtain a target classification model, and the target classification model is used for data classification and recognition.
[0168] In some alternative embodiments, as Figure 19 shown, the expansion module 1830 further includes:
[0169] A first acquisition unit 1831, configured to acquire corresponding similarity mapping data of the target similar sample group in response to the target sample data belonging to the target similar sample group, where the similarity mapping data is used to record the mapping relationship between the sample labels with the similar relationship in the target similar sample group;
[0170] An expansion unit 1832, configured to acquire the expansion sample data from the target similar sample group based on the similarity mapping data.
[0171] In some alternative embodiments, acquire a mapping center label of a candidate similar sample group, where the mapping center label is used to indicate the mapping center of the mapping relationship recorded by the corresponding similarity mapping data of the candidate similar sample group;
[0172] The expansion module 1830 further includes:
[0173] A determination unit 1833, configured to determine the candidate similar sample group as the target similar sample group in response to the first sample label matching the mapping center label of the candidate similar sample group.
[0174] In some alternative embodiments, the first acquisition unit 1831 is further configured to acquire candidate sample data from the target similar sample group, where the candidate sample label corresponding to the candidate sample data is different from the first sample label;
[0175] The expansion unit 1832 is further configured to obtain the expanded sample data from the candidate sample data.
[0176] In some alternative embodiments, the obtaining module 1810 is further configured to obtain the training sample capacity of the candidate classification model, where the training sample capacity is used to indicate the range of the quantity requirement of the sample data in one training phase of the candidate classification model, and at least one such training phase is included in the training process of the candidate classification model;
[0177] The apparatus further includes:
[0178] A determining module 1850, configured to determine a first quantity and a second quantity based on the training sample capacity, where the first quantity is used to indicate the quantity of the target sample data, and the second quantity is used to indicate the quantity of the expanded sample data corresponding to the target sample data.
[0179] In some alternative embodiments, the expansion module 1830 is further configured to, in response to the target sample data belonging to the independent sample group, sample the sample data set to obtain the expanded sample data.
[0180] In some alternative embodiments, the apparatus further includes: a preprocessing module 1860;
[0181] The preprocessing module 1860 includes:
[0182] A second obtaining unit 1861, configured to obtain the data to be processed corresponding to the candidate classification model;
[0183] An annotation unit 1862, configured to annotate sample labels for the data to be processed based on the sample objects corresponding to the data to be processed, where the sample labels are used to distinguish the sample data between different sample objects;
[0184] A partitioning unit 1863, configured to partition the data to be processed into a similar sample group or an independent sample group based on the similarity of the sample labels between the data to be processed;
[0185] A generating unit 1864, configured to generate the sample data set based on the similar sample group and the independent sample group.
[0186] In some alternative embodiments, the partitioning unit 1863 is further configured to obtain the similarity data between the i-th data to be processed and the candidate data to be processed, where the i-th data to be processed and the candidate data to be processed are respectively annotated with different sample labels, and i is a positive integer;
[0187] The dividing unit 1863 is further configured to generate a k-th similar sample group based on the target data to be processed and the candidate data to be processed in response to the similarity data satisfying a similarity condition, where the similarity condition is used to determine the similarity between sample labels corresponding to different data to be processed, and k is a positive integer.
[0188] In some alternative embodiments, the dividing unit 1863 is further configured to divide the i-th data to be processed into the independent sample group in response to the similarity data not matching the similarity condition.
[0189] In some embodiments, the apparatus further includes: a training module 1870;
[0190] The training module 1870 includes:
[0191] An input unit 1871, configured to input training sample data in the training sample set into the candidate classification model and output a predicted classification result;
[0192] A loss determination unit 1862, configured to determine a loss value of the predicted classification result based on the difference between the sample label corresponding to the training sample data and the predicted classification result;
[0193] A training unit 1873, configured to perform iterative training on the candidate classification model based on the loss value to obtain the target classification model.
[0194] In some alternative embodiments, the apparatus further includes: an application module 1870;
[0195] The application module 1870 includes:
[0196] A third acquisition unit 1871, configured to acquire data to be classified, where the data to be classified is data that needs to be classified and recognized;
[0197] A classification unit 1882, configured to determine a target classification result corresponding to the data to be classified based on a matching relationship between data features of the data to be classified and candidate categories through the target classification model.
[0198] In some alternative embodiments, when the target classification model is a face recognition model, the data to be classified is a face image to be recognized;
[0199] The classification unit 1882 is further configured to extract features from the face image to be recognized through the face recognition model to obtain a face feature representation;
[0200] The classification unit 1882 is further configured to determine a target identity from candidate identities based on a matching relationship between the facial feature representation and candidate mapping regions, where the candidate mapping regions are mapping regions of the candidate identities in a feature space, and the target identity is used to indicate identity information corresponding to facial features in the facial image to be recognized;
[0201] The classification unit 1882 is further configured to output the target identity as the target classification result.
[0202] In summary, when training a classification model for data classification and recognition, the sample data processing device provided in the embodiments of the present application, when the obtained target sample data belongs to a sample group with a similarity relationship in sample labels, jointly generates a training sample set for training the classification model from the target sample data and augmented sample data in the sample group, where there is a similarity relationship between the first sample label of the target sample data and the second sample label of the augmented sample data. That is, when there are other sample data with similar labels among the sampled sample data in the sample data set, augmented sample data is obtained from the other sample data with similar labels, so that in a large-scale classification scenario, the model can fully learn the differences between sample data with similar labels, thereby improving the model accuracy of the classification model.
[0203] It should be noted that: the sample data processing device provided in the above embodiments is only illustrated by dividing the above functional modules. In practical applications, the above functions can be allocated to 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 sample data processing device provided in the above embodiments and the sample data processing method embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be elaborated here.
[0204] Figure 20 FIG. shows a schematic structural diagram of a server provided in an exemplary embodiment of the present application. Specifically, it includes the following structure.
[0205] The server 2000 includes a central processing unit (CPU) 2001, a system memory 2004 including a random access memory (RAM) 2002 and a read only memory (ROM) 2003, and a system bus 2005 connecting the system memory 2004 and the central processing unit 2001. The server 2000 also includes a mass storage device 2006 for storing an operating system 2013, application programs 2014, and other program modules 2015.
[0206] The mass storage device 2006 is connected to the central processing unit 2001 through a mass storage controller (not shown) connected to the system bus 2005. The mass storage device 2006 and its associated computer-readable medium provide non-volatile storage for the server 2000. That is to say, the mass storage device 2006 may include a computer-readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0207] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing 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 technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape cartridges, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that computer storage media is not limited to the above several types. The above-mentioned system memory 2004 and mass storage device 2006 can be collectively referred to as memory.
[0208] According to various embodiments of the present application, the server 2000 can also run on a remote computer on the network through a network such as the Internet. That is, the server 2000 can be connected to the network 2012 through the network interface unit 2011 connected to the system bus 2005. Or rather, the network interface unit 2011 can also be used to connect to other types of networks or remote computer systems (not shown).
[0209] The above-mentioned memory further includes one or more programs, and one or more programs are stored in the memory and configured to be executed by the CPU.
[0210] Embodiments of the present application further provide a computer device, which includes a processor and a memory. At least one instruction, at least one program, a code set, or an instruction set is stored in the memory. The at least one instruction, at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the processing method of sample data provided in the above method embodiments. Optionally, the computer device may be a terminal or a server.
[0211] Embodiments of the present application further provide a computer-readable storage medium, on which at least one instruction, at least one program, a code set, or an instruction set is stored. The at least one instruction, at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the processing method of sample data provided in the above method embodiments.
[0212] Embodiments of the present application further provide a computer program product or a computer program, which includes computer instructions. The computer instructions are stored in a computer-readable storage medium. The processor of the 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 processing method of sample data described in any one of the above embodiments.
[0213] Optionally, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), solid state drive (SSD, Solid State Drives), or optical disc, etc. Among them, the random access memory may include resistive random access memory (ReRAM, Resistance RandomAccess Memory) and dynamic random access memory (DRAM, Dynamic Random Access Memory). The above serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0214] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be read-only memory, a magnetic disk, or an optical disc, etc.
[0215] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for processing sample data, characterized in that, The method includes: Obtaining a sample data set, where the sample data in the sample data set is labeled with sample labels, the data form of the sample data includes at least one of text form, image form, and voice form, the sample data in the sample data set is divided into similar sample groups or independent sample groups, the similar sample group consists of sample data with a similarity relationship between at least two sample labels, and the sample labels corresponding to the sample data in the independent sample group have no such similarity relationship with other sample labels in the sample data set; Sampling the sample data set to obtain target sample data; In response to the target sample data belonging to a target similar sample group, obtaining augmented sample data from the target similar sample group; Generating a training sample set based on the target sample data and the augmented sample data, where the training sample set is used to train a candidate classification model to obtain a target classification model, and the target classification model is used for data classification and recognition.
2. The method according to claim 1, wherein The step of, in response to the target sample data belonging to a target similar sample group, obtaining augmented sample data from the target similar sample group includes: In response to the target sample data belonging to the target similar sample group, obtaining similarity mapping data corresponding to the target similar sample group, where the similarity mapping data is used to record the mapping relationship between the sample labels with the similarity relationship in the target similar sample group; Obtaining the augmented sample data from the target similar sample group based on the similarity mapping data.
3. The method according to claim 2, wherein Before the step of, in response to the target sample data belonging to the target similar sample group, obtaining similarity mapping data corresponding to the target similar sample group, the target sample data is labeled with a first sample label, and it further includes: Obtaining a mapping center label of a candidate similar sample group, where the mapping center label is used to indicate the mapping center of the mapping relationship recorded by the similarity mapping data corresponding to the candidate similar sample group; In response to the first sample label matching the mapping center label of the candidate similar sample group, determining the candidate similar sample group as the target similar sample group.
4. The method according to any one of claims 1 to 3, characterized in that, The step of, the target sample data is labeled with a first sample label, and obtaining augmented sample data from the target similar sample group includes: Obtaining candidate sample data from the target similar sample group, where the candidate sample label corresponding to the candidate sample data is different from the first sample label; Obtaining the augmented sample data from the candidate sample data.
5. The method according to any one of claims 1 to 3, characterized in that Before the step of, in response to the target sample data belonging to a target similar sample group, obtaining augmented sample data from the target similar sample group, it further includes: Obtaining the training sample capacity of the candidate classification model, where the training sample capacity is used to indicate the range of the quantity requirements of sample data in one training stage of the candidate classification model, and at least one such training stage is included in the training process of the candidate classification model; Determining a first quantity and a second quantity based on the training sample capacity, where the first quantity is used to indicate the quantity of the target sample data, and the second quantity is used to indicate the quantity of the augmented sample data corresponding to the target sample data.
6. The method according to any one of claims 1 to 3, characterized in that The method further includes: In response to the target sample data belonging to the independent sample group, sampling the sample data set to obtain the augmented sample data.
7. The method according to claim 6, wherein The obtaining of the sample data set includes: Obtaining the data to be processed corresponding to the candidate classification model; Based on the sample objects corresponding to the data to be processed, annotating sample labels for the data to be processed, where the sample labels are used to distinguish the sample data between different sample objects; Based on the similarity of the sample labels between the data to be processed, dividing the data to be processed into the similar sample group or the independent sample group; Generating the sample data set based on the similar sample group and the independent sample group.
8. The method according to claim 7, wherein The dividing of the data to be processed into the similar sample group or the independent sample group based on the similarity of the sample labels between the data to be processed includes: Obtaining the similarity data between the i-th data to be processed and the candidate data to be processed, where the i-th data to be processed and the candidate data to be processed are respectively annotated with different sample labels, and i is a positive integer; In response to the similarity data satisfying the similarity condition, generating the k-th similar sample group based on the i-th data to be processed and the candidate data to be processed, where the similarity condition is used to determine the similarity of the sample labels corresponding to different data to be processed, and k is a positive integer.
9. The method according to claim 8, wherein The method further includes: In response to the similarity data not matching the similarity condition, dividing the i-th data to be processed into the independent sample group.
10. The method according to any one of claims 1 to 3, characterized in that, After generating the training sample set based on the target sample data and the augmented sample data, it further includes: Inputting the training sample data in the training sample set into the candidate classification model, and outputting a predicted classification result; Based on the difference between the sample label corresponding to the training sample data and the predicted classification result, determining the loss value of the predicted classification result; Based on the loss value, iteratively training the candidate classification model to obtain the target classification model.
11. According to the method described in any one of claims 1 to 3, characterized in that, The method further includes: Obtaining the data to be classified, where the data to be classified is the data that needs to be classified and recognized; Through the target classification model, based on the matching relationship between the data features of the data to be classified and the candidate categories, determining the target classification result corresponding to the data to be classified.
12. The method according to claim 11, wherein, The target classification model is a face recognition model, and the data to be classified is the face image to be recognized; The determining of the target classification result corresponding to the data to be classified through the target classification model based on the matching relationship between the data features of the data to be classified and the candidate categories includes: Extracting features from the face image to be recognized through the face recognition model to obtain a face feature representation; Based on the matching relationship between the face feature representation and the candidate mapping regions, determining the target identity from the candidate identities, where the candidate mapping regions are the mapping regions of the candidate identities in the feature space, and the target identity is used to indicate the identity information corresponding to the face features in the face image to be recognized; Outputting the target identity as the target classification result.
13. A processing device for sample data, characterized in that, The device includes: An acquisition module, configured to acquire a sample data set, where the sample data in the sample data set is labeled with sample labels, the data form of the sample data includes at least one of text form, image form, and voice form, the sample data in the sample data set is divided into similar sample groups or independent sample groups, the similar sample groups are composed of sample data with a similarity relationship between at least two sample labels, and the sample labels corresponding to the sample data in the independent sample groups do not have the similarity relationship with other sample labels in the sample data set; A sampling module, configured to sample the sample data set to obtain target sample data; An expansion module, configured to, in response to the target sample data belonging to a target similar sample group, acquire expansion sample data from the target similar sample group; A generation module, configured to generate a training sample set based on the target sample data and the expansion sample data, where the training sample set is used to train a candidate classification model to obtain a target classification model, and the target classification model is used for data classification and recognition.
14. A computer device, characterized in that, The computer device includes a processor and a memory, and at least one instruction, at least one program, a code set, or an instruction set is stored in the memory, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method for processing sample data according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, At least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by the processor to implement the method for processing sample data according to any one of claims 1 to 12.
16. A computer program product, characterized in that, Including a computer program or instruction, and when the computer program or instruction is executed by a processor, the method for processing sample data according to any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Face recognition method, face recognition system, medium and electronic equipment
CN109583332A
A training sample data expansion method and device based on a variational auto-encoder
CN109886388A