Data processing method

By sampling and augmenting the initial dataset, target distillation samples are generated, which solves the problem of resource consumption in storing large-scale datasets and improves the training efficiency and performance of deep learning models.

CN117113096BActive Publication Date: 2025-11-18ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310971604.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-02
Publication Date
2025-11-18
Estimated Expiration
2043-08-02

AI Technical Summary

Technical Problem

The storage and use of large-scale datasets require a lot of computing resources and storage space, resulting in excessively long training time and low training efficiency for deep learning models. Furthermore, increasing the amount of training data does not significantly improve model performance.

Method used

By sampling the initial dataset, initial distillation samples are obtained. The first expression loss value of the samples is calculated. Samples whose enhancement loss value reaches the threshold are processed to obtain enhanced samples. The initial distillation samples are updated according to similarity to obtain target distillation samples.

Benefits of technology

While reducing the amount of training data, we can maintain the semantic richness of the training data and improve training efficiency and task processing performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117113096B_ABST
    Figure CN117113096B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a data processing method, comprising: performing sampling processing on an initial data set to obtain an initial distillation sample; determining a first expression loss value of each initial sample according to the similarity of the initial distillation sample and each initial sample in the initial data set; performing enhancement processing on the initial sample whose first expression loss value reaches a preset loss threshold to obtain an enhanced sample; determining a second expression loss value of the enhanced sample according to the similarity of the initial distillation sample and the enhanced sample; and updating the initial distillation sample according to the second expression loss value to obtain a target distillation sample. The target distillation sample can more completely and accurately express each initial sample in the initial data set, guarantee the semantic richness of the training data, and further improve the training efficiency and task processing performance of the task model trained based on the target distillation sample.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of computer technology, and in particular to data processing methods. Background Technology

[0002] With the development of computer technology, deep learning models are increasingly being applied in various fields, and the task processing requirements of deep learning models are also increasing. Typically, deep learning models can be trained on large-scale datasets (i.e., datasets containing a large amount of training data) to ensure their task processing performance.

[0003] However, storing and using large-scale datasets requires significant computational resources and storage space, leading to excessively long training times and low training efficiency for deep learning models. Furthermore, when deep learning models already possess high performance, simply increasing the amount of training data is unlikely to significantly improve their performance. Therefore, an effective technical solution is urgently needed to address these issues. Summary of the Invention

[0004] In view of the above, embodiments of this specification provide a data processing method. One or more embodiments of this specification also relate to a data processing apparatus, an image classification method, an image classification device, a data processing method, a data processing apparatus, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, a data processing method is provided, comprising:

[0006] The initial dataset is sampled to obtain the initial distillation sample;

[0007] Based on the similarity between the initial distillation sample and each initial sample in the initial dataset, a first expression loss value is determined for each initial sample;

[0008] The initial samples whose first expression loss value reaches a preset loss threshold are augmented to obtain augmented samples;

[0009] Based on the similarity between the initial distilled sample and the enhanced sample, a second expression loss value for the enhanced sample is determined;

[0010] The initial distillation sample is updated based on the second expression loss value to obtain the target distillation sample.

[0011] According to a second aspect of the embodiments of this specification, a data processing apparatus is provided, comprising:

[0012] The sampling module is configured to sample the initial dataset to obtain the initial distillation sample;

[0013] The first determining module is configured to determine a first expression loss value for each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset;

[0014] The enhancement module is configured to perform enhancement processing on the initial samples whose first expression loss value reaches a preset loss threshold to obtain enhanced samples;

[0015] The second determining module is configured to determine a second expression loss value for the enhanced sample based on the similarity between the initial distilled sample and the enhanced sample.

[0016] The update module is configured to update the initial distillation sample based on the second expression loss value to obtain the target distillation sample.

[0017] According to a third aspect of the embodiments of this specification, an image classification method is provided, comprising:

[0018] Identify the image to be processed;

[0019] The image to be processed is input into an image classification model to obtain the image category result output by the image classification model, wherein the image classification model is trained based on the target distillation sample, and the target distillation sample is obtained based on the data processing method provided in the first aspect of the embodiments of this specification.

[0020] According to a fourth aspect of the embodiments of this specification, an image classification apparatus is provided, comprising:

[0021] The determination module is configured to determine the image to be processed.

[0022] The input module is configured to input the image to be processed into an image classification model to obtain the image category result output by the image classification model, wherein the image classification model is trained based on target distillation samples, and the target distillation samples are obtained based on the data processing method provided in the first aspect of the embodiments of this specification.

[0023] According to a fifth aspect of the embodiments of this specification, a data processing method is provided, comprising:

[0024] The data to be processed is determined, wherein the data to be processed includes at least one of image data, audio data, video data, and text data;

[0025] The data to be processed is input into the data processing model to obtain the data processing result output by the data processing model, wherein the data processing model is trained based on the target distillation sample, and the target distillation sample is obtained based on the data processing method provided in the first aspect of the embodiments of this specification.

[0026] According to a sixth aspect of the embodiments of this specification, a data processing apparatus is provided, comprising:

[0027] The determination module is configured to determine the data to be processed, wherein the data to be processed includes at least one of image data, audio data, video data, and text data;

[0028] An input module is configured to input the data to be processed into a data processing model and obtain the data processing result output by the data processing model, wherein the data processing model is trained based on a target distillation sample, and the target distillation sample is obtained based on the data processing method provided in the first aspect of the embodiments of this specification.

[0029] According to a seventh aspect of the embodiments of this specification, a computing device is provided, comprising:

[0030] Memory and processor;

[0031] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the above method.

[0032] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions that, when executed by a processor, implement the steps of the above-described method.

[0033] According to a ninth aspect of an embodiment of this specification, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described method.

[0034] One embodiment of this specification provides a data processing method, which involves sampling an initial dataset to obtain initial distillation samples; determining a first expression loss value for each initial sample based on the similarity between the initial distillation samples and each initial sample in the initial dataset; performing enhancement processing on the initial samples whose first expression loss value reaches a preset loss threshold to obtain enhanced samples; determining a second expression loss value for the enhanced samples based on the similarity between the initial distillation samples and the enhanced samples; and updating the initial distillation samples based on the second expression loss value to obtain target distillation samples.

[0035] In the above method, initial distillation samples are obtained by sampling the initial dataset. Based on the similarity between the initial distillation sample and each initial sample in the initial dataset, a first expression loss value is calculated for each initial sample. This determines whether the initial distillation sample can fully represent each initial sample in the initial dataset. For initial samples whose first expression loss value reaches a preset loss threshold, it indicates that the initial distillation sample is difficult to fully represent the initial sample. At this time, these initial samples can be augmented to obtain augmented samples, thereby expanding the semantics of the initial samples. Based on the similarity between the initial distillation sample and the augmented sample, a second expression loss value is calculated for the augmented sample. The initial distillation sample is then updated based on the second expression loss value to obtain target distillation samples. This allows the obtained target distillation samples to more completely and accurately represent each initial sample in the initial dataset, thus ensuring the semantic richness of the training data while reducing the amount of training data in the training dataset. This further improves the training efficiency and task processing performance of the task model trained based on the target distillation samples. Attached Figure Description

[0036] Figure 1 This is a schematic diagram illustrating an application scenario of a data processing method provided in one embodiment of this specification;

[0037] Figure 2 This is a flowchart illustrating a data processing method provided in one embodiment of this specification;

[0038] Figure 3 This is a flowchart illustrating the processing procedure of a data processing method provided in one embodiment of this specification.

[0039] Figure 4 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this specification;

[0040] Figure 5 This is a flowchart illustrating an image classification method provided in one embodiment of this specification;

[0041] Figure 6 This is a schematic diagram of the structure of an image classification device provided in one embodiment of this specification;

[0042] Figure 7 This is a flowchart illustrating a data processing method provided in one embodiment of this specification;

[0043] Figure 8 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this specification;

[0044] Figure 9 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0045] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0046] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0047] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0048] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0049] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0050] Machine learning: Machine learning is a multidisciplinary field that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and many other disciplines. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance.

[0051] Deep Learning: Deep learning (DL) is a new research direction in the field of machine learning (ML). Deep learning learns the inherent patterns and hierarchical representations of sample data. The information gained during this learning process greatly helps in interpreting data such as text, images, and sound. Its ultimate goal is to enable machines to have analytical and learning capabilities like humans, and to recognize data such as text, images, and sound.

[0052] Dataset distillation refers to using certain techniques to compress a large dataset into a smaller dataset, so that the model can be trained on the smaller dataset and still achieve the same effect as training on a large dataset.

[0053] Supervised training, also known as supervised learning, is a machine learning method that learns or builds a pattern (function / learning model) from training data and uses this pattern to predict new instances. Training data consists of input objects (usually vectors) and expected outputs. The output of the function can be a continuous value (called regression analysis) or a predicted classification label (called classification).

[0054] Gradient backpropagation: Gradient backpropagation is an important algorithm in neural networks, used to calculate the error contribution of each neuron so as to update the parameters based on this error contribution.

[0055] This specification provides a data processing method, and also relates to a data processing apparatus, an image classification method, an image classification apparatus, another data processing method, another data processing apparatus, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.

[0056] See Figure 1 , Figure 1 A schematic diagram illustrating an application scenario of a data processing method provided according to an embodiment of this specification is shown.

[0057] Figure 1 It includes end-side device 102 and cloud-side device 104.

[0058] Specifically, in an e-commerce scenario, the e-commerce platform provides image recognition services to users. The e-commerce platform can send a model training request to the cloud-side device 104 through the terminal device 102. In response to the model training request, the cloud-side device 104 determines that the task information carried in the model training request is an image recognition task, determines an initial dataset based on the image recognition task, and compresses the initial dataset to obtain the target dataset.

[0059] In specific implementation, when the cloud-side device 104 compresses the initial dataset, it can sample the initial dataset to obtain initial distillation samples; determine a first expression loss value for each initial sample based on the similarity between the initial distillation samples and each initial sample in the initial dataset; perform enhancement processing on the initial samples whose first expression loss value reaches a preset loss threshold to obtain enhanced samples; determine a second expression loss value for the enhanced samples based on the similarity between the initial distillation samples and the enhanced samples; update the initial distillation samples based on the second expression loss value to obtain target distillation samples; and train the task model based on the target distillation samples to obtain an image recognition model. Figure 1 As shown in (a), cloud-side device 104 can send the image recognition model to end-side device 102, which can then deploy the image recognition model to provide image recognition services to users. Alternatively, as... Figure 1 As shown in (b), the cloud-side device 104 can also provide a service interface to the end-side device 102. The end-side device 102 can send the image to be recognized to the cloud-side device 104 through the service interface. The cloud-side device 104 processes the image to be recognized based on the image recognition model and returns the image recognition result to the end-side device 102 through the service interface, thereby realizing the image recognition service.

[0060] See Figure 2 , Figure 2 A flowchart of a data processing method according to an embodiment of this specification is shown, which specifically includes the following steps.

[0061] Step 202: Sample the initial dataset to obtain the initial distillation sample.

[0062] Specifically, the data processing method provided in the embodiments of this specification can be applied to the distillation of training datasets for training models in any domain, such as computer vision, neural language processing, and protein structure prediction. It can reduce the amount of training data in the training dataset, making model training lightweight and improving training efficiency while maintaining model processing performance.

[0063] In practice, multiple initial samples in the initial dataset can be randomly sampled, and the sampled initial samples can be used as the initial distillation samples.

[0064] In this context, the initial distillation samples can be understood as all the samples obtained through sampling. The number of initial distillation samples is less than the number of initial samples included in the initial dataset. For example, 50 initial samples can be randomly sampled from 1000 initial samples in the initial dataset and used as the initial distillation samples. The initial distillation samples can be understood as the initial samples used in the distillation process of the initial samples in the initial dataset. These initial distillation samples will then be further processed to obtain the target distillation samples that meet the model training requirements.

[0065] In practical applications, the initial dataset can be a large-scale dataset, which includes a large number of initial samples.

[0066] For example, 5 initial samples can be randomly sampled from the 50 initial samples included in the initial dataset, and 5 initial samples can be obtained as initial distillation samples.

[0067] Step 204: Determine the first expression loss value for each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset.

[0068] Specifically, after obtaining the initial distillation sample, the first expression loss value of each initial sample can be determined based on the similarity between the initial distillation sample and each initial sample in the initial dataset.

[0069] The first expression loss value of each initial sample can be used to indicate whether the initial distillation samples can completely and accurately represent each initial sample. For example, if the initial dataset includes 1000 initial samples and 50 initial distillation samples are obtained, the first expression loss value of one of these 1000 initial samples, initial sample A, can be used to indicate whether the 50 sampled initial distillation samples can completely and accurately represent initial sample A. It should be noted that initial samples that cannot be accurately and completely represented by the initial distillation samples are considered hard samples in the initial dataset. These hard samples are more valuable and important for dataset distillation, and increasing the information content of hard samples can improve the distillation effect of the initial dataset. Whether an initial sample can be accurately and completely represented by the initial distillation samples needs to be determined based on its first expression loss value. The larger the first expression loss value, the greater the expression loss of the initial sample, indicating that the initial sample cannot be accurately and completely represented by the initial distillation samples.

[0070] Understandably, in one embodiment of this specification, the goal of updating the initial distillation sample is to ensure that the updated target distillation sample can fully represent all the initial samples in the initial dataset.

[0071] Based on this, the first expression loss value for each initial sample can be determined according to the similarity between the initial distillation sample and each initial sample in the initial dataset.

[0072] Continuing with the previous example, for the 5 initial distillation samples obtained from sampling, it is necessary to calculate the first expression loss value of each initial sample based on the similarity between these 5 initial distillation samples and each of the 50 initial samples. Understandably, for these 50 initial samples 1, 2, 3...50, we can calculate the first expression loss value 1 for initial sample 1, the first expression loss value 2 for initial sample 2, the first expression loss value 3 for initial sample 3, and so on, up to the first expression loss value 50 for initial sample 50.

[0073] In practice, to accurately calculate the similarity between the initial distillation sample and the initial sample, thus facilitating the subsequent calculation of the first expression loss value, feature extraction can be performed on the initial distillation sample and the initial sample. The similarity is then calculated based on the extracted sample features. The specific implementation method is as follows:

[0074] Before determining the first expression loss value of each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset, the method further includes:

[0075] Feature extraction is performed on the initial distillation sample to obtain the initial distillation sample features;

[0076] Feature extraction is performed on each initial sample in the initial dataset to obtain the initial sample features of each initial sample;

[0077] Calculate the similarity between the features of the initial distillation sample and the features of the initial sample of each initial sample.

[0078] Specifically, feature extraction can be performed on the initial distillation sample to obtain the initial distillation sample features. Feature extraction can also be performed on each initial sample in the initial dataset to obtain the initial sample features of each initial sample. The similarity between the initial distillation sample features and the initial sample features of each initial sample can be calculated, and this similarity can be used as the similarity between the initial distillation sample and each initial sample.

