Model training and data processing method, device, equipment and storage medium

By adding multiple perceptron layers to the pre-trained network model and optimizing the feature extraction layer based on sample semantic distance, the problem of decreased transferability of deep learning computer vision solutions in transfer tasks is solved, achieving higher model accuracy and transfer performance.

CN114997287BActive Publication Date: 2025-12-16ZHEJIANG SENSETIME TECH DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210554252.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-19
Publication Date
2025-12-16
Estimated Expiration
2042-05-19

AI Technical Summary

Technical Problem

Existing deep learning computer vision solutions suffer from a decline in transferability in transfer tasks, mainly due to the gap in transfer semantics between the target task dataset and the pre-trained dataset, resulting in performance that is weaker than that of the pre-trained dataset.

Method used

By acquiring a pre-trained network model, supervising pre-training is performed based on the pre-trained dataset. The preset accuracy threshold is determined by using the semantic distance of the samples, the network parameter update of the feature extraction layer is controlled, a multi-layer perceptron layer is added, and the feature extraction layer is optimized to adapt to the target task, thereby improving the model transfer performance.

Benefits of technology

It improves the model's accuracy and transfer performance on the target task, shortens training time, and enhances the training efficiency and accuracy of the initial network model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114997287B_ABST
    Figure CN114997287B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a model training and data processing method, device and equipment and a storage medium, wherein the model training method comprises: obtaining a pre-training network model; the pre-training network model comprises at least a feature extraction layer and a multi-layer perceptron layer located after the feature extraction layer; performing supervised pre-training on the pre-training network model based on a pre-training data set to obtain a trained pre-training network model; training an initial network model based on a task data set corresponding to a target task to obtain a target network model for processing the target task; the initial network model comprises the feature extraction layer of the trained pre-training network model, and the task data set is different in sample semantics from the pre-training data set.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present disclosure relate to the field of artificial intelligence, and in particular, to a model training and data processing method and device, equipment and a storage medium. BACKGROUND

[0002] Existing deep learning computer vision solutions often follow the engineering scheme of "pre-training first and fine-tuning later". Various training methods are pre-trained on large data sets, and then additional parameter fine-tuning is performed on the target task data set. However, due to the semantic gap between the two data sets, the performance on the target task data set is often weaker than its performance on the pre-training data set, that is, there is a decline in the transfer ability. SUMMARY

[0003] Embodiments of the present disclosure provide a model training and data processing method, device, equipment and a storage medium.

[0004] In a first aspect, a model training method is provided, comprising: obtaining a pre-trained network model; the pre-trained network model at least includes a feature extraction layer and a multi-layer perceptron layer located after the feature extraction layer; performing supervised pre-training on the pre-trained network model based on a pre-training data set to obtain a trained pre-trained network model; training an initial network model based on a task data set corresponding to a target task to obtain a target network model for processing the target task; the initial network model includes the feature extraction layer of the trained pre-trained network model, and the sample semantics in the task data set are different from those in the pre-training data set.

[0005] In some embodiments, the accuracy of the trained pre-trained network model reaches a preset accuracy threshold; before the supervised pre-training on the pre-trained network model based on the pre-training data set, the method further comprises: obtaining a sample semantic distance between the task data set and the pre-training data set; determining the preset accuracy threshold based on the sample semantic distance; wherein the sample semantic distance is inversely proportional to the preset accuracy threshold.

[0006] In this embodiment, the sample semantic distance can be inversely proportional to the preset accuracy threshold, that is, the larger the sample semantic distance, the smaller the preset accuracy threshold, and correspondingly, the lower the model accuracy of the pre-trained network model obtained in the pre-training process, the worse the model performance of the pre-trained network model; and the smaller the sample semantic distance, the larger the preset accuracy threshold, and correspondingly, the higher the model accuracy of the pre-trained network model obtained in the pre-training process, the better the model performance of the pre-trained network model.

[0007] In some embodiments, the obtaining the sample semantic distance between the task dataset and the pre-training dataset comprises: extracting first semantic features corresponding to at least one first sample data in the task dataset; extracting second semantic features corresponding to at least one second sample data in the pre-training dataset; and determining the sample semantic distance based on the first semantic features and the second semantic features.

[0008] In some embodiments, the supervised pre-training the pre-training network model based on the pre-training dataset to obtain a trained pre-training network model comprises: inputting first sample data in the pre-training dataset into the pre-training network model to obtain predicted labels of the first sample data output by the pre-training network model; determining a constraint parameter based on the preset accuracy threshold, and generating a pre-training loss function based on the constraint parameter; the preset accuracy threshold is directly proportional to the constraint parameter; determining a loss value based on the pre-training loss function, the predicted labels of the first sample data, and corresponding real labels, and updating network parameters of the feature extraction layer based on the loss value until the pre-training loss function converges, to obtain the trained pre-training network model; wherein the feature extraction layer of the trained pre-training network model is inversely proportional to the feature distance of the intra-class sample data.

[0009] In the embodiments of the present disclosure, since the preset accuracy threshold is previously based on the sample semantic distance between the pre-training dataset and the task dataset, during the training of the pre-training network model, the pre-training loss function can be determined based on the preset accuracy threshold, and the pre-training network model can be trained based on the currently obtained pre-training loss function, so that the feature extraction layer of the trained pre-training network model is inversely proportional to the feature distance of the intra-class sample data, that is, the model performance of the pre-training network model can be controlled within a smaller model accuracy in response to the increase of the sample semantic distance, to ensure higher model migration performance; at the same time, the model performance of the pre-training network model can be controlled within a larger model accuracy in response to the decrease of the sample semantic distance, to ensure higher model migration performance.

[0010] In some embodiments, the supervised pre-training the pre-training network model based on the pre-training dataset to obtain a trained pre-training network model comprises: inputting first sample data in the pre-training dataset into the pre-training network model to obtain predicted labels of the first sample data output by the pre-training network model; determining a loss value based on the predicted labels of the first sample data and corresponding real labels, and updating network parameters of the feature extraction layer based on the loss value until the accuracy of the pre-training network model reaches a preset accuracy threshold, to obtain the trained pre-training network model.

[0011] In some embodiments, the updating the network parameters of the feature extraction layer based on the loss value until the accuracy of the pre-trained network model reaches a preset accuracy threshold to obtain the trained pre-trained network model comprises: updating the network parameters of the feature extraction layer based on the loss value, and determining whether the accuracy of the pre-trained network model reaches the preset accuracy threshold; in a case where the accuracy of the pre-trained network model does not reach the preset accuracy threshold, continuing training; in a case where the accuracy of the pre-trained network model reaches the preset accuracy threshold, taking the pre-trained network model as the trained pre-trained network model.

[0012] In the embodiments of the present disclosure, since the preset accuracy threshold is determined in advance based on the sample semantic distance between the pre-training data set and the task data set, in the process of training the pre-trained network model based on the preset accuracy threshold, the training stopping time of the pre-trained network model can be based on, and thus the model performance of the pre-trained network model can be controlled within a smaller model accuracy in response to the increase of the sample semantic distance, to ensure higher model migration performance; at the same time, the model performance of the pre-trained network model can be controlled within a larger model accuracy in response to the decrease of the sample semantic distance, to ensure higher model migration performance.

[0013] In some embodiments, the determining the preset accuracy threshold based on the sample semantic distance comprises: determining a first threshold for controlling the number of parameter updates of the feature extraction layer based on the sample semantic distance; and the determining whether the accuracy of the pre-trained network model reaches the preset accuracy threshold comprises: obtaining the number of updates of the network parameters of the feature extraction layer, and determining whether the accuracy of the pre-trained network model reaches the preset accuracy threshold based on the number of updates and the first threshold.

[0014] In some embodiments, the determining the preset accuracy threshold based on the sample semantic distance comprises: determining a second threshold for controlling the convergence of the loss value based on the sample semantic distance; and the determining whether the accuracy of the pre-trained network model reaches the preset accuracy threshold comprises: determining whether the accuracy of the pre-trained network model reaches the preset accuracy threshold based on the loss value and the second threshold.

[0015] In some embodiments, the training of the initial network model based on the task data set corresponding to the target task to obtain a target network model for processing the target task comprises: obtaining at least one functional module and a target loss function corresponding to the target task; constructing the initial network model based on the feature extraction layer and the at least one functional module; and training the initial network model based on the task data set, and obtaining the target network model in the case that the target loss function converges.

[0016] In some embodiments, the pre-trained network model further comprises a fully connected layer, and the multi-layer perceptron layer is located between the feature extraction layer and the fully connected layer; wherein the multi-layer perceptron layer comprises a non-linear calculation layer; and the non-linear calculation layer comprises at least one of a batch normalization layer and an activation layer.

[0017] In the second aspect, a data processing method is provided, comprising: obtaining to-be-processed data corresponding to a target task; inputting the to-be-processed data into a target network model for processing the target task to obtain a processing result output by the target network model; wherein the target network model is obtained by training an initial network model based on a task data set corresponding to the target task; the initial network model comprises a feature extraction layer of a pre-trained network model after training; the pre-trained network model is obtained by supervised pre-training based on a pre-training data set; the sample semantics of the task data set are different from those of the pre-training data set; and the pre-trained network model at least comprises a feature extraction layer and a multi-layer perceptron layer located after the feature extraction layer.

