CN115358288A - Multi-modal classification model training method and device based on label constraint - Google Patents

Multi-modal classification model training method and device based on label constraint Download PDF

Info

Publication number
CN115358288A
CN115358288A CN202210847262.6A CN202210847262A CN115358288A CN 115358288 A CN115358288 A CN 115358288A CN 202210847262 A CN202210847262 A CN 202210847262A CN 115358288 A CN115358288 A CN 115358288A
Authority
CN
China
Prior art keywords
data
label
classification model
training
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210847262.6A
Other languages
Chinese (zh)
Inventor
黄于晏
陈畅新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Youmi Technology Co ltd
Original Assignee
Youmi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Youmi Technology Co ltd filed Critical Youmi Technology Co ltd
Priority to CN202210847262.6A priority Critical patent/CN115358288A/en
Publication of CN115358288A publication Critical patent/CN115358288A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/08Speech classification or search
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Medical Informatics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Acoustics & Sound (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a multi-modal classification model training method and a device based on label constraint, wherein the method comprises the following steps: determining training data and corresponding data labels for training a target modality of a model; inputting the training data into a converged data classification model to obtain training data characteristics corresponding to the training data; inputting the data labels into a trained label classification model to obtain label characteristics corresponding to the data labels; inputting the training data and the data labels into the data classification model for training, and optimizing model parameters of the data classification model according to a target loss function value in the training process until convergence to obtain the trained data classification model; the objective loss function value includes a feature difference measure between the training data feature and the label feature. Therefore, the method can enable the feature extraction of the model to have more label discrimination, and further enable the prediction effect of the model to be better.

Description

Multi-modal classification model training method and device based on label constraint
Technical Field
The invention relates to the technical field of algorithm model training, in particular to a multi-modal classification model training method and device based on label constraint.
Background
With the development of algorithm technology, more and more enterprises begin to use algorithm models to perform data classification related data prediction tasks, such as predicting associated categories or labels for data of a specific modality, which requires that the algorithm models can fully extract and process features of the data. However, in the prior art, the difference between the introduced label and the extracted feature is not considered when the model is trained, so that the discrimination of the feature extracted by the model and the association of the label cannot be effectively improved in the training, and the training effect is poor. Therefore, the defects of the prior art need to be solved urgently.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a method and a device for determining multi-modal classification model training based on label constraint, which can enable the feature extraction of the model to have more label discrimination on one hand and enable the prediction effect of the model to be better on the other hand.
In order to solve the technical problem, a first aspect of the present invention discloses a multi-modal classification model training method based on label constraint, including:
determining training data and corresponding data labels for training a target modality of a model;
inputting the training data into a converged data classification model to obtain training data characteristics corresponding to the training data; the data classification model is used for extracting the characteristics of the data of the target modality;
inputting the data labels into a trained label classification model to obtain label characteristics corresponding to the data labels;
inputting the training data and the data labels into the data classification model for training, and optimizing model parameters of the data classification model according to a target loss function value in the training process until convergence to obtain the trained data classification model; the objective loss function value includes a feature difference measure between the training data feature and the label feature.
As an alternative embodiment, in the first aspect of the present invention, the target modality includes at least one of an audio modality, an image modality, and a text modality; and/or the data classification model comprises at least one of an audio classification model, an image classification model and a text classification model.
As an optional implementation manner, in the first aspect of the present invention, the inputting the data label to a trained label classification model to obtain a label feature corresponding to the data label includes:
generating a label text comprising the data label according to the data label;
inputting the label text into a trained label classification model to obtain label characteristics corresponding to the label text; the label classification model is obtained through training of a training data set comprising a plurality of training label texts and corresponding training data labels.
As an alternative implementation manner, in the first aspect of the present invention, the objective loss function value includes the feature difference degree and a label difference degree between a prediction label output by the data classification model and the data label.
As an alternative embodiment, in the first aspect of the present invention, the target loss function value is a weighted sum of the feature difference degree and the tag difference degree; the weight of the feature difference or the label difference is used for narrowing the size difference between the data values of the two.
As an optional implementation manner, in the first aspect of the present invention, the tag difference degree is a cross entropy loss function; and/or the feature dissimilarity is a KL divergence.
As an optional implementation manner, in the first aspect of the present invention, the tag classification model is a transform network-based classification model.
As an alternative implementation manner, in the first aspect of the present invention, the audio classification model includes at least one of a Speech Transformer model and a Transformer model, and/or the image classification model includes at least one of a CNN model, a ViT model and a CoTNet model, and/or the text classification model includes at least one of a BERT model, an XLNet model and a RoBERTa model.
The invention discloses a multi-modal classification model training device based on label constraint in a second aspect, which comprises:
the data determining module is used for determining training data of a target modality for training the model and corresponding data labels;
the characteristic extraction module is used for inputting the training data into a converged data classification model for training to obtain training data characteristics corresponding to the training data; the data classification model is used for extracting the characteristics of the data of the target modality;
the label processing module is used for inputting the data labels into a trained label classification model to obtain label characteristics corresponding to the data labels;
the model training module is used for inputting the training data and the data labels into the data classification model for training, and optimizing model parameters of the data classification model according to a target loss function value in the training process until convergence so as to obtain the trained data classification model; the objective loss function value includes a feature difference measure between the training data feature and the label feature.
As an alternative embodiment, in the second aspect of the present invention, the target modality includes at least one of an audio modality, an image modality, and a text modality; and/or the data classification model comprises at least one of an audio classification model, an image classification model and a text classification model.
As an optional implementation manner, in the second aspect of the present invention, the tag processing module includes:
the text generation unit is used for generating a label text comprising the data label according to the data label;
the feature extraction unit is used for inputting the label text into a trained label classification model to obtain label features corresponding to the label text; the label classification model is obtained by training a training data set comprising a plurality of training label texts and corresponding training data labels.
As an alternative embodiment, in the second aspect of the present invention, the objective loss function value includes the feature difference degree and a label difference degree between the prediction label and the data label output by the data classification model.
As an alternative embodiment, in the second aspect of the present invention, the target loss function value is a weighted sum of the feature difference degree and the label difference degree; the weight of the feature difference or the label difference is used for narrowing the size difference between the data values of the two.
As an alternative embodiment, in the second aspect of the present invention, the label difference degree is a cross entropy loss function; and/or the feature dissimilarity is a KL divergence.
As an optional implementation manner, in the second aspect of the present invention, the tag classification model is a classification model based on a Transformer network.
As an alternative implementation manner, in the second aspect of the present invention, the audio classification model includes at least one of a Speech Transformer model and a Transformer model, and/or the image classification model includes at least one of a CNN model, a ViT model and a CoTNet model, and/or the text classification model includes at least one of a BERT model, an XLNet model and a RoBERTa model.
The invention discloses another multi-modal classification model training device based on label constraint, which comprises:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute part or all of the steps of the multi-modal classification model training method based on the label constraint disclosed by the first aspect of the embodiment of the invention.
In a fourth aspect of the present invention, a computer storage medium is disclosed, where the computer storage medium stores computer instructions, and when the computer instructions are called, the computer instructions are used to perform some or all of the steps in the multi-modal classification model training method based on tag constraint disclosed in the first aspect of the embodiments of the present invention.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the method can extract the characteristics of the training data by using the classification model with the convergence of the training, extract the characteristics of the labels by using the trained label classification model, and calculate the difference between the characteristics and the characteristics in the subsequent training so that the trained model can effectively extract the data characteristics with the label discrimination, thereby effectively establishing the association between the extracted characteristics of the model and the labels, and enabling the characteristic extraction of the model to have the label discrimination on one hand and the prediction effect of the model to be better on the other hand.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flowchart of a multi-modal classification model training method based on label constraint according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of another method for training a multi-modal classification model based on label constraints, which is disclosed in the embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a multi-modal classification model training device based on label constraint according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of another multi-modal classification model training apparatus based on label constraint according to the embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of another multi-modal classification model training apparatus based on label constraint according to an embodiment of the disclosure.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The terms "first," "second," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, article, or article that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or article.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The invention discloses a multi-modal classification model training method and device based on label constraint, which can extract the characteristics of training data by utilizing a classification model with convergence in training, extract the characteristics of labels by utilizing the trained label classification model, and calculate the difference degree of the two in subsequent training so as to enable the trained model to effectively extract the data characteristics with label discrimination, thereby enabling the characteristic extraction of the model to have more label discrimination on one hand and enabling the prediction effect of the model to be better on the other hand. The following are detailed descriptions.
Example one
Referring to fig. 1, fig. 1 is a schematic flowchart of a multi-modal classification model training method based on label constraint according to an embodiment of the present invention. The method described in fig. 1 is applied to a data processing apparatus, where the processing apparatus may be a corresponding processing terminal, a corresponding processing device, or a corresponding processing server, and the server may be a local server or a cloud server, and the embodiment of the present invention is not limited thereto. As shown in FIG. 1, the method for training the multi-modal classification model based on the label constraint can comprise the following operations:
101. training data and corresponding data labels for training a target modality of the model are determined.
In an embodiment of the present invention, the target modality may include at least one of an audio modality, an image modality, and a text modality. Accordingly, the training data may also include at least one of audio data, image data, and text data. Optionally, when the training data is image data, it may also be image data of a specific frame in the video data, so that the method in the present invention may be used for processing the video data.
Optionally, the data label may be used to indicate a data category of the training data, a data content, or an importance degree of specific data, and the present invention is not limited thereto, and may be specifically determined according to a classification purpose or a classification requirement of the data classification model of the method in an actual application scenario.
Optionally, the training data may include one or more training data, and correspondingly, the data tag may also be one or more corresponding data tags corresponding to each training data.
102. And inputting training data into a converged data classification model to obtain training data characteristics corresponding to the training data.
Specifically, the data classification model is used to extract features of the data of the target modality. Preferably, the data classification model may include at least one of an audio classification model, an image classification model, and a text classification model.
Optionally, the data classification model may be trained through training data and data labels in a previous training step until convergence, so that the data classification model has an ability to accurately extract data features, and then the data classification model trained to converge performs a function of extracting data features.
Optionally, when processing training data of an audio modality, the data classification model adopts an audio classification model, and the audio classification model may include at least one of a Speech Transformer model and a Transformer model.
Optionally, when processing training data of an image modality, the data classification model adopts an image classification model, and the image classification model may include at least one of a CNN model, a ViT model, and a CoTNet model.
Optionally, when processing training data of a text modality, the data classification model adopts a text classification model, and the text classification model may include at least one of a BERT model, an XLNet model, and a RoBERTa model.
103. And inputting the data labels into the trained label classification model to obtain the label characteristics corresponding to the data labels.
Optionally, a label classification model capable of extracting the label features may be trained in advance until convergence, and then used for extracting the features of the label.
104. And inputting training data and data labels into the data classification model for training, and optimizing model parameters of the data classification model according to the target loss function value in the training process until convergence to obtain the trained data classification model.
Specifically, the objective loss function value includes a feature difference degree between the training data feature and the label feature.
Therefore, the method described by the embodiment of the invention can extract the characteristics of the training data by using the classification model converged by the training, extract the characteristics of the labels by using the trained label classification model, and calculate the difference between the two characteristics in the subsequent training so that the trained model can effectively extract the data characteristics with the label discrimination, thereby enabling the characteristic extraction of the model to have more label discrimination on one hand and enabling the prediction effect of the model to be better on the other hand.
As an alternative embodiment, the target loss function value includes a feature difference degree and a label difference degree between a prediction label and a data label output by the data classification model.
Alternatively, the label difference degree may be a cross entropy loss function.
Alternatively, the feature dissimilarity may be a KL divergence between the training data features and the label features.
Therefore, by the optional implementation mode, the target loss function value can be set to comprise the characteristic difference degree and the label difference degree, so that the classification prediction capability and the characteristic extraction capability of the data classification model can be trained simultaneously according to the loss function when the data classification model is trained, the characteristic extraction of the model can be more labeled on one hand, and the prediction effect of the model can be better on the other hand.
As an alternative embodiment, the target loss function value is a weighted sum of the feature variance and the tag variance. Specifically, the weight of the feature difference or the tag difference is used to narrow the size difference between the two data values.
In a specific embodiment, the total loss is equal to the sum of a first product and a second product, wherein the first product is the product of the weight a and the feature difference, and the second product is the product of the weight b and the label difference, in the training, the model parameters are updated by propagating the gradient of the total loss function backwards until the model converges, and the training is completed, wherein the weights a and b are hyperparameters, and a = b =1 can be set.
Preferably, since the total loss of the data classification model in the present invention is the sum of a plurality of loss functions, the larger the output value of the loss function has the larger influence on the model, assuming that the loss calculated by the loss function for calculating the feature difference is 25, and the loss calculated by the loss function for calculating the tag difference is 1.5, the entire network will perform inverse gradient propagation with the loss function for calculating the feature difference as the dominant, at this time, in order to amplify the effect of the loss function for calculating the tag difference, the loss function for calculating the feature difference is usually multiplied by a weight a with a value smaller than 1, for example, 0.1, so that the output value of the loss function for calculating the feature difference becomes 2.5, and the difference between the output value and the loss function value of the tag difference is reduced. In practical applications, because the loss functions of different models have certain differences, the values of a and b can be adjusted according to the output of the loss function value to measure the importance of different loss functions.
Therefore, by implementing the optional implementation mode, the target loss function value can be set as a weighted sum value of the feature difference degree and the label difference degree, and weights corresponding to different difference degrees are adjusted, so that the classification prediction capability and the feature extraction capability of the model can be trained more uniformly according to the loss function in the training process, on one hand, the feature extraction of the model has more label discrimination, and on the other hand, the prediction effect of the model is better.
Example two
Referring to fig. 2, fig. 2 is a schematic flowchart of another method for training a multi-modal classification model based on tag constraint according to an embodiment of the present invention. The method described in fig. 2 is applied to a data processing apparatus, where the processing apparatus may be a corresponding processing terminal, a corresponding processing device, or a corresponding processing server, and the server may be a local server or a cloud server, which is not limited in the embodiment of the present invention. As shown in FIG. 2, the method for training the multi-modal classification model based on the label constraint can comprise the following operations:
201. training data and corresponding data labels for training a target modality of the model are determined.
202. And inputting training data into a converged data classification model to obtain training data characteristics corresponding to the training data.
203. And generating a label text comprising the data label according to the data label.
Optionally, a tag text including the data tag may be generated according to a preset text template and the data tag. Preferably, the text template may correspond to a modality of the training data, and the tag text may be used to indicate both the content of the data tag and the modality information of the training data.
In a specific embodiment, the data tag may be constructed as a tag text according to the text template, for example, when the data tag is XXX, for the training data of the photo modality, the tag text may be constructed as: "this is a picture of { XXX }, for training data for audio modalities, the label text can be constructed as: "this is a piece of { XXX } audio", for training data for a text modality, its label text may be constructed as: "this is a piece of text about { XXX }".
204. And inputting the label text into the trained label classification model to obtain the label characteristics corresponding to the label text.
Specifically, the label classification model is obtained by training a training data set including a plurality of training label texts and corresponding training data labels. In a specific embodiment, a text data classification model for label classification is constructed, and input data of the text data classification model comprises label text and data labels, wherein the label text is: "this is a section of audio of { sports fitness }", the corresponding data label is sports fitness, then input data into the text data classification model to train, here can choose classification model based on Transformer network, because the data here includes label information, the classification accuracy of classification model is 100%, the purpose of the label classification model that is trained is as a converter, is used for receiving input label, the feature representation of output label in the model.
Optionally, the label classification model may be an existing text pre-training model, or when the data classification model in the present invention is a data classification model for processing a text mode, the data classification model trained to be converged may also be directly used as the label classification model, as long as it is ensured that the vector dimensions of the output label features and the training data features are consistent.
205. And inputting training data and data labels into the data classification model for training, and optimizing model parameters of the data classification model according to the target loss function value in the training process until convergence to obtain the trained data classification model.
The specific technical details and technical noun explanations of the above steps 201-202, 205 may refer to the description of the steps 101-102, 104 in the first embodiment, and are not repeated herein.
Therefore, the embodiment of the invention can accurately extract the characteristics of the data labels by using the label classification model, so that the difference degree of the characteristics and the training data characteristics is calculated in the subsequent training process, and the data characteristics with label discrimination can be effectively extracted by the trained model, thereby enabling the characteristic extraction of the model to have more label discrimination on one hand, and enabling the prediction effect of the model to be better on the other hand.
EXAMPLE III
Referring to fig. 3, fig. 3 is a schematic structural diagram of a multi-modal classification model training apparatus based on label constraint according to an embodiment of the present invention. The apparatus described in fig. 3 may be applied to a corresponding data processing apparatus, where the processing apparatus may be a corresponding processing terminal, a processing device, or a processing server, and the server may be a local server or a cloud server, which is not limited in the embodiment of the present invention. As shown in fig. 3, the apparatus may include:
a data determination module 301 for determining training data and corresponding data labels for training a target modality of the model.
In an embodiment of the present invention, the target modality may include at least one of an audio modality, an image modality, and a text modality. Accordingly, the training data may also include at least one of audio data, image data, and text data. Optionally, when the training data is image data, it may also be image data of a specific frame in the video data, so that the method in the present invention may be used for processing the video data.
Optionally, the data label may be used to indicate a data category of the training data, a data content, or an importance degree of specific data, and the present invention is not limited thereto, and may be specifically determined according to a classification purpose or a classification requirement of the data classification model of the method in an actual application scenario.
Optionally, the training data may include one or more training data, and correspondingly, the data tag may also be one or more corresponding data tags corresponding to each training data.
The feature extraction module 302 is configured to input training data into a converged data classification model and train the training data to obtain training data features corresponding to the training data.
Specifically, the data classification model is used to extract features of the data of the target modality. Preferably, the data classification model may include at least one of an audio classification model, an image classification model, and a text classification model.
Optionally, the data classification model may be trained to converge through training data and data labels in a previous training step, so that the data classification model has an ability to accurately extract data features, and subsequently, the data classification model trained to converge is used to perform a function of data feature extraction.
Optionally, when processing training data of an audio modality, the data classification model adopts an audio classification model, and the audio classification model may include at least one of a Speech Transformer model and a Transformer model.
Optionally, when processing training data of an image modality, the data classification model adopts an image classification model, and the image classification model may include at least one of a CNN model, a ViT model, and a CoTNet model.
Optionally, when processing training data of a text modality, the data classification model adopts a text classification model, and the text classification model may include at least one of a BERT model, an XLNet model, and a RoBERTa model.
And the tag processing module 303 is configured to input the data tag into the trained tag classification model to obtain a tag feature corresponding to the data tag.
Optionally, a label classification model capable of extracting the label features may be trained in advance until convergence, and then used for extracting the features of the label.
And the model training module 304 is configured to input training data and data labels to the data classification model for training, and optimize model parameters of the data classification model according to the target loss function value during training until convergence, so as to obtain a trained data classification model.
Specifically, the objective loss function value includes a feature difference degree between the training data feature and the label feature.
Therefore, the device described in the embodiment of the invention can extract the features of the training data by using the classification model of the training convergence, extract the features of the labels by using the trained label classification model, and calculate the difference between the two in the subsequent training so that the trained model can effectively extract the data features with the label discrimination, thereby enabling the feature extraction of the model to have more label discrimination on one hand and enabling the prediction effect of the model to be better on the other hand.
As an alternative embodiment, the target loss function value includes a feature difference degree and a label difference degree between the prediction label and the data label output by the data classification model.
Alternatively, the label difference degree can be a cross entropy loss function.
Alternatively, the feature difference may be a KL divergence between the training data features and the label features.
Therefore, by the optional implementation mode, the target loss function value can be set to comprise the characteristic difference degree and the label difference degree, so that the classification prediction capability and the characteristic extraction capability of the data classification model can be trained simultaneously according to the loss function when the data classification model is trained, the characteristic extraction of the model can be more labeled on one hand, and the prediction effect of the model can be better on the other hand.
As an alternative embodiment, the target loss function value is a weighted sum of the feature difference degree and the tag difference degree. Specifically, the weight of the feature difference or the tag difference is used to narrow the size difference between the two data values.
In a specific embodiment, the total loss is equal to the sum of a first product and a second product, wherein the first product is the product of the weight a and the feature difference degree, and the second product is the product of the weight b and the label difference degree, in the training, the model parameters are updated through the back propagation of the gradient of the total loss function until the model converges, and the training is completed, wherein the weights a and b are hyperparameters, and a = b =1 can be set.
Preferably, since the total loss of the data classification model in the present invention is the sum of a plurality of loss functions, the larger the output value of the loss function has the larger influence on the model, assuming that the loss calculated by the loss function for calculating the feature difference is 25, and the loss calculated by the loss function for calculating the tag difference is 1.5, the entire network will perform inverse gradient propagation with the loss function for calculating the feature difference as the dominant, at this time, in order to amplify the effect of the loss function for calculating the tag difference, the loss function for calculating the feature difference is usually multiplied by a weight a with a value smaller than 1, for example, 0.1, so that the output value of the loss function for calculating the feature difference becomes 2.5, and the difference between the output value and the loss function value of the tag difference is reduced. In practical application, because the loss functions of different models have certain differences, the values of a and b can be adjusted according to the output of the loss function value to measure the importance of different loss functions.
Therefore, by implementing the optional implementation mode, the target loss function value can be set as a weighted sum of the feature difference and the label difference, and weights corresponding to different differences are adjusted, so that the classification prediction capability and the feature extraction capability of the model can be trained more uniformly according to the loss function in training, on one hand, the feature extraction of the model has more label discrimination, and on the other hand, the prediction effect of the model is better.
As an alternative embodiment, as shown in fig. 4, the tag processing module 303 includes:
a text generating unit 3031, configured to generate a label text including the data label according to the data label.
And the feature extraction unit 3032 is configured to input the label text into the trained label classification model to obtain a label feature corresponding to the label text.
Optionally, a tag text including the data tag may be generated according to a preset text template and the data tag. Preferably, the text template may correspond to a modality of the training data, and the tag text may be used to indicate both the content of the data tag and the modality information of the training data.
In a specific embodiment, the data tag may be constructed as a tag text according to the text template, where the data tag is XXX, and for the training data of the picture modality, the tag text may be constructed as: "this is a picture of { XXX }, and for training data for audio modalities, the label text can be constructed as: "this is a piece of { XXX } audio," for training data of a text modality, its label text may be constructed as: "this is a piece of text about { XXX }.
Specifically, the label classification model is obtained by training a training data set including a plurality of training label texts and corresponding training data labels. In a specific embodiment, a text data classification model for label classification is constructed, and input data of the text data classification model comprises label text and data labels, wherein the label text is: "this is a section of audio of { sports fitness }, the corresponding data label is sports fitness, then input the input data into the text data classification model to train, can choose the classification model based on the transform network here, because the data here includes label information, the classification accuracy of the classification model is 100%, the purpose of the classification model of the label trained is as a converter, is used for receiving the input label, the characteristic representation of the output label in the model.
Optionally, the label classification model may be an existing text pre-training model, or when the data classification model in the present invention is a data classification model for processing a text modality, the data classification model trained to be converged may also be directly used as the label classification model, as long as it is ensured that vector dimensions of the output label features and the training data features are consistent.
Therefore, in the optional implementation mode, the features of the data labels can be accurately extracted by using the label classification model, so that the difference degree between the features and the training data features is calculated in the subsequent training, the data features with label discrimination can be effectively extracted by the trained model, the feature extraction of the model has more label discrimination on one hand, and the prediction effect of the model is better on the other hand.
Example four
Referring to fig. 5, fig. 5 is a schematic structural diagram of another training apparatus for multi-modal classification models based on label constraints according to an embodiment of the present disclosure. As shown in fig. 5, the apparatus may include:
a memory 401 storing executable program code;
a processor 402 coupled with the memory 401;
the processor 402 calls the executable program code stored in the memory 401 to execute some or all of the steps of the method for training the multi-modal classification model based on the label constraint disclosed in the first embodiment or the second embodiment of the present invention.
EXAMPLE five
The embodiment of the invention discloses a computer storage medium, which stores computer instructions, and when the computer instructions are called, the computer instructions are used for executing part or all of the steps of the label constraint-based multi-modal classification model training method disclosed in the first embodiment or the second embodiment of the invention.
While certain embodiments of the present disclosure have been described above, other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily have to be in the particular order shown or in sequential order to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, device, and non-volatile computer-readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to the description, reference may be made to some portions of the description of the method embodiments.
The apparatus, the device, the nonvolatile computer readable storage medium, and the method provided in the embodiments of the present specification correspond to each other, and therefore, the apparatus, the device, and the nonvolatile computer storage medium also have similar advantageous technical effects to the corresponding method.
In the 90's of the 20 th century, improvements to a technology could clearly distinguish between improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements to process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain a corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development, but the original code before compiling is also written in a specific Programming Language, which is called Hardware Description Language (HDL), and the HDL is not only one kind but many kinds, such as abll (Advanced boot Expression Language), AHDL (alternate hard Description Language), fluorescence, CUPL (computer universal Programming Language), HDCal (Java hard Description Language), lava, lola, HDL, PALASM, software, rhydl (Hardware Description Language), VHDL (Hardware Description Language), and vhigh-Language, which are currently used commonly. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in purely computer readable program code means, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more pieces of software and/or hardware in the practice of this description.
As will be appreciated by one skilled in the art, the present specification embodiments may be provided as a method, system, or computer program product. Accordingly, the embodiments described herein may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information and/or data which can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus comprising the element.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should be noted that: the method and the device for training a multi-modal classification model based on label constraint disclosed in the embodiment of the present invention are only preferred embodiments of the present invention, and are only used for illustrating the technical solution of the present invention, rather than limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art; the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A multi-modal classification model training method based on label constraint is characterized by comprising the following steps:
determining training data and corresponding data labels for training a target modality of a model;
inputting the training data into a converged data classification model to obtain training data characteristics corresponding to the training data; the data classification model is used for extracting the characteristics of the data of the target modality;
inputting the data labels into a trained label classification model to obtain label characteristics corresponding to the data labels;
inputting the training data and the data labels into the data classification model for training, and optimizing model parameters of the data classification model according to a target loss function value in the training process until convergence to obtain the trained data classification model; the objective loss function value includes a feature difference measure between the training data feature and the label feature.
2. The label constraint-based multi-modal classification model training method according to claim 1, wherein the target modality comprises at least one of an audio modality, an image modality and a text modality; and/or the data classification model comprises at least one of an audio classification model, an image classification model and a text classification model.
3. The label constraint-based multi-modal classification model training method according to claim 1, wherein the inputting the data labels into the trained label classification model to obtain the label features corresponding to the data labels comprises:
generating a label text comprising the data label according to the data label;
inputting the label text into a trained label classification model to obtain a label characteristic corresponding to the label text; the label classification model is obtained by training a training data set comprising a plurality of training label texts and corresponding training data labels.
4. The method of claim 1, wherein the objective loss function value comprises the feature difference degree and a label difference degree between a predicted label output by the data classification model and the data label.
5. The label constraint-based multi-modal classification model training method according to claim 4, wherein the objective loss function value is a weighted sum of the feature difference degree and the label difference degree; the weight of the feature difference or the label difference is used for narrowing the size difference between the data values of the two.
6. The method for training the multi-modal classification model based on the label constraint according to claim 4, wherein the label difference degree is a cross entropy loss function; and/or the feature dissimilarity is a KL divergence.
7. The method for training the multi-modal classification model based on the label constraint is characterized in that the label classification model is a classification model based on a Transformer network.
8. The label constraint-based multi-modal classification model training method according to claim 2, wherein the audio classification model comprises at least one of a Speech Transformer model and a Conformer model, and/or the image classification model comprises at least one of a CNN model, a ViT model and a CoTNet model, and/or the text classification model comprises at least one of a BERT model, an XLNT model and a RoBERTA model.
9. A multi-modal classification model training apparatus based on label constraint, the apparatus comprising:
the data determination module is used for determining training data of a target mode for training the model and corresponding data labels;
the characteristic extraction module is used for inputting the training data into a converged data classification model for training to obtain training data characteristics corresponding to the training data; the data classification model is used for extracting the characteristics of the data of the target modality;
the label processing module is used for inputting the data labels to a trained label classification model to obtain label characteristics corresponding to the data labels;
the model training module is used for inputting the training data and the data labels into the data classification model for training, and optimizing model parameters of the data classification model according to a target loss function value in the training process until the model parameters converge to obtain the trained data classification model; the objective loss function value includes a feature difference measure between the training data feature and the label feature.
10. A multi-modal classification model training apparatus based on label constraint, the apparatus comprising:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the label constraint-based multi-modal classification model training method according to any one of claims 1 to 8.
CN202210847262.6A 2022-07-19 2022-07-19 Multi-modal classification model training method and device based on label constraint Pending CN115358288A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210847262.6A CN115358288A (en) 2022-07-19 2022-07-19 Multi-modal classification model training method and device based on label constraint

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210847262.6A CN115358288A (en) 2022-07-19 2022-07-19 Multi-modal classification model training method and device based on label constraint

Publications (1)

Publication Number Publication Date
CN115358288A true CN115358288A (en) 2022-11-18

Family

ID=84032286

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210847262.6A Pending CN115358288A (en) 2022-07-19 2022-07-19 Multi-modal classification model training method and device based on label constraint

Country Status (1)

Country Link
CN (1) CN115358288A (en)

Similar Documents

Publication Publication Date Title
US11157818B2 (en) Model training method and apparatus based on gradient boosting decision tree
US10747959B2 (en) Dialog generation method, apparatus, and electronic device
JP6601470B2 (en) NATURAL LANGUAGE GENERATION METHOD, NATURAL LANGUAGE GENERATION DEVICE, AND ELECTRONIC DEVICE
KR20210061141A (en) Method and apparatus for processimg natural languages
CN110457449B (en) Method, device, equipment and storage medium for training model online
CN112308113A (en) Target identification method, device and medium based on semi-supervision
CN111222315B (en) Movie scenario prediction method
CN111507726B (en) Message generation method, device and equipment
CN115238826A (en) Model training method and device, storage medium and electronic equipment
CN116630480B (en) Interactive text-driven image editing method and device and electronic equipment
CN115358288A (en) Multi-modal classification model training method and device based on label constraint
CN113343085B (en) Information recommendation method and device, storage medium and electronic equipment
CN114676832A (en) Neural network model operation method, medium, and electronic device
CN115841016A (en) Model training method, device and equipment based on feature selection
CN114997277A (en) Model training method, task execution method and device
CN114511376A (en) Credit data processing method and device based on multiple models
CN116501852B (en) Controllable dialogue model training method and device, storage medium and electronic equipment
WO2018216511A1 (en) Attribute identification device, attribute identification method, and program
CN114065768B (en) Feature fusion model training and text processing method and device
JP5980143B2 (en) Pose assignment model generation device, pose assignment model generation method, pose assignment device, pose assignment method, program
CN114154559A (en) Image recognition model training method and device
US20230342553A1 (en) Attribute and rating co-extraction
CN117494697A (en) Log analysis processing method and device
CN114996447A (en) Text hierarchy classification method and device based on center loss
CN117520850A (en) Model training method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination