Sign language translation method and device, electronic equipment and storage medium
The sign language translation model built through visual encoders and large language models is trained using natural spoken text supervision, which solves the problem of low sign language translation accuracy in the existing technology and achieves high-quality word-free annotated sign language translation.
Patent Information
- Application Number
- CN202410630648.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-06
Smart Images

Figure CN118609202A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sign language translation, and in particular to a sign language translation method, device, electronic equipment and storage medium. Background Art
[0002] In the prior art, sign language translation technology often requires sign language word annotation (Gloss) for auxiliary supervision. Gloss is a direct translation of the words in the sign language video. Sign language videos can often be divided into words, and Gloss is its direct word-to-word translation. This kind of annotation requires professional sign language experts to perform one-to-one annotation, which is time-consuming and labor-intensive. In addition, its word order and language rules are very different from natural text. The translation result can only be consistent with the Gloss annotation at best, which limits the network's understanding of sign language and results in low accuracy of sign language translation.
[0003] Therefore, how to better implement sign language translation has become a technical problem that needs to be solved urgently in the industry. Summary of the invention
[0004] The present invention provides a sign language translation method, device, electronic equipment and storage medium, which are used to better realize sign language translation.
[0005] The present invention provides a sign language translation method, comprising:
[0006] Get the sign language video to be translated;
[0007] The sign language video is input into a sign language translation model to obtain a translation text of the sign language video output by the sign language translation model; the sign language translation model includes a visual encoder and a large language model, the visual encoder is used to extract the sign language feature representation of the sign language video, and the large language model is used to output the translation text of the sign language video based on the sign language feature representation; the sign language translation model is trained based on sign language video samples and corresponding translation text labels.
[0008] According to a sign language translation method provided by the present invention, the visual encoder includes a convolutional neural network, a temporal convolutional neural network and a Transformer encoder; the step of inputting the sign language video into a sign language translation model to obtain a translation text of the sign language video output by the sign language translation model includes:
[0009] Inputting the sign language video into the convolutional neural network to extract convolutional features of the sign language video;
[0010] Inputting the convolutional features into the temporal convolutional neural network to extract the temporal features of the sign language video;
[0011] Inputting the temporal features into the Transformer encoder to obtain a sign language feature representation of the sign language video output by the Transformer encoder;
[0012] The sign language feature representation of the sign language video is input into the large language model to obtain a translation text of the sign language video output by the large language model.
[0013] According to a sign language translation method provided by the present invention, before inputting the sign language video into a sign language translation model to obtain a translation text of the sign language video output by the sign language translation model, the method further includes:
[0014] Taking the sign language video sample and the corresponding translation text label as a group of training samples, obtaining multiple groups of training samples;
[0015] Using the multiple groups of training samples, sequentially performing first-stage model training, second-stage model training, and third-stage model training on the initial sign language translation model to obtain a trained sign language translation model;
[0016] Among them, in the first stage model training, the initial sign language translation model includes a visual encoder, a text encoder and a visual-text alignment module, and the visual-text alignment module includes a linear layer and a layer normalization network connected in sequence; in the second stage model training, the initial sign language translation model includes a text decoder and a visual encoder trained by the first stage model; in the third stage model training, the initial sign language translation model includes a large language model and a visual encoder trained by the second stage model.
[0017] According to a sign language translation method provided by the present invention, the step of performing a first-stage model training on an initial sign language translation model using the multiple groups of training samples comprises:
[0018] For any set of training samples, inputting the sign language video samples in the training samples into the visual encoder, extracting the sign language feature representation of the sign language video samples, and inputting the translated text labels in the training samples into the text encoder, extracting the text feature representation of the translated text labels;
[0019] Inputting the sign language feature representation of the sign language video sample into the visual text alignment module for processing to obtain the image modality feature representation of the sign language video sample, and inputting the text feature representation of the translated text label into the visual text alignment module for processing to obtain the processed text modality feature representation of the translated text label;
[0020] Using a preset symmetric cross entropy loss function, a symmetric cross entropy loss value between the image modality feature representation and the text modality feature representation is calculated;
[0021] The model parameters of the visual encoder are adjusted based on the symmetric cross entropy loss value until the symmetric cross entropy loss value converges or the number of training times reaches a preset maximum number of training times, and the first stage model training is completed.
[0022] According to a sign language translation method provided by the present invention, the step of performing second-stage model training on the initial sign language translation model using the multiple groups of training samples comprises:
[0023] For any group of training samples, inputting the sign language video samples in the training samples into the visual encoder trained by the first stage model, and extracting the sign language feature representation of the sign language video samples;
[0024] Inputting the sign language feature representation of the sign language video sample into the text decoder to obtain a predicted translation text corresponding to the sign language video sample;
[0025] Using a preset cross entropy loss function, calculating a cross entropy loss value between the predicted translation text and the translation text label corresponding to the sign language video sample;
[0026] The model parameters of the visual encoder are adjusted based on the cross entropy loss value until the cross entropy loss value converges or the number of training times reaches a preset maximum number of training times, and then the second stage model training is completed.
[0027] According to a sign language translation method provided by the present invention, the step of performing a third-stage model training on the initial sign language translation model using the multiple groups of training samples comprises:
[0028] For any group of training samples, inputting the sign language video samples in the training samples into the visual encoder trained by the second stage model, and extracting the sign language feature representation of the sign language video samples;
[0029] Inputting the sign language feature representation of the sign language video sample into the large language model to obtain a predicted translation text corresponding to the sign language video sample;
[0030] Using a preset cross entropy loss function, calculating a cross entropy loss value between the predicted translation text and the translation text label corresponding to the sign language video sample;
[0031] Based on the cross entropy loss value, the model parameters of the visual encoder and the large language model are adjusted until the cross entropy loss value converges or the number of training times reaches a preset maximum number of training times, thereby obtaining a trained sign language translation model.
[0032] The present invention also provides a sign language translation device, comprising:
[0033] An acquisition module is used to acquire the sign language video to be translated;
[0034] A translation module is used to input the sign language video into a sign language translation model to obtain a translation text of the sign language video output by the sign language translation model; the sign language translation model includes a visual encoder and a large language model, the visual encoder is used to extract the sign language feature representation of the sign language video, and the large language model is used to output the translation text of the sign language video based on the sign language feature representation; the sign language translation model is trained based on sign language video samples and corresponding translation text labels.
[0035] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the sign language translation method described above is implemented.
[0036] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the sign language translation method as described above is implemented.
[0037] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the sign language translation method described above is implemented.
[0038] The sign language translation method, device, electronic device and storage medium provided by the present invention use a visual encoder and a large language model to build a sign language translation model, use sign language video samples and corresponding translation text labels to train the sign language translation model, use natural spoken text supervision to learn sign language feature representation without word annotations, so that the trained sign language translation model can better understand the expression content contained in each video frame of the input sign language video, extract the features of the sign language video to be translated through the visual encoder in the model, obtain a universal sign language feature representation, and perform end-to-end reasoning with the large language model, so as to output high-quality sign language translation text, realize sign language translation without sign language word annotations, and also improve the sign language translation accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 It is a flowchart of the sign language translation method provided by the present invention;
[0041] Figure 2 It is one of the flow charts of the sign language translation model training process in the sign language translation method provided by the present invention;
[0042] Figure 3 This is the second flow chart of the sign language translation model training process in the sign language translation method provided by the present invention;
[0043] Figure 4 This is the third flow chart of the sign language translation model training process in the sign language translation method provided by the present invention;
[0044] Figure 5 It is a structural schematic diagram of the sign language translation device provided by the present invention;
[0045] Figure 6 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] In the description of the invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0048] Combine the following Figure 1-Figure 6 The present invention describes a sign language translation method, device, electronic device and storage medium.
[0049] Figure 1 : is a flow chart of the sign language translation method provided by the present invention, such as Figure 1 As shown, including:
[0050] Step 110, obtaining a sign language video to be translated;
[0051] Step 120, input the sign language video into a sign language translation model to obtain the translated text of the sign language video output by the sign language translation model; the sign language translation model includes a visual encoder and a large language model, the visual encoder is used to extract the sign language feature representation of the sign language video, and the large language model is used to output the translated text of the sign language video based on the sign language feature representation; the sign language translation model is trained based on sign language video samples and corresponding translated text labels.
[0052] Specifically, the sign language video to be translated described in the embodiment of the present invention refers to a video file used for sign language translation, which can be obtained by shooting a sign language action video of a sign language person by a preset video shooting device.
[0053] The sign language translation model described in the embodiment of the present invention can be constructed based on a visual encoder and a large language model, and is specifically used for performing natural language translation on an input sign language video to be translated.
[0054] Among them, the visual encoder can be constructed using conventional convolutional neural networks, temporal convolutional neural networks and self-attention encoding networks, which is mainly used to extract sign language feature representations of sign language videos and obtain high-dimensional encoding features of sign language videos; the large language model can adopt an encoder-decoder structure, which is mainly used to infer and translate the sign language feature representations output by the visual encoder, and output the translated text of the sign language video to be translated.
[0055] In an embodiment of the present invention, a sign language translation model can be obtained by model training based on sign language video samples and corresponding translation text labels. During the model training process, natural spoken language text supervision is considered to perform sign language feature representation learning without the assistance of Gloss, and pre-training can be performed in a manner based on a combination of content understanding and contextual reasoning, ensuring that the trained sign language translation model can extract powerful and universal sign language feature representations for obtaining high-quality sign language translation results.
[0056] In an embodiment of the present invention, the training samples are composed of multiple groups of sign language video samples carrying translation text labels.
[0057] The translation text label described in the embodiment of the present invention is predetermined based on the sign language video sample, and is the real translation text corresponding to the sign language video sample, which corresponds one-to-one with the sign language video sample. In other words, each sign language video sample in the training sample is predetermined to carry a corresponding translation text label.
[0058] In an embodiment of the present invention, in step 110, a video of the sign language movements of the sign language person may be recorded in advance by a video shooting device to obtain a sign language video to be translated.
[0059] Furthermore, in an embodiment of the present invention, in step 120, the sign language video to be translated obtained in step 110 is input into a sign language translation model, high-dimensional visual features are extracted from the sign language video to be translated through a visual encoder in the sign language translation model, and the extracted visual features are input into a large language model in the sign language translation model for recognition and end-to-end reasoning to obtain a translated text of the input sign language video, thereby completing the translation of the sign language video to be translated, and thereby realizing the translation of the input sign language video.
[0060] The sign language translation method of the embodiment of the present invention constructs a sign language translation model by using a visual encoder and a large language model, and uses sign language video samples and corresponding translation text labels to train the sign language translation model, and uses natural spoken language text supervision to perform sign language feature representation learning without word annotations, so that the trained sign language translation model can better understand the expression content contained in the input sign language video, and extract the features of the sign language video to be translated through the visual encoder in the model to obtain a universal sign language feature representation, and after reasoning with the large language model, it can output high-quality sign language translation text, thereby realizing sign language translation without sign language word annotations, and also improving the sign language translation accuracy.
[0061] Based on the content of the above embodiment, as an optional embodiment, the visual encoder includes a convolutional neural network, a temporal convolutional neural network and a Transformer encoder; the sign language video is input into the sign language translation model to obtain the translation text of the sign language video output by the sign language translation model, including:
[0062] Input the sign language video into the convolutional neural network to extract the convolution features of the sign language video;
[0063] Input the convolutional features into the temporal convolutional neural network to extract the temporal features of the sign language video;
[0064] Input the temporal features into the Transformer encoder to obtain the sign language feature representation of the sign language video output by the Transformer encoder;
[0065] The sign language feature representation of the sign language video is input into the large language model to obtain the translation text of the sign language video output by the large language model.
[0066] Specifically, the visual encoder described in the embodiment of the present invention includes a convolutional neural network, a temporal convolutional neural network and a Transformer encoder, wherein the convolutional neural network can adopt a two-dimensional convolutional neural network, and specifically a residual connection network Resnet can be adopted as the two-dimensional neural network; a layer of temporal convolutional neural network can be composed of a one-dimensional convolutional layer, a batch normalization layer, a ReLU activation layer and a maximum pooling layer.
[0067] In an embodiment of the present invention, the input sign language video to be translated can be expressed as B×T×224×224×3, where B represents the batch size, T represents the length of the sign language video, and 224×224×3 represents the size of each frame of the sign language video image. After the sign language video is input into the sign language translation model, the visual features are first extracted through the residual connection network Resnet to obtain the high-dimensional convolution features of the sign language video, which can be expressed as B×T×512.
[0068] In an embodiment of the present invention, one or more layers of temporal convolutional neural networks may be used to capture the short-term temporal dependencies of the input sign language video.
[0069] Optionally, in an embodiment of the present invention, a two-layer temporal convolutional neural network is used, that is, the convolutional features of the sign language video are input into two layers of sequentially connected temporal convolutional neural networks to capture the temporal features, which can effectively extract the temporal features of the sign language video and achieve a good feature extraction effect, and save computing memory. At this time, the temporal features output by the temporal convolutional neural network can be expressed as B×(T / 4)×1024.
[0070] Furthermore, in an embodiment of the present invention, the extracted temporal features of the sign language video are input into the Transformer encoder. After the temporal features are added with the position coding information, they are input into the self-attention network coding module of the Transformer encoder to further learn the long-term temporal dependencies of the sign language video. Finally, the Transformer encoder outputs the sign language feature representation of the sign language video, which is a high-dimensional coding feature and can be expressed as B×(T / 4)×1024.
[0071] Furthermore, in an embodiment of the present invention, the sign language feature representation of the sign language video is input into a large language model, wherein the large language model can adopt an encoder-decoder structure to perform end-to-end reasoning on the sign language feature representation of the sign language video, and ultimately obtain the translated text of the sign language video output by the large language model.
[0072] The method of the embodiment of the present invention adopts a convolutional neural network, a temporal convolutional neural network and a Transformer encoder to construct a visual encoder to extract rich visual spatial features from the input sign language video. Combined with the powerful end-to-end reasoning performance of the large language model, it can output high-quality sign language translation text and improve the accuracy of sign language translation.
[0073] Based on the content of the above embodiment, as an optional embodiment, before inputting the sign language video into the sign language translation model to obtain the translated text of the sign language video output by the sign language translation model, the method further includes:
[0074] Taking the sign language video samples and the corresponding translated text labels as a group of training samples, obtaining multiple groups of training samples;
[0075] Using multiple groups of training samples, the initial sign language translation model is sequentially trained with the first stage model training, the second stage model training and the third stage model training to obtain a trained sign language translation model;
[0076] Among them, in the first stage model training, the initial sign language translation model includes a visual encoder, a text encoder and a visual-text alignment module, and the visual-text alignment module includes a linear layer and a layer normalization network connected in sequence; in the second stage model training, the initial sign language translation model includes a text decoder and a visual encoder trained by the first stage model; in the third stage model training, the initial sign language translation model includes a large language model and a visual encoder trained by the second stage model.
[0077] Specifically, the initial sign language translation model described in the embodiment of the present invention refers to a sign language translation model that has been initialized with parameters at the beginning of model training.
[0078] In an embodiment of the present invention, before the sign language video to be translated is input into the sign language translation model for translation, the sign language translation model needs to be trained to obtain a trained sign language translation model.
[0079] In an embodiment of the present invention, a certain number of sign language video samples and real translation text labels corresponding to each sign language video sample need to be prepared in advance. All sign language video samples can be divided into training set, test set and verification set according to a certain ratio to perform model training on the sign language translation model.
[0080] In an embodiment of the present invention, the initial sign language translation model is trained using the training set data, and the specific training process is as follows:
[0081] Each sign language video sample and the corresponding translation text label are used as a group of training samples, so that multiple groups of training samples can be obtained based on different sign language video samples.
[0082] In the embodiment of the present invention, each sign language video sample has a one-to-one correspondence with the translation text label it carries.
[0083] Then, after obtaining multiple groups of training samples, the multiple groups of training samples are input into the initial sign language translation model in sequence, and the model is trained using the multiple groups of training samples. Specifically, the initial sign language translation model is subjected to multi-stage model training in sequence using the multiple groups of training samples, which can be specifically divided into first-stage model training, second-stage model training and third-stage model training. Thus, a trained sign language translation model is obtained through the above three-stage model training.
[0084] The method of the embodiment of the present invention can effectively improve the model accuracy of the trained sign language translation model by using sign language video samples and corresponding translation text labels as a group of training samples and using multiple groups of training samples to perform multi-stage model training on the sign language translation model.
[0085] Among them, in the first stage of model training, the initial sign language translation model includes a visual encoder, a text encoder and a visual-text alignment module. The visual-text alignment module includes linear layers and layer normalization networks connected in sequence, and its purpose is to train the visual encoder.
[0086] Figure 2 is one of the flow charts of the sign language translation model training process in the sign language translation method provided by the present invention, such as Figure 2 As shown, in an embodiment of the present invention, a plurality of groups of training samples are used to perform the first stage model training on the initial sign language translation model. The specific steps of the model training in this stage include:
[0087] For any set of training samples, input the sign language video samples in the training samples into the visual encoder to extract the sign language feature representation of the sign language video samples, and input the translated text labels in the training samples into the text encoder to extract the text feature representation of the translated text labels;
[0088] Inputting the sign language feature representation of the sign language video sample into the visual text alignment module for processing to obtain the image modality feature representation of the sign language video sample, and inputting the text feature representation of the translated text label into the visual text alignment module for processing to obtain the processed text modality feature representation of the translated text label;
[0089] Using the preset symmetric cross entropy loss function, the symmetric cross entropy loss value between the image modality feature representation and the text modality feature representation is calculated;
[0090] The model parameters of the visual encoder are adjusted based on the symmetric cross entropy loss value until the symmetric cross entropy loss value converges or the number of training times reaches the preset maximum number of training times, and the first stage of model training is completed.
[0091] Specifically, in an embodiment of the present invention, the first stage model training is first performed, and the initial sign language translation model includes a visual encoder, a text encoder and a visual text alignment module. The visual encoder includes a convolutional neural network, a temporal convolutional neural network and a Transformer encoder, wherein the convolutional neural network and the temporal convolutional neural network constitute a sign language embedding layer, and the Transformer encoder mainly includes a self-attention layer and a feedforward layer. The visual encoder is used to extract the visual spatial features of the sign language video sample.
[0092] The text encoder includes a text embedding layer and a Transformer encoder, and the text embedding layer may use a mapping layer. The text encoder is used to extract natural language features of the translated text label (ie, the real translated text).
[0093] Among them, the visual text alignment module includes linear layers and layer normalization networks connected in sequence, which are used to narrow the visual language modality distance between sign language videos and natural texts, so as to enable the model to understand the content of sign language videos.
[0094] It should be noted that, in the embodiment of the present invention, one visual encoder or N series-connected visual encoders may be used to process the input sign language video, where N is a positive integer greater than 1. The number of visual encoders may be determined according to actual design requirements, and the present invention does not specifically limit this.
[0095] More specifically, in an embodiment of the present invention, for any set of training samples, the sign language video samples in the training samples are input into the visual encoder, assuming that the input sign language video samples are B×T×224×224×3, and the sign language feature representation of the sign language video samples is extracted, which can be expressed as B×(T / 4)×1024. At the same time, the translated text labels in the training samples, that is, the real translated texts, are input into the text encoder, assuming that the translated text labels are expressed as B×U, where U refers to the length of the text sentence. After the text embedding layer, the text is converted into a vector form B×U×1024, and then input into the Transformer encoder for long-term temporal dependency learning, so that the text feature representation of the translated text label can be extracted, and the high-dimensional text encoding feature can be expressed as B×U×1024.
[0096] Furthermore, in an embodiment of the present invention, the sign language feature representation of the sign language video sample is input into the visual text alignment module for processing, and the feature is obtained by performing dimensional transformation through a linear layer in the module. Then after a layer normalization network and scaling operation, the image modality feature representation of the sign language video sample can be obtained.
[0097] At the same time, the text feature representation of the translated text label is input into the visual text alignment module for processing, and the feature is also transformed by a linear layer in the module to obtain the feature Then after a layer normalization network and scaling operation, the text modality feature representation of the processed translated text label can be obtained.
[0098] Next, in an embodiment of the present invention, a symmetric cross entropy loss function is used to calculate the symmetric cross entropy loss value between the image modality feature representation and the text modality feature representation. Assuming that the original video representation corresponding to the sign language video sample input by the model is V, and the original text representation of the input translation text label is S, the preset symmetric cross entropy loss function L s It can be expressed as:
[0099]
[0100] Further, in an embodiment of the present invention, the model parameters of the visual encoder are adjusted based on the symmetric cross entropy loss value calculated above, thereby continuously iteratively training the model according to the above process until the symmetric cross entropy loss value converges or the number of training times reaches a preset maximum number of training times, and the first stage model training is completed. At this point, the model parameters of the visual encoder have been finally optimized after the first stage model training.
[0101] The method of the embodiment of the present invention constructs an initial sign language translation model by using a visual encoder, a text encoder and a visual-text alignment module, introduces sequentially connected linear layers and layer normalization networks to construct a visual-text alignment module, and uses multiple groups of training samples to perform the first stage of model training on the initial sign language translation model, thereby reducing the semantic gap between visual representation and text representation, and improving the ability of the visual encoder in the sign language translation model to understand the content expressed in the input video, which is conducive to improving the accuracy of subsequent sign language translation.
[0102] Furthermore, in an embodiment of the present invention, the text decoder and the visual encoder trained by the first stage model are used to construct an initial sign language translation model, and the second stage model training is performed.
[0103] Figure 3 FIG. 2 is a flow chart of the sign language translation model training process in the sign language translation method provided by the present invention. Figure 3 As shown, in an embodiment of the present invention, the steps of performing the second stage model training on the initial sign language translation model using multiple sets of training samples include:
[0104] For any set of training samples, the sign language video samples in the training samples are input into the visual encoder trained by the first stage model to extract the sign language feature representation of the sign language video samples;
[0105] Inputting the sign language feature representation of the sign language video sample into the text decoder to obtain the predicted translation text corresponding to the sign language video sample;
[0106] Using a preset cross entropy loss function, calculate the cross entropy loss value between the predicted translation text and the translation text label corresponding to the sign language video sample;
[0107] The model parameters of the visual encoder are adjusted based on the cross entropy loss value until the cross entropy loss value converges or the number of training times reaches the preset maximum number of training times, and the second stage model training is completed.
[0108] Specifically, in an embodiment of the present invention, the text decoder may be composed of a text embedding layer and a Transformer decoder. The text embedding layer may also adopt a mapping layer. The Transformer decoder mainly includes a self-attention layer, a cross-attention layer and a feedforward layer.
[0109] In an embodiment of the present invention, for any group of training samples, the sign language video samples in the training samples are input into the visual encoder trained by the first stage model. After being processed by the sign language embedding layer and the Transformer encoder in the model, the sign language feature representation of the input sign language video samples can be extracted.
[0110] Furthermore, in an embodiment of the present invention, the sign language feature representation of the sign language video sample extracted in the previous step is input into the text decoder, and after being processed by the text embedding layer and the cross-attention mechanism in the Transformer decoder, the predicted translation text corresponding to the sign language video sample output by the model can be obtained.
[0111] In an embodiment of the present invention, after obtaining the predicted translation text corresponding to the sign language video sample, the cross entropy loss value between the predicted translation text and the translation text label carried by the sign language video sample can be calculated by further using a preset cross entropy loss function. Assuming that the original video corresponding to the sign language video sample input by the model is represented by V, and the original text of the input translation text label is represented by S, the preset cross entropy loss function L C It can be expressed as:
[0112] L c = -logp(S|V);
[0113] Where p(S|V) represents the conditional probability of video to text segment.
[0114] Further, in an embodiment of the present invention, the model parameters of the visual encoder in the sign language translation model are adjusted based on the cross entropy loss value calculated above, thereby continuously iteratively training the model according to the above process until the cross entropy loss value converges or the number of training times reaches the preset maximum number of training times, and the second stage model training is completed. At this point, the model parameters of the visual encoder have been optimized again through the second stage model training.
[0115] The method of the embodiment of the present invention uses a text decoder and a visual encoder that has been trained by the first stage model to construct an initial sign language translation model for second stage model training, and uses an autoregressive method to predict the translated text word by word, thereby improving the model's ability to reason about the context of the generated text, so that the visual encoder model can learn better sign language feature representations, which is conducive to further improving the accuracy of subsequent sign language translation.
[0116] Furthermore, in an embodiment of the present invention, the large language model and the visual encoder trained by the second-stage model are used to construct an initial sign language translation model, and the third-stage model training is performed.
[0117] Figure 4 FIG. 3 is a flow chart of the sign language translation model training process in the sign language translation method provided by the present invention. Figure 4 As shown, in an embodiment of the present invention, the step of performing the third stage model training on the initial sign language translation model using multiple sets of training samples includes:
[0118] For any set of training samples, the sign language video samples in the training samples are input into the visual encoder trained by the second-stage model to extract the sign language feature representation of the sign language video samples;
[0119] Inputting the sign language feature representation of the sign language video sample into the large language model to obtain the predicted translation text corresponding to the sign language video sample;
[0120] Using a preset cross entropy loss function, calculate the cross entropy loss value between the predicted translation text and the translation text label corresponding to the sign language video sample;
[0121] Based on the cross entropy loss value, the model parameters of the visual encoder and the large language model are adjusted until the cross entropy loss value converges or the number of training times reaches the preset maximum number of training times, thereby obtaining a trained sign language translation model.
[0122] Specifically, in an embodiment of the present invention, the large language model adopts an end-to-end encoder-decoder structure.
[0123] In an embodiment of the present invention, after the second stage model training, for any group of training samples, the sign language video samples in the training samples are input into the visual encoder trained by the second stage model, and after being processed by the sign language embedding layer and the Transformer encoder in the model, the sign language feature representation of the input sign language video samples can be extracted.
[0124] Furthermore, in an embodiment of the present invention, the sign language feature representation of the sign language video sample is input into a large language model, and end-to-end reasoning is performed through an encoder-decoder network in the large language model to obtain a predicted translation text corresponding to the input sign language video sample.
[0125] In an embodiment of the present invention, a cross entropy loss value between the predicted translation text and the translation text label corresponding to the sign language video sample can be calculated using a preset cross entropy loss function. It should be noted that the preset cross entropy loss function can be the preset cross entropy loss function L used in the second stage model training. C .
[0126] Furthermore, the model parameters of the visual encoder and the large language model can be adjusted based on the calculated cross-entropy loss value, thereby continuously iteratively training the sign language translation model according to the above process until the final cross-entropy loss value converges or the number of training times reaches a preset maximum number of training times, and the model parameters adjusted at this time are used as the model parameters of the final sign language translation model, thereby obtaining a trained sign language translation model.
[0127] The method of the embodiment of the present invention utilizes the sign language feature representation learned in the second stage model training, further combines the end-to-end reasoning capability of the large language model to perform the third stage model training, and controls the loss value of the sign language translation model within the convergence range through repeated iterative training, thereby further improving the accuracy of the output results of the sign language translation model and improving the accuracy of sign language translation.
[0128] Optionally, in an embodiment of the present invention, a sign language retrieval model can be constructed based on the encoder in the large language model and the visual encoder trained by the second-stage model, and the sign language retrieval model can be trained using multiple groups of training samples to achieve matching retrieval from sign language video to translated text.
[0129] Specifically, for any group of training samples, the sign language video samples in the training samples can be input into the visual encoder trained by the second-stage model to extract the sign language feature representation of the sign language video samples, and the sign language feature representation and the translated text labels in the training samples are sequentially input into the encoder in the large language model to obtain two feature representations output by the large language model encoder, and the preset symmetric cross entropy loss function is used to calculate the symmetric cross entropy loss value between the two feature representations to align and retrieve the two features in a high-dimensional space.
[0130] Furthermore, the model parameters of the sign language retrieval model are adjusted based on the symmetric cross entropy loss value. The training is iterated continuously in the above manner until the calculated symmetric cross entropy loss value converges or the number of training times reaches a preset maximum number of training times. The model training is then completed and a trained sign language retrieval model can be obtained.
[0131] The sign language retrieval model provided by the method of the embodiment of the present invention realizes the sign language retrieval task by utilizing the sign language feature representation learned in the aforementioned second-stage model training, and aims to find the corresponding spoken text in the translation text label database based on the sign language feature representation of the given sign language video.
[0132] The sign language translation device provided by the present invention is described below. The sign language translation device described below and the sign language translation method described above can be referenced to each other.
[0133] Figure 5 : is a schematic diagram of the structure of the sign language translation device provided by the present invention, such as Figure 5 As shown, it includes an acquisition module 510 and a translation module 520 which are connected in sequence.
[0134] The acquisition module 510 is used to acquire the sign language video to be translated;
[0135] The translation module 520 is used to input the sign language video into the sign language translation model to obtain the translated text of the sign language video output by the sign language translation model; the sign language translation model includes a visual encoder and a large language model, the visual encoder is used to extract the sign language feature representation of the sign language video, and the large language model is used to output the translated text of the sign language video based on the sign language feature representation; the sign language translation model is trained based on the sign language video samples and the corresponding translated text labels.
[0136] The sign language translation device described in this embodiment can be used to execute the above-mentioned sign language translation method embodiment. Its principles and technical effects are similar and will not be repeated here.
[0137] The sign language translation device of the embodiment of the present invention constructs a sign language translation model by using a visual encoder and a large language model, and uses sign language video samples and corresponding translation text labels to train the sign language translation model, and uses natural spoken language text supervision to perform sign language feature representation learning without word annotations, so that the trained sign language translation model can better understand the expression content contained in each video frame of the input sign language video, and extracts the features of the sign language video to be translated through the visual encoder in the model to obtain a universal sign language feature representation, and performs end-to-end reasoning with the large language model, so as to output high-quality sign language translation text, realize sign language translation without sign language word annotations, and also improve the sign language translation accuracy.
[0138] Figure 6 is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as Figure 6As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the sign language translation method provided by the above methods, the method comprising: obtaining a sign language video to be translated; inputting the sign language video into a sign language translation model to obtain a translation text of the sign language video output by the sign language translation model; the sign language translation model comprises a visual encoder and a large language model, the visual encoder is used to extract the sign language feature representation of the sign language video, and the large language model is used to output the translation text of the sign language video based on the sign language feature representation; the sign language translation model is trained based on the sign language video sample and the corresponding translation text label.
[0139] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0140] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the sign language translation method provided by the above methods, which includes: obtaining a sign language video to be translated; inputting the sign language video into a sign language translation model to obtain a translated text of the sign language video output by the sign language translation model; the sign language translation model includes a visual encoder and a large language model, the visual encoder is used to extract the sign language feature representation of the sign language video, and the large language model is used to output the translated text of the sign language video based on the sign language feature representation; the sign language translation model is trained based on sign language video samples and corresponding translated text labels.
[0141] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the sign language translation method provided by the above-mentioned methods, the method comprising: obtaining a sign language video to be translated; inputting the sign language video into a sign language translation model to obtain a translated text of the sign language video output by the sign language translation model; the sign language translation model comprises a visual encoder and a large language model, the visual encoder being used to extract a sign language feature representation of the sign language video, and the large language model being used to output a translated text of the sign language video based on the sign language feature representation; the sign language translation model is trained based on sign language video samples and corresponding translated text labels.
[0142] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0143] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0144] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A sign language translation method, characterized in that: include: Get the sign language video to be translated; Inputting the sign language video into a sign language translation model to obtain a translation text of the sign language video output by the sign language translation model; The sign language translation model includes a visual encoder and a large language model. The visual encoder is used to extract the sign language feature representation of the sign language video, and the large language model is used to output the translation text of the sign language video based on the sign language feature representation. The sign language translation model is trained based on sign language video samples and corresponding translation text labels.
2. The sign language translation method according to claim 1, characterized in that: The visual encoder includes a convolutional neural network, a temporal convolutional neural network and a Transformer encoder; The step of inputting the sign language video into a sign language translation model to obtain a translation text of the sign language video output by the sign language translation model includes: Inputting the sign language video into the convolutional neural network to extract convolutional features of the sign language video; Inputting the convolutional features into the temporal convolutional neural network to extract the temporal features of the sign language video; Inputting the temporal features into the Transformer encoder to obtain a sign language feature representation of the sign language video output by the Transformer encoder; The sign language feature representation of the sign language video is input into the large language model to obtain a translation text of the sign language video output by the large language model.
3. The sign language translation method according to claim 1, characterized in that: Before inputting the sign language video into the sign language translation model to obtain the translated text of the sign language video output by the sign language translation model, the method further includes: Taking the sign language video sample and the corresponding translation text label as a group of training samples, obtaining multiple groups of training samples; Using the multiple groups of training samples, sequentially performing first-stage model training, second-stage model training, and third-stage model training on the initial sign language translation model to obtain a trained sign language translation model; Among them, in the first stage model training, the initial sign language translation model includes a visual encoder, a text encoder and a visual-text alignment module, and the visual-text alignment module includes a linear layer and a layer normalization network connected in sequence; in the second stage model training, the initial sign language translation model includes a text decoder and a visual encoder trained by the first stage model; in the third stage model training, the initial sign language translation model includes a large language model and a visual encoder trained by the second stage model.
4. The sign language translation method according to claim 3, characterized in that: The step of performing the first stage model training on the initial sign language translation model using the multiple groups of training samples comprises: For any set of training samples, inputting the sign language video samples in the training samples into the visual encoder, extracting the sign language feature representation of the sign language video samples, and inputting the translated text labels in the training samples into the text encoder, extracting the text feature representation of the translated text labels; Inputting the sign language feature representation of the sign language video sample into the visual text alignment module for processing to obtain the image modality feature representation of the sign language video sample, and inputting the text feature representation of the translated text label into the visual text alignment module for processing to obtain the processed text modality feature representation of the translated text label; Using a preset symmetric cross entropy loss function, a symmetric cross entropy loss value between the image modality feature representation and the text modality feature representation is calculated; The model parameters of the visual encoder are adjusted based on the symmetric cross entropy loss value until the symmetric cross entropy loss value converges or the number of training times reaches a preset maximum number of training times, and the first stage model training is completed.
5. The sign language translation method according to claim 3, characterized in that: The step of performing second-stage model training on the initial sign language translation model using the multiple groups of training samples comprises: For any group of training samples, inputting the sign language video samples in the training samples into the visual encoder trained by the first stage model, and extracting the sign language feature representation of the sign language video samples; Inputting the sign language feature representation of the sign language video sample into the text decoder to obtain a predicted translation text corresponding to the sign language video sample; Using a preset cross entropy loss function, calculating a cross entropy loss value between the predicted translation text and the translation text label corresponding to the sign language video sample; The model parameters of the visual encoder are adjusted based on the cross entropy loss value until the cross entropy loss value converges or the number of training times reaches a preset maximum number of training times, and then the second stage model training is completed.
6. The sign language translation method according to claim 3, characterized in that: The step of performing the third stage model training on the initial sign language translation model using the multiple groups of training samples comprises: For any group of training samples, inputting the sign language video samples in the training samples into the visual encoder trained by the second stage model, and extracting the sign language feature representation of the sign language video samples; Inputting the sign language feature representation of the sign language video sample into the large language model to obtain a predicted translation text corresponding to the sign language video sample; Using a preset cross entropy loss function, calculating a cross entropy loss value between the predicted translation text and the translation text label corresponding to the sign language video sample; Based on the cross entropy loss value, the model parameters of the visual encoder and the large language model are adjusted until the cross entropy loss value converges or the number of training times reaches a preset maximum number of training times, thereby obtaining a trained sign language translation model.
7. A sign language translation device, characterized in that: include: An acquisition module is used to acquire the sign language video to be translated; A translation module is used to input the sign language video into a sign language translation model to obtain a translation text of the sign language video output by the sign language translation model; the sign language translation model includes a visual encoder and a large language model, the visual encoder is used to extract the sign language feature representation of the sign language video, and the large language model is used to output the translation text of the sign language video based on the sign language feature representation; the sign language translation model is trained based on sign language video samples and corresponding translation text labels.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the sign language translation method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the sign language translation method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the sign language translation method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Sign language translation method and device based on vision and word feature pre-training alignment
CN119785439A
Sign Language Translation Method and Device Based on Pre-Training Alignment of Visual and Lexical Features
CN119785439B