[0018] In some embodiments, the pre-trained network model after training reaches a preset accuracy threshold, the preset accuracy threshold is determined based on a sample semantic distance between the task data set and the pre-training data set, the sample semantic distance is inversely proportional to the preset accuracy threshold, and a loss function of the supervised pre-training is determined based on a constraint parameter, and the preset accuracy threshold is proportional to the constraint parameter.

[0019] In some embodiments, before the obtaining of the to-be-processed data corresponding to the target task, the method further comprises:

[0020] performing supervised pre-training on the pre-trained network model based on the pre-training data set to obtain a pre-trained network model after training;

[0021] training the initial network model based on the task data set corresponding to the target task to obtain a target network model for processing the target task.

[0022] In some embodiments, the supervised pre-training of the pre-trained network model based on the pre-training dataset comprises:

[0023] inputting a first sample data in the pre-training dataset into the pre-trained network model to obtain a predicted label of the first sample data output by the pre-trained network model;

[0024] determining a loss value based on the predicted label of the first sample data and a corresponding real label, and updating network parameters of the feature extraction layer based on the loss value until accuracy of the pre-trained network model reaches a preset accuracy threshold to obtain the trained pre-trained network model.

[0025] In some embodiments, before the supervised pre-training of the pre-trained network model based on the pre-training dataset, the method further comprises:

[0026] obtaining a sample semantic distance between the task dataset and the pre-training dataset;

[0027] determining the preset accuracy threshold based on the sample semantic distance; wherein the sample semantic distance is inversely proportional to the preset accuracy threshold.

[0028] In a third aspect, a model training apparatus is provided, comprising:

[0029] a first obtaining module configured to obtain a pre-trained network model; the pre-trained network model at least comprises a feature extraction layer and a multi-layer perceptron layer located after the feature extraction layer;

[0030] a first training module configured to perform supervised pre-training of the pre-trained network model based on a pre-training dataset to obtain a trained pre-trained network model;

[0031] a second training module configured to train an initial network model based on a task dataset corresponding to a target task to obtain a target network model for processing the target task; the initial network model comprises the feature extraction layer of the trained pre-trained network model, and the sample semantics in the task dataset is different from that in the pre-training dataset.

[0032] In a fourth aspect, a model training apparatus is provided, comprising:

[0033] a second obtaining module configured to obtain to-be-processed data corresponding to a target task;

[0034] a processing module configured to input the to-be-processed data into a target network model for processing the target task to obtain a processing result output by the target network model;

[0035] The target network model is obtained by training an initial network model based on a task data set corresponding to the target task; the initial network model comprises a feature extraction layer of a pre-trained network model after training; the pre-trained network model is obtained by supervised pre-training based on a pre-training data set; the task data set and samples in the pre-training data set are different in semantics; and the pre-trained network model at least comprises the feature extraction layer and a multi-layer perceptron layer after the feature extraction layer.

[0036] In a fifth aspect, a model training device is provided, which comprises a memory and a processor, the memory storing a computer program capable of running on the processor, and the processor implements the steps in the above method when executing the computer program.

[0037] In a sixth aspect, a computer storage medium is provided, which stores one or more programs capable of being executed by one or more processors to implement the steps in the above method.

[0038] In the embodiments of the present disclosure, after obtaining the pre-trained network model after training based on the pre-training data set, because the pre-trained network model adds a multi-layer perceptron layer after the feature extraction layer in the process of supervised pre-training, compared with the network model in the traditional supervised pre-training process, the feature extraction layer after training can ignore high-level features (semantic features) and focus on low-level features in the process of supervised training based on the pre-training data set, thereby providing a feature extraction layer with migration for subsequent processing of target tasks in different scenarios, and further accelerating the training efficiency of the initial network model and improving the model precision of the target network model. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1A A model training method provided by the embodiments of the present disclosure;

[0040] Figure 1B A model structure of a pre-trained network model provided by the embodiments of the present disclosure;

[0041] Figure 1C A network structure of an initial network model provided by the embodiments of the present disclosure;

[0042] Figure 2 A flowchart of a model training method provided by the embodiments of the present disclosure;

[0043] Figure 3 A flowchart of a model training method provided by the embodiments of the present disclosure;

[0044] Figure 4A flowchart of a model training method provided by an embodiment of the present disclosure is shown in FIG. 1.

[0045] Figure 5 A flowchart of a model training method provided by an embodiment of the present disclosure is shown in FIG. 1.

[0046] Figure 6 A flowchart of a model training method provided by an embodiment of the present disclosure is shown in FIG. 1.

[0047] Figure 7 A flowchart of a data processing method provided by an embodiment of the present disclosure is shown in FIG. 1.

[0048] Figure 8 A flowchart of a data processing method provided by an embodiment of the present disclosure is shown in FIG. 1.

[0049] Figure 9 A schematic diagram of a staged migratability evaluation network structure provided by an embodiment of the present disclosure is shown in FIG. 1.

[0050] Figure 10A A schematic diagram of a pre-training method provided by an embodiment of the present disclosure is shown in FIG. 1.

[0051] Figure 10B A schematic diagram of a pre-training method provided by an embodiment of the present disclosure is shown in FIG. 1.

[0052] Figure 11A A schematic diagram of a supervised pre-training in the related art is shown in FIG. 1.

[0053] Figure 11B A schematic diagram of a supervised pre-training provided by an embodiment of the present disclosure is shown in FIG. 1.

[0054] Figure 12 A schematic diagram of a pre-training method provided by an embodiment of the present disclosure is shown in FIG. 1.

[0055] Figure 13 A schematic diagram of the influence of the semantic distance between a pre-training dataset and a validation dataset on model migration performance provided by an embodiment of the present disclosure is shown in FIG. 1.

[0056] Figure 14 A schematic diagram of the composition structure of a model training apparatus provided by an embodiment of the present disclosure is shown in FIG. 1.

[0057] Figure 15 A schematic diagram of the composition structure of a data processing apparatus provided by an embodiment of the present disclosure is shown in FIG. 1.

[0058] Figure 16 A schematic diagram of the hardware entity of a model training device provided by an embodiment of the present disclosure is shown in FIG. 1. DETAILED DESCRIPTION

[0059] The technical solutions of the present disclosure will be described in detail below by way of examples and in conjunction with the drawings. The following specific examples can be combined with each other, and the same or similar concepts or processes can not be described again in some examples.

[0060] It should be noted that in the examples of the present disclosure, "first", "second", etc. are used to distinguish similar objects, and do not necessarily describe the order or sequence of the target. In addition, the technical solutions described in the embodiments of the present disclosure can be combined arbitrarily without conflict.

[0061] Before further detailing the embodiments of the present disclosure, the terms and terms involved in the embodiments of the present disclosure are explained, and the terms and terms involved in the embodiments of the present disclosure are applicable to the following explanations.

[0062] 1) Machine learning is a multi-disciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. Machine learning is a branch of computer science that studies how computers simulate or implement human learning behavior to acquire new knowledge or skills, reorganize existing knowledge structure to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental approach to making computers intelligent, and its applications are widespread in various fields of artificial intelligence. Machine learning and deep learning usually include: artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.

[0063] 2) Pre-training: Pre-training is the training of a language model through a large number of unannotated language texts, obtaining a set of model parameters, initializing the model using this set of parameters, and then fine-tuning the existing language model according to the task to be implemented. The method of pre-training has been proven to have better results in classification and labeling tasks in natural language processing. Currently, popular pre-training methods include ELMo (Embeddings from Language Models), OpenAI GPT (a language model) and BERT (Bidirectional Encoder Representations from Transformers).

[0064] 3) Unsupervised learning, according to the class unknown (not labeled) training samples to solve various problems in pattern recognition. Unsupervised learning algorithms include principal component analysis, isometric mapping, local linear embedding, etc.

[0065] 4) supervised learning, the process of adjusting the parameters of a classifier to achieve the required performance using a set of samples of known classes. In supervised learning, each instance consists of an input object (usually a vector) and a desired output value (also called a supervisory signal). Supervised learning algorithms analyze this training data and produce a function that can be used to map new instances.

[0066] The following describes an exemplary application of the electronic device provided by the embodiments of the present disclosure. The electronic device provided by the embodiments of the present disclosure can be implemented as a notebook computer, a tablet computer, a desktop computer, a set-top box, a mobile device (for example, a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable game device) and various types of user terminals (hereinafter referred to as terminals) and can also be implemented as a server.

[0067] Referring to Figure 1A , Figure 1A is an optional flowchart of the model training method provided by the embodiments of the present disclosure, which will be described in combination with the steps shown in Figure 1A .

[0068] S101, obtaining a pre-trained network model; the pre-trained network model at least includes a feature extraction layer and a multi-layer perceptron layer located after the feature extraction layer.

[0069] In some embodiments, the network structure of the pre-trained network model can be as shown in Figure 1B , which can include the feature extraction layer B10 and the multi-layer perceptron layer B11 connected with the feature extraction layer B10, wherein the feature extraction layer is used to extract the bottom features of the output data. In some embodiments, a corresponding classifier layer B12 can also be arranged after the multi-layer perceptron layer B11.

[0070] In some embodiments, the feature extraction layer can be a resnet network.

[0071] S102, supervised pre-training the pre-trained network model based on a pre-training data set to obtain a trained pre-trained network model.

[0072] In some embodiments, the pre-training data set includes a plurality of first sample data, and each first sample data carries a corresponding true label.