[0079] In practical applications, machine learning models can be used for feature extraction and similarity calculation, or any feature extraction algorithm and similarity calculation algorithm can be used for feature extraction and similarity calculation. This specification does not limit the embodiments in this way.

[0080] In one embodiment of this specification, feature extraction and similarity calculation can be performed based on a feature extraction model. Specifically, the initial distillation sample and each initial sample can be input into the feature extraction model sequentially, or the initial distillation sample and all initial samples can be input into the feature extraction model. In the feature extraction model, features are extracted from the initial distillation sample and each initial sample to obtain the initial distillation sample features and the initial sample features of each initial sample, and the similarity between the initial distillation sample features and the initial sample features of each initial sample is calculated.

[0081] Continuing with the previous example, we can input the 5 initial distillation samples and initial sample 1 from the 50 initial samples into the feature extraction model. In the feature extraction model, we extract the initial distillation sample features of each initial distillation sample, as well as the initial sample feature 1 of initial sample 1, and calculate the similarity between each initial distillation sample feature and initial sample feature 1. Then, we input the 5 initial distillation samples and initial sample 2 from the 50 initial samples into the feature extraction model, and calculate the similarity between each initial distillation sample feature and initial sample feature 2 of initial sample 2. Following a similar process, we calculate the similarity between the initial distillation samples and each of the 50 initial samples. Alternatively, we can input the initial distillation samples and these 50 initial samples into the feature extraction model. In the feature extraction model, we extract the initial distillation sample features of the initial distillation samples, as well as the 50 initial sample features of these 50 initial samples, and calculate the similarity between the initial distillation sample features and the initial sample features of each of the initial samples.

[0082] In summary, by extracting features from the initial distillation sample and the initial sample, it is possible to calculate the similarity based on the extracted sample features. This facilitates subsequent determination based on similarity whether the initial distillation sample can completely and accurately represent the initial sample, and provides a foundation for identifying more important and valuable initial samples from the initial dataset.

[0083] Based on this, after calculating the similarity between the initial distillation sample features and the initial sample features of each initial sample, the first expression loss value of each initial sample can be determined according to this similarity, thereby enabling the initial samples in the initial dataset to be filtered from the perspective of data importance. The specific implementation method is as follows:

[0084] The step of determining the first expression loss value for each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset includes:

[0085] Based on the similarity between the initial distillation sample features and the initial sample features of each initial sample, the first predicted label of each initial sample is determined;

[0086] The first expression loss value of each initial sample is calculated based on the initial label of each initial sample and the first predicted label.

[0087] Here, the first predicted label can be understood as the initial sample label predicted based on similarity. The initial sample can include training samples and training labels. For example, in an image classification scenario, the training samples in the initial sample can be image samples, and the training labels in the initial sample can be the category information of the image samples. Therefore, the initial label of the initial sample can be understood as the training label included in the initial sample, and this initial label is the true label.

[0088] Based on this, the first predicted label of each initial sample can be predicted by using the similarity between the features of the initial distillation sample and the features of the initial sample of each initial sample as an indicator, and the first expression loss value of each initial sample can be calculated based on the true label of each initial sample and the first predicted label.

[0089] In specific implementation, there can be at least two initial distillation samples, and correspondingly, there are at least two initial distillation sample features. The step of determining the first predicted label for each initial sample based on the similarity between the initial distillation sample features and the initial sample features of each initial sample includes:

[0090] Each of the initial samples is sequentially designated as the first initial sample;

[0091] Calculate the similarity between the features of each initial distillation sample and the initial sample features of the first initial sample;

[0092] Using the similarity as a weight, the initial labels corresponding to each initial distillation sample are weighted and summed to obtain the first predicted label of the first initial sample.

[0093] Here, the first initial sample can be understood as each initial sample.

[0094] Based on this, for the initial distillation sample and one of the initial samples (i.e., the first initial sample), the similarity between the initial distillation sample features of each initial distillation sample and the first initial sample can be calculated. This similarity is then used as a weight to perform a weighted summation of the initial labels (i.e., the true labels) of each initial distillation sample to obtain the first predicted label corresponding to that first initial sample. Similar processing is performed on each initial sample to obtain the first predicted label for each initial sample.

[0095] In practical applications, feature extraction models can be used to predict the first predicted label for each initial sample. Specifically, the initial distillation sample and each initial sample can be input into the feature extraction model. In this model, the initial distillation sample features and the initial sample features of each initial sample are extracted. The similarity between the initial distillation sample features and the initial sample features of each initial sample is calculated. Using this similarity as an indicator, the first predicted label of the initial sample is predicted. This first predicted label is the output of the feature extraction model.

[0096] The formula for calculating the first expression loss value is shown below:

[0097]

[0098] in, Let S be the first expression loss value, S be the target dataset (i.e., the dataset consisting of the target distilled samples), T be the initial dataset, and K be the value of the first expression loss value. θ For similarity, X S X is the training sample for the target dataset. T Y is the training sample of the initial dataset. T Y is the training label for the initial dataset. S The training labels for the target dataset.

[0099] Taking the initial sample as an example, which includes a training image sample showing a flower and a training label representing the image category "a rose" of the training image sample, the first predicted label "a flower" of the initial sample can be determined based on the similarity between the features of the initial sample and the features of the initial sample. Based on the training label "a rose" and the first predicted label "a flower", the first expression loss value of the initial sample can be calculated.

[0100] In summary, by using similarity as an indicator to predict the first predicted label of the initial sample, and then calculating the first expression loss value of the initial sample, it is possible to determine whether the initial distilled sample can accurately and completely represent the initial sample. This enables the importance screening of the initial samples in the initial dataset, which facilitates the subsequent distillation of the initial dataset.

[0101] Step 206: Perform enhancement processing on the initial samples whose first expression loss value reaches the preset loss threshold to obtain enhanced samples.

[0102] Specifically, after calculating the first expression loss value for each initial sample, if the first expression loss value reaches a preset loss threshold, the initial sample corresponding to the first expression loss value can be augmented to obtain an augmented sample.

[0103] The first expression loss value reaching the preset loss threshold can be understood as the first expression loss value being greater than the preset loss threshold.

[0104] In one embodiment of this specification, the first expression loss value of each initial sample can be sorted, and the initial sample corresponding to the larger first expression loss value can be enhanced according to the sorting result to obtain an enhanced sample.

[0105] For example, taking an initial distillation sample and five initial samples as an example, the first expression loss value of each of the five initial samples is calculated as 1, 2, 3, 4, and 5. These first expression loss values ​​1, 2, 3, 4, and 5 are sorted, and based on the sorting result, the two initial samples corresponding to the larger first expression loss values ​​4 and 5 are enhanced to obtain two enhanced samples.

[0106] In practical applications, speeding up the dataset distillation process is often considered to improve its speed and efficiency. However, this distillation method does not take into account the content of the data itself, resulting in poor performance of models trained on the distilled dataset.

[0107] Based on this, in one embodiment of this specification, after selecting valuable samples with high data importance according to the first expression loss value, these samples can be further enhanced to achieve semantic expansion and further improve the distillation effect. The specific implementation method is as follows:

[0108] The step of enhancing the initial samples whose first expression loss value reaches a preset loss threshold to obtain enhanced samples includes:

[0109] The initial samples whose first expression loss value reaches a preset loss threshold are transformed, or

[0110] Noise is added to the initial samples whose first expression loss value reaches a preset loss threshold to obtain enhanced samples.