[0073] In combination with the Figure 1BIn the process of supervised pre-training of the pre-training network model based on the pre-training data set, each first sample data can be input to the feature extraction layer B10 in turn, and a first intermediate feature output by the feature extraction layer can be obtained; the first intermediate feature can be input to the multi-layer perceptron layer B11, and a predicted label corresponding to the first sample data can be obtained. Based on the predicted label and a real label corresponding to the first sample data, and by using a preset pre-training loss function, a loss value corresponding to the first sample data is calculated, and then the network parameters in the pre-training network model are updated. The pre-training loss function can be, but is not limited to, a cross-entropy loss function, a softmax loss function, and the like.

[0074] In some embodiments, in the process of supervised pre-training of the pre-training network model based on the pre-training data set, at least the network parameters in the feature extraction layer are updated; in other embodiments, the network parameters of the feature extraction layer and the network parameters of other network structures (such as the multi-layer perceptron layer) in the pre-training network model other than the feature extraction layer can also be updated at the same time.

[0075] In this embodiment, the network parameters of the feature extraction layer in the obtained trained pre-training network model have been updated, that is, the trained feature extraction layer is obtained, compared with the pre-training network model that has not been trained.

[0076] S103, training an initial network model based on a task data set corresponding to a target task to obtain a target network model for processing the target task; the initial network model includes a feature extraction layer of the trained pre-training network model, and the sample semantics of the sample data in the task data set are different from the sample semantics of the sample data in the pre-training data set.

[0077] In some embodiments, the sample semantics of the sample data in the pre-training data set are different from the sample semantics of the sample data in the task data set. For example, in the case where the pre-training data set is a data set including biological category sample data, the task data set corresponding to the target task is a data set including non-biological category sample data, for example, a data set including tool category sample data or a data set including building category sample data.

[0078] In some embodiments, the network structure of the initial network model can be as follows Figure 1CAs shown, the feature extraction layer B10 and the target task module C11 can be included. Different target task modules C11 can be set according to different target tasks. For example, the target task module C11 can be a classification module when the target task is a classification task, and the target task module C11 can be a segmentation module when the target task is a segmentation task.

[0079] In some embodiments, after obtaining the trained pre-training network model trained based on the pre-training data set, since the pre-training network model adds a multi-layer perceptron layer after the feature extraction layer in the process of supervised pre-training, compared with the network model in the traditional supervised pre-training process, the trained feature extraction layer can ignore high-level features (semantic features) and focus on low-level features in the process of supervised training based on the pre-training data set, thereby providing a feature extraction layer with migratory ability for subsequent processing of different scene target tasks, and further accelerating the training efficiency of the subsequent initial network model and improving the model precision of the target network model.

[0080] Referring to Figure 2 , Figure 2 is an optional flowchart of a model training method provided by the embodiments of the present disclosure, based on Figure 1A After S101, the method further includes S201 and S202, and S102 can be updated to S203, which will be described in combination with Figure 2 the steps shown.

[0081] S201, obtaining a sample semantic distance between the task data set and the pre-training data set.

[0082] In some embodiments, the category corresponding to the task data set and the category corresponding to the pre-training data set are mutually exclusive. That is, the category to which the task data set belongs in the ImageNet data set and the category to which the pre-training data set belongs in the ImageNet data set are mutually exclusive. The ImageNet data set is an image database organized according to the WordNet hierarchy, where each node of the hierarchy corresponds to a category, and the categories corresponding to different nodes are mutually exclusive.

[0083] For example, based on the hierarchy in WordNet, the ImageNet-21K can be divided into six types of specialized data sets with different semantic distances. In the case that the category of the task data set is the first category, the specialized data set of other categories except the first category can be selected from the above six types of specialized data sets as the pre-training data set.

[0084] In some embodiments, the sample semantic distance between the task dataset and the pre-training dataset can be obtained by S2011 to S2013.

[0085] S2011, extracting a first semantic feature corresponding to at least one first sample data in the task dataset.

[0086] In some embodiments, the sample semantic feature of the at least one first sample data can be extracted by the pre-trained semantic extraction model, to obtain the sample semantic feature corresponding to each first sample data, and the sample semantic feature corresponding to each first sample data obtained is fused to obtain the first semantic feature corresponding to the at least one sample data.

[0087] In some embodiments, the sample semantic feature of the at least one first sample data can be extracted by the pre-trained semantic extraction model, to obtain the sample semantic feature corresponding to each first sample data, and the sample semantic feature corresponding to each first sample data obtained is fused to obtain the first semantic feature corresponding to the at least one sample data.

[0088] S2012, extracting a second semantic feature corresponding to at least one second sample data in the pre-training dataset.

[0089] In some embodiments, the sample semantic feature of the at least one second sample data can be extracted by the pre-trained semantic extraction model, to obtain the sample semantic feature corresponding to each second sample data, and the sample semantic feature corresponding to each second sample data obtained is fused to obtain the second semantic feature corresponding to the at least one sample data.

[0090] In some embodiments, the sample semantic feature of the at least one second sample data can be extracted by the pre-trained semantic extraction model, to obtain the sample semantic feature corresponding to each second sample data, and the sample semantic feature corresponding to each second sample data obtained is fused to obtain the second semantic feature corresponding to the at least one sample data.

[0091] It should be noted that the task dataset can include a plurality of first sample data, and the pre-training dataset can include a plurality of second sample data; the number of first sample data in the task dataset can be the same as or different from the number of second sample data in the pre-training dataset; accordingly, the at least one first sample data can be all or part of the task dataset, and the at least one second sample data can be all or part of the pre-training dataset.

[0092] In some embodiments, the pre-trained semantic extraction model can be a bert model.

[0093] S2013, determine the sample semantic distance based on the first semantic feature and the second semantic feature.

[0094] In some embodiments, at least one of the following distance calculation methods can be employed to determine the feature distance between the first semantic feature and the second semantic feature, and the feature distance is taken as the sample semantic distance. The distance calculation methods include: cosine distance calculation method, Euclidean distance calculation method, etc.

[0095] S202, determine the preset accuracy threshold based on the sample semantic distance; wherein the sample semantic distance is inversely proportional to the preset accuracy threshold.

[0096] S203, perform supervised pre-training on the pre-training network model based on a pre-training data set to obtain a trained pre-training network model; the accuracy of the trained pre-training network model reaches the preset accuracy threshold.

[0097] In some embodiments, the model accuracy of the pre-training network model is used to represent the model performance of the pre-training network model. The higher the model accuracy, the higher the model performance of the pre-training network model; the lower the model accuracy, the lower the model performance of the pre-training network model.

[0098] In this embodiment, the preset accuracy threshold is the training stopping condition in the supervised pre-training process, that is, the training is stopped when the model accuracy of the pre-training network model reaches the preset accuracy threshold; the training is continued when the model accuracy of the pre-training network model does not reach the preset accuracy threshold. Therefore, the higher the preset accuracy threshold, the higher the model performance of the obtained pre-training network model.

[0099] Wherein, the model performance can be embodied by model prediction accuracy. The higher the accuracy of the pre-training network model in the pre-training data set, the better the model performance of the pre-training network model can be considered; the lower the accuracy of the pre-training network model in the pre-training data set, the worse the model performance of the pre-training network model can be considered.

[0100] In this embodiment, the sample semantic distance can be inversely proportional to the preset accuracy threshold, that is, the larger the sample semantic distance, the smaller the preset accuracy threshold, and correspondingly, the lower the model accuracy of the pre-training network model obtained in the pre-training process, the worse the model performance of the pre-training network model; and the smaller the sample semantic distance, the larger the preset accuracy threshold, and correspondingly, the higher the model accuracy of the pre-training network model obtained in the pre-training process, the better the model performance of the pre-training network model.

[0101] Reference Figure 3 , Figure 3This is an optional flowchart illustrating the model training method provided in this embodiment of the disclosure, based on... Figure 2 , Figure 2 S203 in the middle can be updated to S301 to S302, which will combine Figure 3 The steps shown are explained.

[0102] S301. Input the first sample data in the pre-trained dataset into the pre-trained network model to obtain the predicted label of the first sample data output by the pre-trained network model.

[0103] In some embodiments, during the supervised pre-training process, each sample data in the pre-training dataset can be sequentially input into the pre-training network model to train the pre-training network model until a preset training stopping condition is met. Specifically, for each first sample data, after inputting the first sample data into the pre-training network model, the predicted label output by the pre-training network model for that first sample data can be obtained.

[0104] S302. Determine constraint parameters based on the preset accuracy threshold, and generate a pre-training loss function based on the constraint parameters; the preset accuracy threshold is proportional to the constraint parameters.

[0105] In some embodiments, the pre-training loss function used in supervised pre-training can be determined by the preset accuracy threshold. The pre-training loss function can be a softmax loss, expressed as in equation (1):

[0106]

[0107] Where L is the pre-training loss function, i represents the i-th first sample data, j represents the j-th class, C is the total number of classes, N is the number of first sample data in the pre-training dataset, m is the constraint parameter, and z i Let y be the feature vector of the i-th first sample data. i Let i be the true label of the i-th first sample data. For y i The cosine of the angle between the weight vector corresponding to this category and the feature vector of the i-th first sample data; Let be the cosine of the angle between the weight vector corresponding to the j-th category and the feature vector of the i-th first sample data, and let β be a preset scaling factor. It can be seen that this pre-training loss function is determined by the constraint parameters.

[0108] In some embodiments, the preset accuracy threshold is proportional to the constraint parameter; that is, the higher the preset accuracy threshold, the larger the constraint parameter; and the lower the preset accuracy threshold, the smaller the constraint parameter.

[0109] S303, determine a loss value based on the pre-training loss function, the predicted label of the first sample data, and the corresponding real label, and update the network parameters of the feature extraction layer based on the loss value until the pre-training loss function converges, to obtain the trained pre-training network model.

[0110] The feature extraction layer of the trained pre-training network model is inversely proportional to the constraint parameter with respect to the feature distance of the intra-class sample data.

[0111] In the embodiments of the present disclosure, since the preset accuracy threshold is pre-determined based on the sample semantic distance between the pre-training data set and the task data set, during the training of the pre-training network model, the pre-training loss function can be determined based on the preset accuracy threshold, and the pre-training network model can be trained based on the current obtained pre-training loss function, so that the feature extraction layer of the trained pre-training network model is inversely proportional to the constraint parameter with respect to the feature distance of the intra-class sample data, that is, the model performance of the pre-training network model can be controlled within a smaller model accuracy in response to the increase of the sample semantic distance, to ensure higher model migration performance; at the same time, the model performance of the pre-training network model can be controlled within a larger model accuracy in response to the decrease of the sample semantic distance, to ensure higher model migration performance.

[0112] Referring to Figure 4 , Figure 4 is an optional flowchart of the model training method provided by the embodiments of the present disclosure, based on Figure 2 , Figure 2 S203 in the above embodiment can be updated to S401-S402, which will be described in combination with the steps shown in Figure 4 .

[0113] S401, input the first sample data in the pre-training data set into the pre-training network model to obtain the predicted label of the first sample data output by the pre-training network model.

[0114] In some embodiments, during the supervised pre-training, each sample data in the pre-training data set can be sequentially input into the pre-training network model to train the pre-training network model until a preset training stop condition is met. Wherein, for each first sample data, after inputting the first sample data into the pre-training network model, the predicted label output by the pre-training network model for the first sample data can be obtained.

[0115] S402, determine a loss value based on the predicted label of the first sample data and the corresponding real label, and update the network parameter of the feature extraction layer based on the loss value until the accuracy of the pre-training network model reaches a preset accuracy threshold, to obtain the trained pre-training network model.

[0116] In some embodiments, since the current pre-training process is supervised pre-training, each first sample data carries a corresponding real label. After obtaining the predicted label of the first sample data in S401, the predicted label and the real label can be input into the loss function corresponding to the pre-training process to obtain a corresponding loss value, and the network parameter of the feature extraction layer is updated based on the loss value until the accuracy of the pre-training network model reaches a preset accuracy threshold, to obtain the trained pre-training network model.

[0117] In some embodiments, the above-mentioned updating of the network parameter of the feature extraction layer based on the loss value until the accuracy of the pre-training network model reaches a preset accuracy threshold, to obtain the trained pre-training network model can be implemented through S4021 to S4022.

[0118] S4021, update the network parameter of the feature extraction layer based on the loss value, and determine whether the accuracy of the pre-training network model reaches a preset accuracy threshold.

[0119] S4022, continue training in the case where the accuracy of the pre-training network model does not reach the preset accuracy threshold, and use the pre-training network model as the trained pre-training network model in the case where the accuracy of the pre-training network model reaches the preset accuracy threshold.

[0120] In the embodiments of the present disclosure, since the preset accuracy threshold is determined in advance based on the sample semantic distance between the pre-training data set and the task data set, in the process of training the pre-training network model based on the preset accuracy threshold, the training stopping time of the pre-training network model can be used to control the model performance of the pre-training network model within a smaller model accuracy in response to the increase of the sample semantic distance, so as to ensure higher model migration performance, and at the same time, the model performance of the pre-training network model can be controlled within a larger model accuracy in response to the decrease of the sample semantic distance, so as to ensure higher model migration performance.

[0121] Referring to Figure 5 , Figure 5 is an optional flowchart of a model training method provided by the embodiments of the present disclosure, based on Figure 4 , Figure 4 S202 in the above-mentioned S201 can be updated to S501, and S4021 can be updated to S502. The above-mentioned S202 will be described in combination with Figure 5The steps shown are described.

[0122] S501, based on the sample semantic distance, determine a first threshold value for controlling the number of parameter updates of the feature extraction layer.

[0123] In some embodiments, the model accuracy of the pre-trained network model can be controlled by controlling the number of parameter updates in the pre-training process, wherein the higher the number of parameter updates, the higher the model accuracy of the corresponding pre-trained network model; the lower the number of parameter updates, the lower the model accuracy of the corresponding pre-trained network model.

[0124] The first threshold value is used to control the number of parameter updates of the feature extraction layer. The larger the sample semantic distance, the smaller the model accuracy of the pre-trained network model that needs to be controlled, and the corresponding first threshold value is also relatively low. The smaller the sample semantic distance, the higher the model accuracy of the pre-trained network model that needs to be controlled, and the corresponding first threshold value is also relatively high.

[0125] In some embodiments, the first threshold value corresponding to the sample semantic distance can be determined by a pre-set first mapping table. For example, if there is a first semantic distance and a second semantic distance, and the first semantic distance is greater than the second semantic distance, the first threshold value determined based on the first semantic distance should be less than the first threshold value determined based on the second semantic distance.

[0126] S502, obtain the number of updates of the network parameters of the feature extraction layer, and based on the number of updates and the first threshold value, determine whether the accuracy of the pre-trained network model reaches a pre-set accuracy threshold value.

[0127] In some embodiments, in the process of training the pre-trained network model based on the current first sample data, the number of updates of the network parameters of the current feature extraction layer is obtained, and based on the number of updates and the first threshold value, in the case that the number of updates is less than the first threshold value, it indicates that the model accuracy of the pre-trained network model in the current training process has not reached the pre-set accuracy threshold value, and needs to be further trained; in the case that the number of updates reaches the first threshold value, it indicates that the model accuracy of the pre-trained network model in the current training process has reached the pre-set accuracy threshold value, and the training is stopped, and the pre-trained network model is taken as the trained pre-trained network model.

[0128] Referring to Figure 6 , Figure 6 is an optional flow diagram of a model training method provided by the embodiments of the present disclosure, based on Figure 4 , Figure 4 S202 in the above embodiment can be updated to S601, and S4021 can be updated to 602. The steps shown will be described in combination with Figure 6 ​

[0129] S601, determining a second threshold value for controlling the convergence of the loss value based on the sample semantic distance.

[0130] In some embodiments, the model accuracy of the pre-training network model can be controlled by controlling the convergence of the loss value in the pre-training process, wherein the smaller the second threshold value of the loss value convergence is, the higher the model accuracy of the corresponding pre-training network model is; the larger the second threshold value of the loss value convergence is, the lower the model accuracy of the corresponding pre-training network model is.

[0131] The first threshold value is used to control the convergence of the loss value, and the larger the sample semantic distance is, the smaller the model accuracy of the pre-training network model needs to be controlled, and the corresponding second threshold value is also relatively larger; the smaller the sample semantic distance is, the higher the model accuracy of the pre-training network model needs to be controlled, and the corresponding second threshold value is also relatively smaller.

[0132] In some embodiments, the second threshold value corresponding to the sample semantic distance can be determined by a pre-set second mapping table. For example, if there are a first semantic distance and a second semantic distance, and the first semantic distance is greater than the second semantic distance, the second threshold value determined based on the first semantic distance should be greater than the second threshold value determined based on the second semantic distance.

[0133] S602, determining whether the accuracy of the pre-training network model reaches a pre-set accuracy threshold value based on the loss value and the second threshold value.

[0134] In some embodiments, in the process of training the pre-training network model based on the current first sample data, the loss value corresponding to the first sample data is obtained, and in the case that the loss value is greater than the second threshold value, it indicates that the model accuracy of the pre-training network model in the current training process has not reached the pre-set accuracy threshold value, and the training needs to be continued; in the case that the loss value is less than the second threshold value, it indicates that the model accuracy of the pre-training network model in the current training process has reached the pre-set accuracy threshold value, and the training is stopped, and the pre-training network model is taken as the trained pre-training network model.

[0135] Referring to Figure 7 , Figure 7 is an optional flow diagram of a model training method provided by the embodiments of the present disclosure, based on any of the above embodiments, based on Figure 1A for example, Figure 1A S103 in the above embodiment can be implemented by S701 to S703, which will be described in combination with the steps shown in Figure 7 .

[0136] S701, obtaining at least one function module corresponding to the target task and a target loss function.

[0137] In some embodiments, the target task can be a classification task, an object recognition task, a segmentation task, etc., and the present disclosure is not limited in this regard. The function module can include at least one of a pooling module, a feature processing module, a full connection module, etc.

[0138] S702, constructing the initial network model based on the feature extraction layer and the at least one function module.

[0139] In some embodiments, the feature extraction layer in the trained pre-training network model described above can be acquired, and the at least one function module described above is sequentially connected after the feature extraction layer, and thus a corresponding initial network model is obtained. The connection relationship between the feature extraction network and the at least one function network model can be adjusted based on the task type of the target task, and the present disclosure is not limited in this regard.

[0140] S703, training the initial network model based on the task data set, and obtaining the target network model in the case where the target loss function converges.

[0141] In some embodiments, during the training of the initial network model based on the task data set, a supervised training method can be used, or an unsupervised training method can be used, and the present disclosure is not limited in this regard.

[0142] In some embodiments, during the training of the initial network model based on the task data set, the network parameters of the feature extraction layer can be fixed, and only the at least one function module in the initial network model is trained.

[0143] In some embodiments, during the training of the initial network model based on the task data set, the network parameters of the feature extraction layer can also not be fixed, and the feature extraction layer and the at least one function module in the initial network model are trained at the same time.