[0111] Transformation processing includes, but is not limited to, cropping, rotation, flipping, scaling, and shifting.

[0112] Based on this, the initial samples whose first expression loss value reaches the preset loss threshold can be cropped, rotated, flipped, scaled and / or shifted, or the initial samples whose first expression loss value reaches the preset loss threshold can be noise-added to obtain enhanced samples.

[0113] In practical applications, feature transformation can be performed on initial samples whose first expression loss value reaches a preset loss threshold to obtain enhanced samples.

[0114] Using the previous example, with 5 initial distillation samples and 50 initial samples, we can calculate the first expression loss value for each of the 5 initial distillation samples and 50 initial samples, resulting in 50 first expression loss values. Then, we can enhance the 20 initial samples corresponding to the 20 first expression loss values ​​that reach the preset loss threshold to obtain 20 enhanced samples.

[0115] In summary, by enhancing the selected initial samples based on the first expression loss value, we can achieve semantic augmentation of these valuable initial samples, thereby improving the distillation effect on the initial dataset and further ensuring the task processing performance of the model trained based on the target distilled samples.

[0116] Step 208: Determine the second expression loss value of the enhanced sample based on the similarity between the initial distilled sample and the enhanced sample.

[0117] Specifically, after obtaining the enhanced sample, the second expression loss value of the enhanced sample can be determined based on the similarity between the initial distilled sample and the enhanced sample.

[0118] Similarly, when calculating the similarity between the initial distillation sample and the enhanced sample, the similarity between the initial distillation sample features and the enhanced sample features can be calculated, and this similarity between sample features can be used as the similarity between the samples. The specific implementation is as follows:

[0119] Before determining the second expression loss value of the enhanced sample based on the similarity between the initial distilled sample and the enhanced sample, the method further includes:

[0120] Feature extraction is performed on the initial distillation sample to obtain the initial distillation sample features;

[0121] Feature extraction is performed on the enhanced sample to obtain the enhanced sample features;

[0122] Calculate the similarity between the features of the initial distilled sample and the features of the enhanced sample.

[0123] Specifically, based on the feature extraction model, the initial distillation sample and the enhanced sample can be input into the feature extraction model. In the feature extraction model, the initial distillation sample features of the initial distillation sample and the enhanced sample features of the enhanced sample are extracted, thereby calculating the similarity between the initial distillation sample features and the enhanced sample features.

[0124] Understandably, when there are multiple initial samples selected based on the first expression loss value and the preset loss threshold, there are also multiple augmented samples. The number of initial samples whose first expression loss value reaches the preset loss threshold is equal to the number of augmented samples.

[0125] Using the previous example, we can input each of the 5 initial distillation samples and 20 enhanced samples into the feature extraction model, and use the feature extraction model to calculate the similarity between the 5 initial distillation samples and each of the 20 enhanced samples.

[0126] Accordingly, determining the second expression loss value of the enhanced sample based on the similarity between the initial distilled sample and the enhanced sample includes:

[0127] Based on the similarity between the features of the initial distilled sample and the features of the enhanced sample, a second predicted label for the enhanced sample is determined;

[0128] The second expression loss value of the augmented sample is calculated based on the initial label and the second predicted label of the augmented sample.

[0129] The second predicted label can be understood as the label of the augmented sample predicted based on similarity. Similar to the initial sample, the augmented sample also includes training samples and training labels. The initial label of the augmented sample can be understood as the training labels included in the augmented sample, which are the true labels.

[0130] Based on this, the second predicted label of the enhanced sample can be predicted using the similarity between the features of the initial distilled sample and the features of the enhanced sample as an indicator, and the second expression loss value of the enhanced sample can be calculated based on the true label and the second predicted label of the enhanced sample.

[0131] In practical applications, similar to the process of calculating the first expression loss value, a feature extraction model can be used to predict the second predicted label of the enhanced sample. Specifically, the initial distillation sample and the enhanced sample can be input into the feature extraction model. In this model, the initial distillation sample features of the initial distillation sample and the enhanced sample features of the enhanced sample are extracted, and the similarity between the initial distillation sample features and the enhanced sample features is calculated. Using this similarity as an indicator, the second predicted label of the enhanced sample is predicted, and this second predicted label is the output of the feature extraction model.

[0132] Specifically, the process of determining the second predicted label for the enhanced sample is similar to the process of determining the first predicted label for the initial sample, and will not be repeated here.

[0133] In summary, by using similarity as an indicator to predict the second predicted label of the augmented sample, and then calculating the second expression loss value of the augmented sample, it is possible to determine whether the initial distilled sample can completely and accurately represent the augmented sample. This facilitates subsequent updates of the initial distilled sample based on the second expression loss value, ensuring that the updated target distilled sample can completely and accurately represent the augmented sample. This further reduces the number of initial samples in the initial dataset while maintaining model processing performance.

[0134] Step 210: Update the initial distillation sample according to the second expression loss value to obtain the target distillation sample.

[0135] Specifically, after calculating the second expression loss value of the enhanced sample, the initial distilled sample can be updated based on the second expression loss value to obtain the target distilled sample.

[0136] The number of initial distillation samples and target distillation samples can be the same.

[0137] In specific implementation, updating the initial distillation sample based on the second expression loss value to obtain the target distillation sample includes:

[0138] Based on the second expression loss value, the initial distillation sample is backpropagated using a gradient to obtain the target distillation sample.

[0139] In one embodiment of this specification, when updating the initial distillation sample, a gradient backpropagation method can be used. Specifically, the gradient value of the initial distillation sample can be calculated based on the second expression loss value, and the pixel value of the initial distillation sample can be adjusted based on the gradient value to determine whether to adjust the pixel value positively or negatively.

[0140] In summary, it is possible to optimize and adjust the initial distillation sample, so that the updated target distillation sample can express the enhanced sample, thereby further ensuring the processing performance of the task model trained on the target distillation sample.

[0141] In practical applications, the distillation of datasets requires a large amount of computational overhead.

[0142] Based on this, the above data processing can be implemented using a feature extraction model, and enhancement processing can be performed only on the selected initial samples, reducing the amount of computational data. The feature extraction model can be understood as a model used to calculate the expression loss value. The specific implementation method is as follows:

[0143] After obtaining the initial distillation sample, the process further includes:

[0144] Based on the initial distillation sample, the initial feature extraction model is trained to obtain the target feature extraction model;

[0145] Accordingly, determining the first expression loss value for each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset includes:

[0146] The initial distillation sample and each initial sample in the initial dataset are input into the target feature extraction model. The target feature extraction model is used to determine the first expression loss value of each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset.

[0147] The initial feature extraction model can be understood as the feature extraction model before training, while the target feature extraction model can be understood as the feature extraction model obtained after training.

[0148] Specifically, after obtaining the initial distillation samples, the initial feature extraction model can be trained based on these samples to obtain the target feature extraction model. Then, the target feature extraction model can be used to calculate the first expression loss value for each initial sample. Specifically, the initial distillation samples and each initial sample can be input into the target feature extraction model. In the target feature extraction model, the initial distillation sample features of the initial distillation samples and the initial sample features of each initial sample are extracted. The similarity between the initial distillation samples and the initial sample features of each initial sample is calculated, and this similarity is used as an indicator to predict the first predicted label for each initial sample. Based on the true label and the first predicted label of each initial sample, the first expression loss value for each initial sample is calculated.

[0149] Understandably, the process of determining the first expression loss value using the target feature extraction model here is similar to the process of determining the first expression loss value using the feature extraction model mentioned above.