[0144] Referring to Figure 8 , Figure 8 is an optional flowchart of a data processing method provided by an embodiment of the present disclosure, which will be described in combination with the steps shown in Figure 8 .

[0145] S801, acquiring target task corresponding to the data to be processed.

[0146] S802, input the to-be-processed data into a target network model corresponding to the target task to obtain a processing result output by the target network model; wherein the target network model is obtained by training an initial network model based on a task data set corresponding to the target task; the initial network model comprises a feature extraction layer of a pre-trained network model after training; the pre-trained network model is obtained by supervised pre-training based on a pre-training data set; the task data set and samples in the pre-training data set are different in semantics; the pre-trained network model at least comprises the feature extraction layer and a multi-layer perceptron layer after the feature extraction layer.

[0147] In some embodiments, before the to-be-processed data corresponding to the target task is obtained, the method further comprises: performing supervised pre-training on the pre-trained network model based on the pre-training data set to obtain a pre-trained network model after training; and training the initial network model based on a task data set corresponding to the target task to obtain a target network model for processing the target task.

[0148] In some embodiments, the supervised pre-training of the pre-trained network model based on the pre-training data set to obtain the pre-trained network model after training comprises: inputting first sample data in the pre-training data set into the pre-trained network model to obtain a predicted label of the first sample data output by the pre-trained network model; determining a constraint parameter based on the preset accuracy threshold, and generating a pre-training loss function based on the constraint parameter; the preset accuracy threshold is directly proportional to the constraint parameter; determining a loss value based on the pre-training loss function, the predicted label of the first sample data and a corresponding real label, and updating network parameters of the feature extraction layer based on the loss value until the pre-training loss function converges, to obtain the pre-trained network model after training; wherein the feature extraction layer of the pre-trained network model after training is inversely proportional to the constraint parameter with respect to the feature distance of the intra-class sample data.

[0149] In some embodiments, the supervised pre-training of the pre-trained network model based on the pre-training data set to obtain the pre-trained network model after training comprises: inputting first sample data in the pre-training data set into the pre-trained network model to obtain a predicted label of the first sample data output by the pre-trained network model; determining a loss value based on the predicted label of the first sample data and a corresponding real label, and updating network parameters of the feature extraction layer based on the loss value until the accuracy of the pre-trained network model reaches a preset accuracy threshold, to obtain the pre-trained network model after training.

[0150] In some embodiments, before the pre-training network model is supervised pre-trained based on the pre-training dataset, the method further comprises: obtaining a sample semantic distance between the task dataset and the pre-training dataset; determining the preset accuracy threshold based on the sample semantic distance; wherein the sample semantic distance is inversely proportional to the preset accuracy threshold.

[0151] In some embodiments, the accuracy of the trained pre-training network model reaches a preset accuracy threshold, the preset accuracy threshold is determined based on a sample semantic distance between the task dataset and the pre-training dataset, and the sample semantic distance is inversely proportional to the preset accuracy threshold; the loss function of the supervised pre-training is determined based on a constraint parameter, and the preset accuracy threshold is proportional to the constraint parameter.

[0152] In the process of the above supervised pre-training based on the pre-training dataset to obtain the trained pre-training network model, the first sample data in the pre-training dataset can be input into the pre-training network model to obtain the predicted label of the first sample data output by the pre-training network model; a constraint parameter is determined based on the preset accuracy threshold, and a pre-training loss function is generated based on the constraint parameter; the preset accuracy threshold is proportional to the constraint parameter; a loss value is determined based on the pre-training loss function, the predicted label of the first sample data, and the corresponding real label, and the network parameters of the feature extraction layer are updated based on the loss value until the pre-training loss function converges, to obtain the trained pre-training network model; wherein the feature extraction layer of the trained pre-training network model is inversely proportional to the feature distance of the intra-class sample data. Thus, as the sample semantic distance increases, the preset accuracy threshold and the constraint parameter decrease, and the feature extraction layer of the pre-training network model trained by the loss function corresponding to the constraint parameter has an increased feature distance for intra-class sample data.

[0153] In the embodiments of the present disclosure, after obtaining the trained pre-training network model trained based on the pre-training dataset, because the pre-training network model adds a multi-layer perceptron layer after the feature extraction layer in the process of supervised pre-training, compared with the network model in the traditional supervised pre-training process, the trained feature extraction layer can ignore high-level features (semantic features) and focus on low-level features in the process of supervised training based on the pre-training dataset, thereby providing a feature extraction layer with migratory ability for subsequent processing of different target tasks, and further accelerating the training efficiency of the subsequent initial network model and improving the model accuracy of the target network model.

[0154] In the following, an exemplary application of the embodiments of the present application in an actual application scenario will be described.

[0155] Existing deep learning computer vision solutions often follow the engineering solution of "pre-training first, fine-tuning later", various training methods are pre-trained on large data sets, and then additional parameter fine-tuning is performed on the target task data set. However, due to the semantic gap between the two data sets, the performance on the target task data set is often weaker than its performance on the pre-training data set, that is, there is a decline in transfer ability. Different pre-training methods bring different transfer ability decline to the target task. Analyzing the factors that affect the transfer ability in the pre-training process can further guide the design of more robust pre-training methods for various target tasks.

[0156] In related technologies, some unsupervised pre-training methods show better transfer performance than supervised pre-training, but there is no in-depth analysis of the key modules that play a key role, but simply attribute the reason to the following two points: (1) Reducing the semantic interference from the labeled information in the pre-training data set during fine-tuning; (2) The contrast loss in the unsupervised pre-training method makes the pre-training network model learn more low-level information, rather than high-level semantic information. However, these two reasons cannot fully explain the phenomenon that the unsupervised pre-training network model has good transfer ability. For example, supervised contrast learning and clustering-based unsupervised methods also show good transfer ability.

[0157] Based on the above problems, the inventors found that, compared with supervised pre-training methods, multilayer perceptron provides better transfer performance for unsupervised pre-training methods. The following will analyze the reasons for the difference in transfer ability between supervised and unsupervised pre-training methods.

[0158] In the first aspect, the inventors analyze the transfer ability of supervised and unsupervised pre-training methods by constructing a concept generalization task. The concept generalization task refers to dividing two data sets that are mutually exclusive in semantics and analogy according to the hierarchical structure of wordnet (for example, a pre-training set mainly containing biological categories, and a validation set mainly containing tool categories) on ImageNet1K. The feature extraction layer is first trained on the pre-training set, and then the network parameters of the feature extraction layer are fixed. The parameters of different stages in the feature extraction layer are used to train a linear classifier on the validation set to test the transfer performance.

[0159] First, based on the hierarchical structure of WordNet, ImageNet-21K is divided into six proprietary datasets with different semantic distances. Two classes are randomly selected, one for pre-training and the other for evaluation. Without sacrificing generality, the inventors constructed a smaller pre-training dataset (pre-D) and evaluation dataset (eval-D) based on ImageNet-1K to reduce the experimental burden. For example, Pre-D contains 652 classes, mainly biological entities, while eval-D contains 348 other classes of tools.

[0160] Secondly, in order to evaluate the transferability of the backbone network, i.e. the aforementioned feature extraction layer, after training the pre-trained network model based on the pre-trained dataset (pre-D), the network parameters of the feature extraction layer are fixed, and the transfer performance at different stages is evaluated based on the evaluation dataset (eval-D).

[0161] like Figure 9 As shown, a phased transferability evaluation network structure 90 is illustrated. In this network structure 90, input data 91, feature extraction layer 92, and overall classifier 93 are included. In order to evaluate the transferability of different stages in feature extraction layer 92, this embodiment sets a stage classifier after each stage. Specifically, a first stage classifier 921 can be set after the first stage, a second stage classifier 922 can be set after the second stage, a third stage classifier 923 can be set after the third stage, a fourth stage classifier 924 can be set after the fourth stage, and a fifth stage classifier 925 can be set after the fifth stage.

[0162] In this embodiment, the stage classifier corresponding to each stage is used to evaluate the transferability of the feature extraction layer in the current stage.

[0163] To analyze the transferability of supervised and unsupervised pre-training schemes, the inventors validated relevant supervised pre-training methods (SL) and representative unsupervised pre-training methods (Mocov1, Mocov2, Byol) within the aforementioned staged transferability evaluation network structure 90. For each pre-training method, based on the aforementioned pre-training dataset (pre-D), the pre-trained network model corresponding to each pre-training method was trained. The network parameters of the feature extraction layer were then fixed to complete the pre-training process. Subsequently, based on the evaluation dataset (eval-D), the stage classifier corresponding to each stage was further trained to obtain the classification accuracy of the stage classifier for each stage, thereby obtaining the transferability corresponding to each stage. The higher the classification accuracy for a stage, the stronger the transferability of the feature extraction layer at that stage.

[0164] As an example of supervised pre-training, the supervised pre-training method is first used to pre-train the phase-migration evaluation network structure 90 based on the pre-training data set, and after the pre-training is completed, the network parameters of the feature extraction layer 92 are fixed. Then, based on the feature extraction layer 92, a corresponding phase classifier is set after each phase, and then the phase classifiers of different phases are trained based on the evaluation data set, and after the training is completed, the accuracy of the phase classifier corresponding to each phase is obtained. Based on this method, other unsupervised pre-training methods (Mocov1, Mocov2, Byol) are continuously evaluated, and the accuracy corresponding to each unsupervised pre-training method at each phase can be obtained.

[0165] Please refer to Figure 10A which shows a comparison diagram of the migration of the pre-training method at different stages. Among them, between the first stage and the fourth stage, the accuracy of the supervised pre-training on the evaluation data set is higher than that of each unsupervised pre-training (Mocov1, Mocov2, Byol). Then, at the fifth stage, it can be seen that the corresponding accuracy of the unsupervised pre-training Byol and Mocov2 still increases, while the corresponding accuracy of the supervised pre-training and the unsupervised pre-training Mocov1 decreases. That is, at the fifth stage, the migration of the unsupervised pre-training Byol and Mocov2 is still growing, while the migration of the supervised pre-training and the unsupervised pre-training Mocov1 decreases. After comparing the supervised pre-training method (SL) and the network architecture corresponding to each unsupervised pre-training method (Mocov1, Mocov2, Byol), the inventors found that the unsupervised pre-training Byol and Mocov2 inserted an MLP projection structure (MLP projector, corresponding to the multilayer perceptron layer in the above embodiment) after the fifth stage, while the supervised pre-training and the unsupervised pre-training Mocov1 did not have a corresponding MLP projection structure after the fifth stage. Therefore, the inventors put forward a new hypothesis that the MLP projection structure (MLP projector) may be the core factor of the higher migration of the unsupervised pre-training method.

[0166] In some embodiments, the basic MLP structure includes four parts: an input FC layer, a BN layer, a ReLU layer, and an output FC layer. The MLP structure is controlled by 2 parameters: the feature dimension of the hidden layer (default 4096), and the feature dimension of the output layer (default 256). Based on experiments, it is found that only FC layer cannot play a role, and when BN / ReLU nonlinear layer is introduced, the migration performance can be improved.

[0167] In a second aspect, to verify the above assumption that the MLP projector is a core factor of the high transferability of the unsupervised pre-training method, the inventors remove the MLP projector after the fifth stage of the unsupervised pre-training Byol and Mocov2, and meanwhile, add the MLP projector in the unsupervised pre-training Mocov1, to obtain a pre-training method at different stages, as shown in the transferability comparison diagram of the pre-training method at different stages. Figure 10B At the fifth stage, it can be seen that the accuracy of the unsupervised pre-training Byol (Byol w / o MLP) and Mocov2 (Mocov2 w / o MLP) without the MLP projector decreases, while the accuracy of the unsupervised pre-training Mocov1 (Mocov1 w / MLP) with the MLP projector still increases.

[0168] Therefore, the following conclusions can be obtained: (1) the MLP projector in the unsupervised learning method has better transferability than the unsupervised learning method without the MLP projector. For example, the Byol with the MLP projector has an accuracy 23.3% higher than the Byol (Byol w / o MLP) without the MLP projector; the Mocov1 (Mocov1 w / MLP) with the MLP projector has an accuracy 5.1% higher than the Mocov1 without the MLP projector; and the Mocov2 with the MLP projector has an accuracy 3.7% higher than the Mocov2 (Mocov2 w / o MLP) without the MLP projector. (2) In the transferability evaluation process from the fourth stage to the fifth stage in the feature extraction layer, the MLP projector can help the unsupervised learning method without the MLP projector to avoid the problem of transferability decline.

[0169] In a third aspect, based on the above conclusions, the inventors attempt to insert the MLP projector before the classifier in the supervised pre-training method to improve the transferability in the supervised pre-training. For ease of description, the supervised pre-training method with the MLP projector is denoted as SL-MLP.

[0170] Referring to Figure 11A , a supervised pre-training diagram in the related art is shown. First, the pre-training network model including the feature extraction layer and the classifier is trained based on the pre-training data set. When the loss function converges, the network parameters of the feature extraction layer are fixed, the functional module corresponding to the target task is combined to construct the initial network model processing the target task, the feature extraction layer and the functional module are trained based on the task data set, and after the loss function corresponding to the target task converges, the target network model processing the target task is obtained.

[0171] In the embodiments of the present disclosure, on the basis of the supervised pre-training method of the related art, an MLP projection structure is arranged after the feature extraction layer and before the classifier. Please refer to Figure 11B , which shows a supervised pre-training schematic diagram containing an MLP projection structure provided by the embodiments of the present disclosure. Wherein, the pre-training network model including the feature extraction layer, the MLP projection structure and the classifier is trained based on the pre-training data set, in the case of convergence of the loss function, the network parameters of the feature extraction layer are fixed, the function module corresponding to the target task is combined to construct the initial network model processing the target task, the feature extraction layer and the function module are trained based on the task data set, and after the loss function corresponding to the target task converges, the target network model capable of processing the target task is obtained.

[0172] Please refer to Figure 12 , which shows a migration comparison schematic diagram of the pre-training method at different stages. It can be seen that the accuracy of the supervised pre-training method containing the MLP projection structure (SL-MLP) at the first stage to the fourth stage is higher than that of the unsupervised pre-training method containing the MLP projection structure (Byol), that is, it inherits the advantage that the accuracy of the traditional supervised pre-training at the first stage to the fourth stage is higher than that of the unsupervised pre-training; at the same time, in the fifth stage, compared with the supervised pre-training method in the related art which does not contain the MLP projection structure, the accuracy of the supervised pre-training method containing the MLP projection structure (SL-MLP) does not decrease, on the contrary, it remains to increase.

[0173] The inventors analyze the reasons why the MLP projection structure affects the migration ability, and obtain the following conclusions: the model of the multi-layer perceptron increases the loose degree of the classes on the pre-training set, reduces the feature distribution distance between the pre-training data set and the task data set, and reduces the redundancy degree of the pre-training features.

[0174] In the fourth aspect, the inventors obtain the following conclusions after analyzing the above experiments: (1) if the performance on the pre-training data set exceeds a specific performance threshold, the migration ability of the model will decrease; (2) the greater the semantic difference between the pre-training data set and the validation data set (evaluation data set), the smaller the performance threshold.

[0175] Please refer to Figure 13 , which shows a schematic diagram of the influence of the semantic distance between the pre-training data set and the validation data set on the migration performance of the model.

[0176] The horizontal coordinate is a performance parameter of the model in the pre-training data set, and the vertical coordinate is a performance parameter of the model in the verification data set. The coordinate system represents the change of the model performance of the corresponding model in the verification data set with the increase of the model performance of the model in the pre-training data set. The curve X1 is the pre-training data set P1 and the verification data set E1 with the first semantic distance. When the model performance parameter of the pre-trained network model obtained in the process of pre-training the model based on the pre-training data set P1 is less than T1, with the improvement of the model performance in the pre-training process, the model performance of the corresponding target network model after migration is also improved. When the model performance parameter of the pre-trained network model obtained is greater than T1, with the improvement of the model performance in the pre-training process, the model performance of the corresponding target network model after migration is instead reduced.

[0177] The curve X2 is the pre-training data set P2 and the verification data set E2 with the second semantic distance. Based on the same reason, when the model performance parameter of the pre-trained network model obtained in the process of pre-training the model based on the pre-training data set P2 is less than T2, with the improvement of the model performance in the pre-training process, the model performance of the corresponding target network model after migration is also improved. When the model performance parameter of the pre-trained network model obtained is greater than T2, with the improvement of the model performance in the pre-training process, the model performance of the corresponding target network model after migration is instead reduced.

[0178] The second semantic distance corresponding to the curve X2 is less than the first semantic distance corresponding to the curve X2, and accordingly, the performance parameter threshold T2 corresponding to the curve X2 is greater than the performance parameter threshold T1 corresponding to the curve X1. Thus, the following conclusion can be drawn: the greater the semantic distance between the pre-training data set and the verification data set, the lower the model performance threshold in the corresponding pre-training process. That is, in the case that the semantic distance between the pre-training data set and the verification data set is small, the model performance threshold in the corresponding pre-training process is higher, that is, a higher model performance threshold can be set in the process of pre-training the model based on the pre-training data set. In the case that the semantic distance between the pre-training data set and the verification data set is large, the model performance threshold in the corresponding pre-training process is lower, that is, a lower model performance threshold can be set in the process of pre-training the model based on the pre-training data set. Further, the migratability of the model can be improved.

[0179] In some embodiments, a pre-trained BERT model can be used to predict the semantic distance between the pre-training dataset and the task dataset. Based on this semantic distance, a constraint parameter m for the loss function (softmax) is selected, where a larger semantic gap results in a smaller constraint parameter m, thus reducing the constraint on intra-classes. After obtaining the constraint parameter m, the model is trained on the pre-training dataset based on the loss function corresponding to the constraint parameter m. After training, the feature extraction layer is retained for practical applications on the task dataset.

[0180] In some embodiments, the relationship between the loss function and the constraint parameter m is as follows: (2)

[0181]

[0182] Where L is the pre-training loss function, i represents the i-th (first) sample data, j represents the j-th class, C is the total number of classes, N is the number of (first) sample data in the pre-training dataset, m is the constraint parameter, and z i Let y be the feature vector of the i-th (first) sample data. i Let i be the true label of the i-th (first) sample data. For y i The cosine of the angle between the weight vector corresponding to this category and the feature vector of the i-th (first) sample data; Let β be the cosine of the angle between the weight vector corresponding to the j-th category and the feature vector of the i-th (first) sample data, and let β be a preset scaling factor. It can be seen that this pre-training loss function is determined by the constraint parameters.

[0183] In this embodiment, the feature distance of the trained feature extraction layer for intra-class sample data is inversely proportional to the constraint parameter.