[0150] In summary, by training the feature extraction model, the first expression loss value of the initial sample can be calculated based on the feature extraction model, thereby determining whether the initial distillation sample can completely and accurately represent the initial sample.

[0151] Furthermore, after updating the initial distillation sample to obtain the target distillation sample, in order to further improve distillation efficiency, the target feature extraction model can be updated based on the target distillation sample to obtain an updated target feature extraction model. This updated target feature extraction model is then used to determine whether the target distillation sample can accurately and completely represent the initial sample. The target distillation sample is then iteratively optimized. The specific implementation method is as follows:

[0152] After obtaining the target distillation sample, the process further includes:

[0153] Based on the target distillation sample, the target feature extraction model is updated to obtain the updated target feature extraction model;

[0154] Using the updated target feature extraction model, the first expression loss value of each initial sample is determined based on the similarity between the target distillation sample and each initial sample in the initial dataset;

[0155] The initial samples whose first expression loss value reaches a preset loss threshold are augmented to obtain augmented samples;

[0156] Based on the similarity between the target distilled sample and the enhanced sample, a second expression loss value for the enhanced sample is determined;

[0157] The target distillation sample is updated based on the second expression loss value to obtain the updated target distillation sample;

[0158] Continue executing the step of updating the target feature extraction model based on the target distillation sample to obtain the updated target feature extraction model until the preset stopping condition is met.

[0159] The preset stopping condition can be understood as the number of iterations reaching a preset threshold or the second expression loss value reaching a preset loss value threshold.

[0160] Based on this, after obtaining the target distillation sample, the target feature extraction model can be updated according to the target distillation sample to obtain an updated target feature extraction model, so that the expression loss value calculated subsequently is more accurate. Then, using the updated target feature extraction model, the similarity between the target distillation sample and each initial sample in the initial dataset can be calculated, and the first expression loss value of each initial sample can be determined. Initial samples whose first expression loss value reaches a preset loss threshold are enhanced to obtain enhanced samples. According to the similarity between the target distillation sample and the enhanced sample, the second expression loss value of the enhanced sample is determined. The target distillation sample is updated according to the second expression loss value to obtain an updated target distillation sample. The updated target feature extraction model is updated again according to the target distillation sample until the number of iterations reaches a preset threshold or the second expression loss value reaches a preset loss value threshold, at which point the iteration stops, and finally the target distillation sample that can accurately and completely express the enhanced sample is obtained.

[0161] In summary, by iteratively updating the target feature extraction model and the target distillation samples, the optimization of the target distillation samples and the semantic expansion of an unlimited number of samples are achieved. This ensures the processing performance of the task model trained based on the target distillation samples when the number of target distillation samples obtained after distillation is less than the number of initial samples in the initial dataset.

[0162] In practical applications, the target dataset formed by the obtained target distillation samples is a small-scale dataset, which is obtained by distilling the initial dataset (i.e., the large-scale dataset). Accordingly, after obtaining the target distillation samples, these target distillation samples can be applied to the training of task models in any domain. The specific implementation method is as follows:

[0163] After obtaining the target distillation sample, the process further includes:

[0164] Based on the target distillation sample, the training task model is trained until a task model that meets the training stopping condition is obtained.

[0165] The training task models include, but are not limited to, natural language processing models and visual processing models (image processing models, video processing models, object detection models), etc.

[0166] Understandably, since the initial samples in the initial dataset include training samples and training labels, the data processing method provided in the embodiments of this specification applies the same processing procedure to the training samples and training labels included in the initial samples. Correspondingly, the target distillation samples also include training samples and training labels.

[0167] Based on this, supervised training can be performed on the model to be trained according to the training samples and training labels included in the target distillation samples until a task model that meets the training stopping condition is obtained.

[0168] In one embodiment of this specification, the task model is an image classification model, and the initial dataset is an initial image dataset.

[0169] In summary, the above method obtains initial distillation samples by sampling the initial dataset. Based on the similarity between the initial distillation sample and each initial sample in the initial dataset, a first expression loss value is calculated for each initial sample. This determines whether the initial distillation sample can fully represent each initial sample in the initial dataset. For initial samples whose first expression loss value reaches a preset loss threshold, it indicates that the initial distillation sample cannot fully represent the initial sample. In this case, these initial samples can be augmented to obtain augmented samples, thus semantically expanding the initial samples. A second expression loss value is calculated for the augmented samples based on the similarity between the initial distillation sample and the augmented samples. The initial distillation samples are then updated based on this second expression loss value to obtain target distillation samples. This ensures that the obtained target distillation samples can more completely and accurately represent each initial sample in the initial dataset, thereby maintaining the semantic richness of the training data while reducing the amount of training data in the training dataset. This further improves the training efficiency and task processing performance of the task model trained based on the target distillation samples.

[0170] The following is in conjunction with the appendix Figure 3 Taking the application of the data processing method provided in this specification in model training as an example, the data processing method will be further explained. Among other things, Figure 3 A flowchart illustrating the processing procedure of a data processing method according to an embodiment of this specification is shown, specifically including the following steps.

[0171] Step 302: Sample the initial dataset to obtain the initial distillation sample.

[0172] For example, the initial dataset may include 100 initial samples, and these 100 initial samples may be randomly sampled, with the 10 sampled initial samples used as the initial distillation samples.

[0173] Step 304: Based on the initial distillation sample, train the initial feature extraction model to obtain the target feature extraction model.

[0174] Step 306: Input the initial distillation sample and each initial sample in the initial dataset into the target feature extraction model, and use the target feature extraction model to determine the first expression loss value of each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset.

[0175] Continuing with the previous example, for one of the 100 initial samples, initial sample 1, we can use the 10 initial distillation samples to express it, thereby determining the first expression loss value of initial sample 1. Specifically, we can input the 10 initial distillation samples and initial sample 1 into the target feature extraction model. In the target feature extraction model, we extract the features of the 10 initial distillation samples and the initial sample features of initial sample 1. We calculate the similarity between each initial distillation sample feature and the initial sample features of initial sample 1. Using the similarity between the initial sample features and each initial distillation sample feature as a weight, we perform a weighted summation on the ground truth label corresponding to each initial distillation sample to obtain the first predicted label corresponding to initial sample 1. Based on the ground truth label and the first predicted label, we calculate the first expression loss value of initial sample 1. Correspondingly, we perform a similar operation on the remaining 99 initial samples to obtain the first expression loss value of each of the remaining 99 initial samples.

[0176] Step 308: Perform enhancement processing on the initial samples whose first expression loss value reaches the preset loss threshold to obtain enhanced samples.

[0177] Following the previous example, we can perform augmentation on the 20 initial samples whose first expression loss value reaches a preset loss threshold to obtain 20 augmented samples. Alternatively, we can sort the 100 calculated first expression loss values ​​and then perform augmentation on the 20 initial samples corresponding to the 20 largest first expression loss values ​​to obtain 20 augmented samples.

[0178] Step 310: Determine the second expression loss value of the enhanced sample based on the similarity between the initial distilled sample and the enhanced sample.

[0179] Similarly, when calculating the second expression loss value, it can also be implemented based on the aforementioned target feature extraction model. The specific calculation process is similar to step 306, and will not be repeated here.

[0180] Step 312: Update the initial distillation sample according to the second expression loss value to obtain the target distillation sample.

[0181] Using the previous example, we can update the 10 initial distillation samples based on the second expression loss value of each of the 20 enhanced samples to obtain 10 target distillation samples.