[0184] Figure 14 This is a schematic diagram of the composition structure of a model training device provided in an embodiment of the present disclosure, as shown below. Figure 9 As shown, the model training device 1400 includes: a first acquisition module 1401, used to acquire a pre-trained network model; the pre-trained network model includes at least a feature extraction layer and a multilayer perceptron layer located after the feature extraction layer; a first training module 1402, used to perform supervised pre-training on the pre-trained network model based on the pre-training dataset to obtain a trained pre-trained network model; and a second training module 1403, used to train the initial network model based on the task dataset corresponding to the target task to obtain a target network model for processing the target task; the initial network model includes the feature extraction layer of the trained pre-trained network model, and the semantics of the samples in the task dataset are different from those in the pre-training dataset.

[0185] In some embodiments, the trained pre-training network model reaches a preset accuracy threshold; the first training module 1402 is further configured to obtain a sample semantic distance between the task data set and the pre-training data set; determine the preset accuracy threshold based on the sample semantic distance; wherein the sample semantic distance is inversely proportional to the preset accuracy threshold.

[0186] In some embodiments, the first training module 1402 is further configured to: extract a first semantic feature corresponding to at least one first sample data in the task data set; extract a second semantic feature corresponding to at least one second sample data in the pre-training data set; and determine the sample semantic distance based on the first semantic feature and the second semantic feature.

[0187] In some embodiments, the first training module 1402 is further configured to: input the first sample data in the pre-training data set into the pre-training network model to obtain a predicted label of the first sample data output by the pre-training network model; determine a constraint parameter based on the preset accuracy threshold, and generate a pre-training loss function based on the constraint parameter; the preset accuracy threshold is proportional to the constraint parameter; determine a loss value based on the pre-training loss function, the predicted label of the first sample data, and the corresponding real label, and update the network parameters of the feature extraction layer based on the loss value until the pre-training loss function converges, to obtain the trained pre-training network model; wherein the feature extraction layer of the trained pre-training network model is inversely proportional to the constraint parameter for the feature distance of the intra-class sample data.

[0188] In some embodiments, the first training module 1402 is further configured to: input the first sample data in the pre-training data set into the pre-training network model to obtain a predicted label of the first sample data output by the pre-training network model; determine a loss value based on the predicted label of the first sample data and the corresponding real label, and update the network parameters of the feature extraction layer based on the loss value until the accuracy of the pre-training network model reaches a preset accuracy threshold, to obtain the trained pre-training network model.

[0189] In some embodiments, the first training module 1402 is further configured to: update the network parameters of the feature extraction layer based on the loss value, and determine whether the accuracy of the pre-training network model reaches a preset accuracy threshold; continue training if the accuracy of the pre-training network model does not reach the preset accuracy threshold; and use the pre-training network model as the trained pre-training network model if the accuracy of the pre-training network model reaches the preset accuracy threshold.

[0190] In some embodiments, the first training module 1402 is further configured to determine a first threshold for controlling a number of parameter updates of the feature extraction layer based on the sample semantic distance; and the first training module 1402 is further configured to determine whether the accuracy of the pre-trained network model reaches a preset accuracy threshold based on the number of parameter updates of the feature extraction layer and the first threshold.

[0191] In some embodiments, the first training module 1402 is further configured to determine a second threshold for controlling a convergence condition of the loss value based on the sample semantic distance; and the first training module 1402 is further configured to determine whether the accuracy of the pre-trained network model reaches a preset accuracy threshold based on the loss value and the second threshold.

[0192] In some embodiments, the first training module 1402 is further configured to include: obtaining at least one functional module corresponding to the target task and a target loss function; constructing the initial network model based on the feature extraction layer and the at least one functional module; and training the initial network model based on the task data set, to obtain the target network model in a case where the target loss function converges.

[0193] In some embodiments, the pre-trained network model further includes a fully connected layer, and the multi-layer perceptron layer is located between the feature extraction layer and the fully connected layer; wherein the multi-layer perceptron layer includes a non-linear calculation layer; and the non-linear calculation layer includes at least one of a batch normalization layer and an activation layer.

[0194] Figure 15 A component structure diagram of a data processing apparatus provided by an embodiment of the present disclosure is shown in FIG. 15. Figure 15 As shown in FIG. 15, the data processing apparatus 1500 includes: a second obtaining module 1501 configured to obtain to-be-processed data corresponding to a target task; and a processing module 1502 configured to input the to-be-processed data into a target network model for processing the target task, to obtain a processing result output by the target network model; wherein the target network model is obtained by training an initial network model based on a task data set corresponding to the target task; the initial network model includes a feature extraction layer of a pre-trained network model after training; the pre-trained network model is obtained by supervised pre-training based on a pre-training data set; the sample semantics in the task data set are different from those in the pre-training data set; and the pre-trained network model at least includes the feature extraction layer and a multi-layer perceptron layer located after the feature extraction layer.

[0195] In some embodiments, the data processing apparatus further comprises a training module. The training module is configured to: perform supervised pre-training on the pre-training network model based on the pre-training dataset to obtain a trained pre-training network model; and train the initial network model based on a task dataset corresponding to the target task to obtain a target network model for processing the target task.

[0196] In some embodiments, the training module is further configured to: input first sample data in the pre-training dataset into the pre-training network model to obtain predicted labels of the first sample data output by the pre-training network model; determine a loss value based on the predicted labels of the first sample data and corresponding real labels, and update network parameters of the feature extraction layer based on the loss value until accuracy of the pre-training network model reaches a preset accuracy threshold to obtain the trained pre-training network model.

[0197] In some embodiments, the training module is further configured to: obtain a sample semantic distance between the task dataset and the pre-training dataset; determine the preset accuracy threshold based on the sample semantic distance; and the sample semantic distance is inversely proportional to the preset accuracy threshold.

[0198] The above device embodiments are similar to the descriptions of the above method embodiments, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the device embodiments of the present disclosure, please refer to the description of the method embodiments of the present disclosure for understanding.

[0199] It should be noted that, in the embodiments of the present disclosure, if the model training method described above is realized in the form of a software function module and is sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a device to execute all or part of the methods of the embodiments of the present disclosure. The storage medium described above includes: a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various storage media that can store program codes. Thus, the embodiments of the present disclosure are not limited to any combination of hardware and software.

[0200] Figure 16 A hardware entity schematic diagram of a model training device provided in the embodiments of the present disclosure is shown in FIG. 1. Figure 16As shown, the hardware entities of the model training device 1600 include a processor 1601 and a memory 1602, where the memory 1602 stores a computer program executable on the processor 1601, and the processor 1601 implements the steps in the method of any of the above embodiments when executing the program.

[0201] The memory 1602 stores a computer program executable on the processor, and is configured to store instructions and applications executable by the processor 1601, and can also cache data (for example, image data, audio data, voice communication data and video communication data) to be processed by the processor 1601 and each module in the model training device 1600, which can be implemented by FLASH or RAM.

[0202] The processor 1601 implements the steps of the model training method of any of the above embodiments when executing the program. The processor 1601 generally controls the overall operation of the model training device 1600.

[0203] The embodiments of the present disclosure provide a computer storage medium, which stores one or more programs executable by one or more processors to implement the steps of the model training method of any of the above embodiments.

[0204] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects to the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present disclosure, please refer to the description of the method embodiments of the present disclosure for understanding.

[0205] The above processor can be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that the electronic device realizing the function of the above processor can also be other devices, and the embodiments of the present disclosure are not limited specifically.

[0206] The computer storage medium / memory can be a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Ferromagnetic Random Access Memory (FRAM), a Flash Memory, a magnetic surface storage, an optical disc, a Compact Disc Read-Only Memory (CD-ROM), or the like memory; or can be various terminals including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, and the like.

[0207] It should be understood that every technical feature mentioned in the specification refers to a target feature, structure or property related to the embodiment, which is included in at least one embodiment of the present disclosure. Therefore, the "in one embodiment" or "in an embodiment" or "in the embodiment of the present disclosure" or "in the foregoing embodiment" or "in some embodiments" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, the target features, structures or properties can be combined in one or more embodiments in any suitable manner. It should be understood that the size of the sequence number of each process in various embodiments of the present disclosure does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure. The sequence number of the above embodiments of the present disclosure is only for description, not representing the advantages and disadvantages of the embodiments.

[0208] Unless otherwise specified, the model training device performs any step in the embodiments of the present disclosure, which can be the processor of the model training device performing the step. Unless otherwise specified, the embodiments of the present disclosure do not limit the order of the steps performed by the model training device. In addition, the way of processing data in different embodiments can be the same method or different method. It should be noted that any step in the embodiments of the present disclosure can be independently executed by the model training device, that is, the model training device can execute any step in the above embodiments without depending on the execution of other steps.

[0209] In several embodiments provided by the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other manners. The embodiments described above are merely exemplary, and are not intended to limit the application. For example, the division of the units is merely logical function division, and there can be other division manners in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling, or direct coupling or communication connection between the components can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0210] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units; they can be located in one place, or distributed on a plurality of network units; and some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.

[0211] In addition, each functional unit in each embodiment of the present disclosure can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in the form of hardware, or in the form of hardware plus software functional units.

[0212] The disclosed methods in several method embodiments provided by the present disclosure can be combined arbitrarily without conflict, to obtain new method embodiments.

[0213] The disclosed features in several product embodiments provided by the present disclosure can be combined arbitrarily without conflict, to obtain new product embodiments.

[0214] The disclosed features in several method or device embodiments provided by the present disclosure can be combined arbitrarily without conflict, to obtain new method embodiments or device embodiments.

[0215] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instructions related to hardware, and the aforementioned program can be stored in a computer readable storage medium, and when the program is executed, the steps of the method embodiments are executed; and the aforementioned storage medium includes mobile storage devices, read only memory (ROM), magnetic or optical disks, and various media that can store program codes.

[0216] Alternatively, the above-mentioned integrated unit of the present disclosure, if implemented in the form of a software function module and sold or used as an independent product, can also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present disclosure can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes several instructions to cause a computer device (which can be a personal computer, a model training device, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present disclosure. The foregoing storage medium includes: a mobile storage device, a ROM, a magnetic disk, or an optical disk, and various media that can store program codes.

[0217] In the embodiments of the present disclosure, the same steps and the same content in different embodiments can be referred to each other. In the embodiments of the present disclosure, the term “and” does not affect the sequence of the steps.

[0218] The above is only an implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present disclosure, which should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims

1. A model training method, characterized in that, The method comprises: obtaining a pre-training network model; the pre-training network model comprises at least a feature extraction layer and a multi-layer perceptron layer located after the feature extraction layer; the multi-layer perceptron layer is used for inhibiting high-level semantic feature extraction and enhancing low-level feature migration; obtaining a sample semantic distance between a target task corresponding task image dataset and a pre-training image dataset; wherein the sample semantics of the task image dataset are different from those of the pre-training image dataset, and the categories corresponding to the task image dataset and the pre-training image dataset are mutually exclusive; the pre-training image dataset comprises biological category image data, and the task image dataset comprises tool category image data; determining a preset accuracy threshold based on the sample semantic distance; wherein the sample semantic distance is inversely proportional to the preset accuracy threshold; supervised pre-training the pre-training network model based on the pre-training image dataset to obtain a trained pre-training network model; the accuracy of the trained pre-training network model reaches the preset accuracy threshold; training an initial network model based on the task image dataset to obtain a target network model for processing the target task; the initial network model comprises a feature extraction layer of the trained pre-training network model.

2. The method of claim 1, wherein, The method comprises: extracting first semantic features corresponding to at least one first sample data in the task image dataset; extracting second semantic features corresponding to at least one second sample data in the pre-training image dataset; determining the sample semantic distance based on the first semantic features and the second semantic features.

3. The method of claim 2, wherein, The method comprises: inputting first sample data in the pre-training image dataset into the pre-training network model to obtain predicted labels of the first sample data output by the pre-training network model; determining a constraint parameter based on the preset accuracy threshold, and generating a pre-training loss function based on the constraint parameter; the preset accuracy threshold is proportional to the constraint parameter; determining a loss value based on the pre-training loss function, the predicted labels of the first sample data and corresponding real labels, and updating network parameters of the feature extraction layer based on the loss value until the pre-training loss function converges, to obtain the trained pre-training network model; wherein the feature extraction layer of the trained pre-training network model is inversely proportional to the constraint parameter with respect to the feature distance of the intra-class sample data.

4. The method of claim 1, wherein, The method comprises: inputting first sample data in the pre-training image dataset into the pre-training network model to obtain predicted labels of the first sample data output by the pre-training network model; Determine a loss value based on the predicted label of the first sample data and a corresponding real label, and update network parameters of the feature extraction layer based on the loss value until accuracy of the pre-training network model reaches a preset accuracy threshold, to obtain the trained pre-training network model.

5. The method of claim 4, wherein, The updating of the network parameters of the feature extraction layer based on the loss value until the accuracy of the pre-training network model reaches the preset accuracy threshold to obtain the trained pre-training network model comprises: updating the network parameters of the feature extraction layer based on the loss value, and determining whether the accuracy of the pre-training network model reaches the preset accuracy threshold; in the case where the accuracy of the pre-training network model does not reach the preset accuracy threshold, continuing training; in the case where the accuracy of the pre-training network model reaches the preset accuracy threshold, taking the pre-training network model as the trained pre-training network model.

6. The method of claim 5, wherein, The determining of the preset accuracy threshold based on the sample semantic distance comprises: determining a first threshold for controlling the number of parameter updates of the feature extraction layer based on the sample semantic distance; The determining of whether the accuracy of the pre-training network model reaches the preset accuracy threshold comprises: obtaining the number of updates of the network parameters of the feature extraction layer, and determining whether the accuracy of the pre-training network model reaches the preset accuracy threshold based on the number of updates and the first threshold.

7. The method of claim 5, wherein, The determining of the preset accuracy threshold based on the sample semantic distance comprises: determining a second threshold for controlling the convergence of the loss value based on the sample semantic distance; The determining of whether the accuracy of the pre-training network model reaches the preset accuracy threshold comprises: determining whether the accuracy of the pre-training network model reaches the preset accuracy threshold based on the loss value and the second threshold.

8. The method according to any one of claims 1 to 7, characterized in that, Training an initial network model based on a task image data set corresponding to a target task to obtain a target network model for processing the target task, comprising: obtaining at least one functional module and a target loss function corresponding to the target task; constructing the initial network model based on the feature extraction layer and the at least one functional module; training the initial network model based on the task image data set, and obtaining the target network model in the case where the target loss function converges.

9. The method according to any one of claims 1 to 7, characterized in that, The pre-training network model further comprises a fully connected layer, and the multilayer perceptron layer is located between the feature extraction layer and the fully connected layer. The multilayer perceptron layer comprises a nonlinear calculation layer; the nonlinear calculation layer comprises at least one of a batch normalization layer and an activation layer.

10. A data processing method, characterized by, The method comprises: obtaining to-be-processed data corresponding to a target task; inputting the to-be-processed data into a target network model for processing the target task to obtain a processing result output by the target network model; The target network model is obtained by training an initial network model based on a task image data set corresponding to the target task; the initial network model comprises a feature extraction layer of a pre-trained network model after training; the pre-trained network model after training reaches a preset accuracy threshold; the pre-trained network model is obtained based on a pre-training image data set through supervised pre-training; the sample semantics in the task image data set are different from those in the pre-training image data set; the category corresponding to the task image data set is mutually exclusive with the category corresponding to the pre-training image data set; the preset accuracy threshold is determined based on a sample semantic distance between the task image data set and the pre-training image data set; the pre-trained network model at least comprises a feature extraction layer and a multi-layer perceptron layer located behind the feature extraction layer; the multi-layer perceptron layer is used for inhibiting high-level semantic feature extraction and enhancing middle and low-level feature migration.

11. The method of claim 10, wherein, The sample semantic distance is inversely proportional to the preset accuracy threshold; a loss function of the supervised pre-training is determined based on a constraint parameter; the preset accuracy threshold is proportional to the constraint parameter.

12. A model training apparatus, comprising: The method comprises the following steps: A first acquisition module is configured to acquire a pre-trained network model; the pre-trained network model at least comprises a feature extraction layer and a multi-layer perceptron layer located behind the feature extraction layer; the multi-layer perceptron layer is used for inhibiting high-level semantic feature extraction and enhancing middle and low-level feature migration; A first training module is configured to acquire a sample semantic distance between a task image data set corresponding to a target task and a pre-training image data set; the sample semantics in the task image data set are different from those in the pre-training image data set; the category corresponding to the task image data set is mutually exclusive with the category corresponding to the pre-training image data set; the pre-training image data set comprises biological category image data, and the task image data set comprises tool category image data; a preset accuracy threshold is determined based on the sample semantic distance; the sample semantic distance is inversely proportional to the preset accuracy threshold; a pre-trained network model after training is obtained by performing supervised pre-training on the pre-trained network model based on the pre-training image data set; the pre-trained network model after training reaches the preset accuracy threshold; A second training module is configured to train an initial network model based on a task image data set corresponding to a target task, to obtain a target network model used for processing the target task; the initial network model comprises a feature extraction layer of the pre-trained network model after training; the sample semantics in the task image data set are different from those in the pre-training image data set.

13. A data processing apparatus, characterized by: The method comprises the following steps: A second acquisition module is configured to acquire to-be-processed data corresponding to a target task; A processing module is configured to input the to-be-processed data into a target network model used for processing the target task, to obtain a processing result output by the target network model. The target network model is obtained by training an initial network model on a task image dataset corresponding to the target task; the initial network model comprises a feature extraction layer of a trained pre-trained network model; the trained pre-trained network model reaches a preset accuracy threshold; the pre-trained network model is obtained by supervised pre-training based on a pre-training image dataset; the task image dataset and samples in the pre-training image dataset are different in semantics; a category corresponding to the task image dataset and a category corresponding to the pre-training image dataset are mutually exclusive; the preset accuracy threshold is determined based on a sample semantic distance between the task image dataset and the pre-training image dataset; the pre-trained network model at least comprises the feature extraction layer and a multi-layer perceptron layer located behind the feature extraction layer; the multi-layer perceptron layer is used for inhibiting high-level semantic feature extraction and enhancing low-level feature migration.

14. A model training device comprising: Comprise: a memory and a processor, the memory stores a computer program capable of running on the processor, the processor executes the computer program to realize the steps in the method of any one of claims 1 to 9, 10 to 11.

15. A computer storage medium, comprising, The computer storage medium stores one or more programs, which can be executed by one or more processors to realize the steps in the method of any one of claims 1 to 9, 10 to 11.

Citation Information

Patent Citations

  • Deep transfer learning method for text sentiment classification

    CN111680160A