[0182] Step 314: Update the target feature extraction model based on the target distillation sample to obtain the updated target feature extraction model.

[0183] Step 316: Using the updated target feature extraction model, determine the first expression loss value of each initial sample based on the similarity between the target distillation sample and each initial sample in the initial dataset.

[0184] Step 318: Perform enhancement processing on the initial samples whose first expression loss value reaches the preset loss threshold to obtain enhanced samples.

[0185] Step 320: Determine the second expression loss value of the enhanced sample based on the similarity between the target distilled sample and the enhanced sample.

[0186] Step 322: Update the target distillation sample according to the second expression loss value to obtain the updated target distillation sample.

[0187] Specifically, the process from step 316 to step 322 is similar to that from step 306 to step 312. It can be understood that the process from step 316 to step 322 is an iterative process following the process from step 306 to step 312. Therefore, the target distillation sample in step 316 is the same as the target distillation sample obtained in step 312. The specific processing process will not be repeated here.

[0188] Step 324: Continue to execute the step of updating the target feature extraction model based on the target distillation sample to obtain the updated target feature extraction model, until the obtained target distillation sample meets the preset stopping condition.

[0189] In summary, the above method obtains initial distillation samples by sampling the initial dataset. Based on the similarity between the initial distillation sample and each initial sample in the initial dataset, a first expression loss value is calculated for each initial sample. This determines whether the initial distillation sample can fully represent each initial sample in the initial dataset. For initial samples whose first expression loss value reaches a preset loss threshold, it indicates that the initial distillation sample cannot fully represent the initial sample. In this case, these initial samples can be augmented to obtain augmented samples, thus semantically expanding the initial samples. A second expression loss value is calculated for the augmented samples based on the similarity between the initial distillation sample and the augmented samples. The initial distillation samples are then updated based on this second expression loss value to obtain target distillation samples. This ensures that the obtained target distillation samples can more completely and accurately represent each initial sample in the initial dataset, thereby maintaining the semantic richness of the training data while reducing the amount of training data in the training dataset. This further improves the training efficiency and task processing performance of the task model trained based on the target distillation samples.

[0190] Corresponding to the above method embodiments, this specification also provides data processing apparatus embodiments. Figure 4 A schematic diagram of the structure of a data processing apparatus according to one embodiment of this specification is shown. Figure 4 As shown, the device includes:

[0191] Sampling module 402 is configured to perform sampling processing on the initial dataset to obtain an initial distillation sample;

[0192] The first determining module 404 is configured to determine a first expression loss value for each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset.

[0193] Enhancement module 406 is configured to enhance the initial sample whose first expression loss value reaches a preset loss threshold to obtain enhanced sample;

[0194] The second determining module 408 is configured to determine a second expression loss value of the enhanced sample based on the similarity between the initial distillation sample and the enhanced sample;

[0195] The update module 410 is configured to update the initial distillation sample according to the second expression loss value to obtain the target distillation sample.

[0196] In an optional embodiment, the first determining module 404 is further configured to:

[0197] Feature extraction is performed on the initial distillation sample to obtain the initial distillation sample features;

[0198] Feature extraction is performed on each initial sample in the initial dataset to obtain the initial sample features of each initial sample;

[0199] Calculate the similarity between the features of the initial distillation sample and the features of the initial sample of each initial sample.

[0200] In an optional embodiment, the first determining module 404 is further configured to:

[0201] Based on the similarity between the initial distillation sample features and the initial sample features of each initial sample, the first predicted label of each initial sample is determined;

[0202] The first expression loss value of each initial sample is calculated based on the initial label of each initial sample and the first predicted label.

[0203] In an optional embodiment, the enhancement module 406 is further configured to:

[0204] The initial samples whose first expression loss value reaches a preset loss threshold are transformed, or

[0205] Noise is added to the initial samples whose first expression loss value reaches a preset loss threshold to obtain enhanced samples.

[0206] In an optional embodiment, the second determining module 408 is further configured to:

[0207] Feature extraction is performed on the initial distillation sample to obtain the initial distillation sample features;

[0208] Feature extraction is performed on the enhanced sample to obtain the enhanced sample features;

[0209] Calculate the similarity between the features of the initial distilled sample and the features of the enhanced sample.

[0210] In an optional embodiment, the second determining module 408 is further configured to:

[0211] Based on the similarity between the features of the initial distilled sample and the features of the enhanced sample, a second predicted label for the enhanced sample is determined;

[0212] The second expression loss value of the augmented sample is calculated based on the initial label and the second predicted label of the augmented sample.

[0213] In an optional embodiment, the device further includes a training module configured to:

[0214] Based on the initial distillation sample, the initial feature extraction model is trained to obtain the target feature extraction model;

[0215] Accordingly, the first determining module 404 is further configured to:

[0216] The initial distillation sample and each initial sample in the initial dataset are input into the target feature extraction model. The target feature extraction model is used to determine the first expression loss value of each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset.

[0217] In an optional embodiment, the training module is further configured to:

[0218] Based on the target distillation sample, the target feature extraction model is updated to obtain the updated target feature extraction model;

[0219] Using the updated target feature extraction model, the first expression loss value of each initial sample is determined based on the similarity between the target distillation sample and each initial sample in the initial dataset;

[0220] The initial samples whose first expression loss value reaches a preset loss threshold are augmented to obtain augmented samples;

[0221] Based on the similarity between the target distilled sample and the enhanced sample, a second expression loss value for the enhanced sample is determined;

[0222] The target distillation sample is updated based on the second expression loss value to obtain the updated target distillation sample;

[0223] Continue executing the step of updating the target feature extraction model based on the target distillation sample to obtain the updated target feature extraction model, until the obtained target distillation sample meets the preset stopping condition.

[0224] In an optional embodiment, the update module 410 is further configured to:

[0225] Based on the second expression loss value, the initial distillation sample is backpropagated using a gradient to obtain the target distillation sample.

[0226] In an optional embodiment, the training module is further configured to:

[0227] Based on the target distillation sample, the training task model is trained until a task model that meets the training stopping condition is obtained.

[0228] In one optional embodiment, the task model is an image classification model, and the initial dataset is an initial image dataset.

[0229] In summary, the above-described apparatus obtains initial distillation samples by sampling the initial dataset. Based on the similarity between the initial distillation sample and each initial sample in the initial dataset, a first expression loss value is calculated for each initial sample. This determines whether the initial distillation sample can fully represent each initial sample in the initial dataset. For initial samples whose first expression loss value reaches a preset loss threshold, it indicates that the initial distillation sample cannot fully represent the initial sample. In this case, these initial samples can be augmented to obtain augmented samples, thus semantically expanding the initial samples. A second expression loss value is calculated for the augmented samples based on the similarity between the initial distillation sample and the augmented samples. The initial distillation samples are then updated based on this second expression loss value to obtain target distillation samples. This ensures that the obtained target distillation samples can more completely and accurately represent each initial sample in the initial dataset, thereby maintaining the semantic richness of the training data while reducing the amount of training data in the training dataset. This further improves the training efficiency and task processing performance of the task model trained based on the target distillation samples.

[0230] The above is an illustrative scheme of a data processing apparatus according to this embodiment. It should be noted that the technical solution of this data processing apparatus and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the data processing apparatus, please refer to the description of the technical solution of the data processing method described above.

[0231] See Figure 5 , Figure 5 A flowchart of an image classification method according to an embodiment of this specification is shown, which specifically includes the following steps.

[0232] Step 502: Determine the image to be processed;

[0233] Step 504: Input the image to be processed into the image classification model to obtain the image category result output by the image classification model, wherein the image classification model is trained based on the target distillation sample, and the target distillation sample is obtained based on the data processing method provided in the first aspect of the embodiments of this specification.

[0234] Specifically, in e-commerce scenarios, e-commerce platforms typically provide users with recommendations for products they are interested in. Based on this, this image classification model can be used to determine the image category of the image to be processed, and then obtain other product images of the same category as the image to be processed, thereby enabling product recommendations to be made to users.

[0235] In practical implementation, this image classification method can be applied to cloud-side devices. The cloud-side device can receive image processing requests sent by users through edge devices. These requests carry the image to be processed. The cloud-side device can input the image to be processed into an image classification model to obtain the image category result output by the model. The cloud-side device can then directly send this image category result to the edge device for display to the user. Alternatively, the cloud-side device can also obtain product images of the same category as the image to be processed based on the image category result and send these product images to the edge device for display to the user.

[0236] In the above method, initial distillation samples are obtained by sampling the initial dataset. Based on the similarity between the initial distillation sample and each initial sample in the initial dataset, a first expression loss value is calculated for each initial sample. This determines whether the initial distillation sample can fully represent each initial sample in the initial dataset. For initial samples whose first expression loss value reaches a preset loss threshold, it indicates that the initial distillation sample is difficult to fully represent the initial sample. At this time, these initial samples can be augmented to obtain augmented samples, thereby expanding the semantics of the initial samples. Based on the similarity between the initial distillation sample and the augmented sample, a second expression loss value is calculated for the augmented sample. The initial distillation sample is then updated based on the second expression loss value to obtain target distillation samples. This allows the obtained target distillation samples to more completely and accurately represent each initial sample in the initial dataset, thus ensuring the semantic richness of the training data while reducing the amount of training data in the training dataset. This further improves the training efficiency and task processing performance of the task model trained based on the target distillation samples.

[0237] Corresponding to the above method embodiments, this specification also provides embodiments of image classification devices. Figure 6 A schematic diagram of an image classification device according to one embodiment of this specification is shown. Figure 6 As shown, the device includes:

[0238] The determination module 602 is configured to determine the image to be processed;

[0239] The input module 604 is configured to input the image to be processed into an image classification model to obtain the image category result output by the image classification model, wherein the image classification model is trained based on target distillation samples, and the target distillation samples are obtained based on the data processing method provided in the first aspect of the embodiments of this specification.

[0240] In the aforementioned apparatus, initial distillation samples are obtained by sampling the initial dataset. Based on the similarity between the initial distillation sample and each initial sample in the initial dataset, a first expression loss value is calculated for each initial sample. This determines whether the initial distillation sample can fully represent each initial sample in the initial dataset. For initial samples whose first expression loss value reaches a preset loss threshold, it indicates that the initial distillation sample is difficult to fully represent the initial sample. In this case, these initial samples can be augmented to obtain augmented samples, thereby semantically expanding the initial samples. Based on the similarity between the initial distillation sample and the augmented sample, a second expression loss value is calculated for the augmented sample. The initial distillation sample is then updated based on the second expression loss value to obtain target distillation samples. This allows the obtained target distillation samples to more completely and accurately represent each initial sample in the initial dataset, thus ensuring the semantic richness of the training data while reducing the amount of training data in the training dataset. This further improves the training efficiency and task processing performance of the task model trained based on the target distillation samples.

[0241] The above is a schematic scheme of an image classification device according to this embodiment. It should be noted that the technical solution of this image classification device and the technical solution of the image classification method described above belong to the same concept. For details not described in detail in the technical solution of the image classification device, please refer to the description of the technical solution of the image classification method described above.

[0242] See Figure 7 , Figure 7 A flowchart of a data processing method according to an embodiment of this specification is shown, which specifically includes the following steps.

[0243] Step 702: Determine the data to be processed, wherein the data to be processed includes at least one of image data, audio data, video data, and text data;

[0244] Step 704: Input the data to be processed into the data processing model to obtain the data processing result output by the data processing model, wherein the data processing model is trained based on the target distillation sample, and the target distillation sample is obtained based on the data processing method provided in the first aspect of the embodiments of this specification.

[0245] Specifically, the training process for the data processing model is similar to the training process for the task model described above, and will not be repeated here.

[0246] The data processing model can be used to process data of various modalities, such as image data, text data, audio data, and video data. For example, in image classification, the model can be used to classify input image data. In text recognition, it can be used to recognize input text data. In image-text retrieval, it can be used to process input image and / or text data to obtain text information corresponding to the image data and / or image information corresponding to the text data. In audio-visual processing, it can also be used to process input audio or video data.

[0247] Specifically, this data processing model can also process multimodal data, and the specific implementation method is as follows:

[0248] When the data to be processed includes the image data and the corresponding question text data, the step of inputting the data to be processed into the data processing model and obtaining the data processing result output by the data processing model includes:

[0249] The image data and the question text data are input into the data processing model to obtain the answer text corresponding to the image data and the question text data, which is output by the data processing model. The answer text is then used as the data processing result of the image data.

[0250] In this context, the question text data can be understood as the question asked in response to the image data. The answer text can be understood as the answer to that question obtained from the image data. For example, if the image data shows three dogs running on a grassy field, and the corresponding question text data is "How many dogs are in the picture?", then inputting the image data and question text data into the data processing model will result in the output answer text "There are 3 dogs in the picture".

[0251] Understandably, when training the data processing model, a training dataset including image data, question text data, and answer text can be determined, and the aforementioned data processing method can be used to distill the training dataset to obtain a target distillation sample. The target distillation sample may include processed image data, processed question text data, and processed answer text, and the data processing model can be trained in a supervised manner based on the target distillation sample.

[0252] In the above method, initial distillation samples are obtained by sampling the initial dataset. Based on the similarity between the initial distillation sample and each initial sample in the initial dataset, a first expression loss value is calculated for each initial sample. This determines whether the initial distillation sample can fully represent each initial sample in the initial dataset. For initial samples whose first expression loss value reaches a preset loss threshold, it indicates that the initial distillation sample is difficult to fully represent the initial sample. At this time, these initial samples can be augmented to obtain augmented samples, thereby expanding the semantics of the initial samples. Based on the similarity between the initial distillation sample and the augmented sample, a second expression loss value is calculated for the augmented sample. The initial distillation sample is then updated based on the second expression loss value to obtain target distillation samples. This allows the obtained target distillation samples to more completely and accurately represent each initial sample in the initial dataset, thus ensuring the semantic richness of the training data while reducing the amount of training data in the training dataset. This further improves the training efficiency and task processing performance of the task model trained based on the target distillation samples.

[0253] Corresponding to the above method embodiments, this specification also provides data processing apparatus embodiments. Figure 8 A schematic diagram of the structure of a data processing apparatus according to one embodiment of this specification is shown. Figure 8 As shown, the device includes:

[0254] The determining module 802 is configured to determine data to be processed, wherein the data to be processed includes at least one of image data, audio data, video data, and text data;

[0255] The input module 804 is configured to input the data to be processed into a data processing model to obtain the data processing result output by the data processing model, wherein the data processing model is trained based on a target distillation sample, and the target distillation sample is obtained based on the data processing method provided in the first aspect of the embodiments of this specification.

[0256] In an optional embodiment, the input module 804 is further configured to:

[0257] When the data to be processed includes the image data and the corresponding question text data,

[0258] The image data and the question text data are input into the data processing model to obtain the answer text corresponding to the image data and the question text data, which is output by the data processing model. The answer text is then used as the data processing result of the image data.

[0259] In the aforementioned apparatus, initial distillation samples are obtained by sampling the initial dataset. Based on the similarity between the initial distillation sample and each initial sample in the initial dataset, a first expression loss value is calculated for each initial sample. This determines whether the initial distillation sample can fully represent each initial sample in the initial dataset. For initial samples whose first expression loss value reaches a preset loss threshold, it indicates that the initial distillation sample is difficult to fully represent the initial sample. In this case, these initial samples can be augmented to obtain augmented samples, thereby semantically expanding the initial samples. Based on the similarity between the initial distillation sample and the augmented sample, a second expression loss value is calculated for the augmented sample. The initial distillation sample is then updated based on the second expression loss value to obtain target distillation samples. This allows the obtained target distillation samples to more completely and accurately represent each initial sample in the initial dataset, thus ensuring the semantic richness of the training data while reducing the amount of training data in the training dataset. This further improves the training efficiency and task processing performance of the task model trained based on the target distillation samples.

[0260] Figure 9 A structural block diagram of a computing device 900 according to one embodiment of this specification is shown. The components of the computing device 900 include, but are not limited to, a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and a database 950 is used to store data.

[0261] The computing device 900 also includes an access device 940, which enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 940 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0262] In one embodiment of this application, the aforementioned components of the computing device 900 and Figure 9 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 9 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.

[0263] The computing device 900 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 900 can also be a mobile or stationary server.

[0264] The processor 920 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above method.

[0265] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above method belong to the same concept, and all details not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the above method.

[0266] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described method.

[0267] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the method described above belong to the same concept, and all details not described in detail in the technical solution of the storage medium can be referred to the description of the technical solution of the method described above.

[0268] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described method.

[0269] The above is an illustrative example of a computer program according to this embodiment. It should be noted that the technical solution of this computer program and the technical solution of the method described above belong to the same concept. Details not described in detail in the technical solution of the computer program can be found in the description of the technical solution of the method described above.

[0270] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0271] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0272] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0273] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0274] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A data processing method, comprising: The initial dataset is sampled to obtain the initial distillation sample; Based on the similarity between the initial distillation sample and each initial sample in the initial dataset, a first expression loss value is determined for each initial sample; The initial samples whose first expression loss value reaches a preset loss threshold are augmented to obtain augmented samples; Based on the similarity between the initial distilled sample and the enhanced sample, a second expression loss value for the enhanced sample is determined; The initial distillation sample is updated based on the second expression loss value to obtain the target distillation sample.

2. The method according to claim 1, further comprising, before determining the first expression loss value of each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset: Feature extraction is performed on the initial distillation sample to obtain the initial distillation sample features; Feature extraction is performed on each initial sample in the initial dataset to obtain the initial sample features of each initial sample; Calculate the similarity between the features of the initial distillation sample and the features of the initial sample of each initial sample.

3. The method according to claim 2, wherein determining the first expression loss value of each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset comprises: Based on the similarity between the initial distillation sample features and the initial sample features of each initial sample, the first predicted label of each initial sample is determined; The first expression loss value of each initial sample is calculated based on the initial label of each initial sample and the first predicted label.

4. The method according to claim 3, wherein the initial distillation sample is at least two, and the initial distillation sample features at least two characteristics; The step of determining the first predicted label for each initial sample based on the similarity between the initial distillation sample features and the initial sample features of each initial sample includes: Each of the initial samples is sequentially designated as the first initial sample; Calculate the similarity between the features of each initial distillation sample and the initial sample features of the first initial sample; Using the similarity as a weight, the initial labels corresponding to each initial distillation sample are weighted and summed to obtain the first predicted label of the first initial sample.

5. The method according to claim 1, wherein the enhancement processing of the initial sample whose first expression loss value reaches a preset loss threshold to obtain an enhanced sample comprises: The initial samples whose first expression loss value reaches a preset loss threshold are transformed, or Noise is added to the initial samples whose first expression loss value reaches a preset loss threshold to obtain enhanced samples.

6. The method according to claim 1, further comprising, before determining the second expression loss value of the enhanced sample based on the similarity between the initial distilled sample and the enhanced sample: Feature extraction is performed on the initial distillation sample to obtain the initial distillation sample features; Feature extraction is performed on the enhanced sample to obtain the enhanced sample features; Calculate the similarity between the features of the initial distilled sample and the features of the enhanced sample.

7. The method according to claim 6, wherein determining the second expression loss value of the enhanced sample based on the similarity between the initial distilled sample and the enhanced sample comprises: Based on the similarity between the features of the initial distilled sample and the features of the enhanced sample, a second predicted label for the enhanced sample is determined; The second expression loss value of the augmented sample is calculated based on the initial label and the second predicted label of the augmented sample.

8. The method according to claim 1, further comprising, after obtaining the initial distillation sample: Based on the initial distillation sample, the initial feature extraction model is trained to obtain the target feature extraction model; Accordingly, determining the first expression loss value for each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset includes: The initial distillation sample and each initial sample in the initial dataset are input into the target feature extraction model. The target feature extraction model is used to determine the first expression loss value of each initial sample based on the similarity between the initial distillation sample and each initial sample in the initial dataset.

9. The method according to claim 8, further comprising, after obtaining the target distillation sample: Based on the target distillation sample, the target feature extraction model is updated to obtain the updated target feature extraction model; Using the updated target feature extraction model, the first expression loss value of each initial sample is determined based on the similarity between the target distillation sample and each initial sample in the initial dataset; The initial samples whose first expression loss value reaches a preset loss threshold are augmented to obtain augmented samples; Based on the similarity between the target distilled sample and the enhanced sample, a second expression loss value for the enhanced sample is determined; The target distillation sample is updated based on the second expression loss value to obtain the updated target distillation sample; Continue executing the step of updating the target feature extraction model based on the target distillation sample to obtain the updated target feature extraction model, until the obtained target distillation sample meets the preset stopping condition.

10. The method according to claim 1 or 9, wherein updating the initial distillation sample based on the second expression loss value to obtain the target distillation sample comprises: Based on the second expression loss value, the initial distillation sample is backpropagated using a gradient to obtain the target distillation sample.

11. The method according to claim 1, further comprising, after obtaining the target distillation sample: Based on the target distillation sample, the training task model is trained until a task model that meets the training stopping condition is obtained.

12. An image classification method, comprising: Identify the image to be processed; The image to be processed is input into an image classification model to obtain the image category result output by the image classification model, wherein the image classification model is trained based on the target distillation sample, and the target distillation sample is obtained based on the method according to any one of claims 1-11.

13. A data processing method, comprising: The data to be processed is determined, wherein the data to be processed includes at least one of image data, audio data, video data, and text data; The data to be processed is input into the data processing model to obtain the data processing result output by the data processing model, wherein the data processing model is trained based on the target distillation sample, and the target distillation sample is obtained based on the method described in any one of claims 1-11.

14. The method according to claim 13, wherein when the data to be processed includes the image data and the question text data corresponding to the image data, the step of inputting the data to be processed into the data processing model to obtain the data processing result output by the data processing model includes: The image data and the question text data are input into the data processing model to obtain the answer text corresponding to the image data and the question text data, which is output by the data processing model. The answer text is then used as the data processing result of the image data.

Citation Information

Patent Citations

  • Supervised learning method and device, label prediction method and device, electronic equipment and storage medium

    CN110781934A

  • Noise sample recognition method, device and apparatus for pedestrian re-recognition, and storage medium

    CN111414952A