Sign language translation method and device, electronic equipment and storage medium
The gated mapping unit fuses and maps visual features, sequence features, and recognition features in sign language video translation, solving the problem of feature mapping noise errors in deep learning sign language video translation and improving the performance and accuracy of the translation model.
Patent Information
- Application Number
- CN202410913549.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-10-01
AI Technical Summary
Existing sign language video translation solutions based on deep learning are prone to include noise and errors in the feature mapping process, which affects the overall performance of the translation model.
The gated mapping unit adaptively controls the feature mapping relationship, integrates visual features, sequence features and recognition features to remove errors and invalid information, so that the translation module receives more accurate feature information, thereby improving the performance of the sign language translation model.
It effectively improves the accuracy and overall performance of the sign language translation model, making the translation results more accurate.
Smart Images

Figure CN118736680A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of sign language translation, and in particular to a sign language translation method, device, electronic device and storage medium. Background Art
[0002] Sign language video translation is an important technology for cross-language communication. In particular, it provides convenience for the hearing-impaired while promoting understanding and communication between people of different cultural and language backgrounds. With the continuous development of artificial intelligence technology, the field of sign language video translation has also ushered in new breakthroughs. In recent years, with the development of advanced technologies such as deep learning, more and more automated sign language video translation solutions have begun to emerge.
[0003] The current deep learning-based sign language video translation solution can process continuous sign language videos into text that follows the sign language grammar according to the original action sequence. For example, the corresponding features in the video stream are first obtained, the features are simply mapped, and the mapped features are translated through the translation module. After the features are processed sequentially in this way, the features are directly mapped to the translation module, resulting in the feature information received by the translation module containing more noise and errors, thus affecting the overall performance of the sign language video translation model. Summary of the invention
[0004] The embodiments of the present invention provide a sign language translation method, device, electronic device and storage medium, which can adaptively control the feature mapping relationship through a gated mapping unit while removing errors and invalid information, so that the translation module can receive more accurate feature information, thereby improving the overall performance of the sign language translation model and further improving the accuracy of the sign language translation model in sign language translation.
[0005] In a first aspect, an embodiment of the present invention provides a sign language translation method, comprising:
[0006] When the pre-established initial model does not meet the preset conditions, the recognition module of the initial model is used to perform recognition processing on the training images of the pre-acquired training image set to obtain input data of the gated mapping unit of the initial model; wherein the input data includes visual features, sequence features and recognition features of the training images;
[0007] Performing feature fusion and feature mapping on the input data by the gated mapping unit to obtain gated mapping features;
[0008] The gate mapping feature is translated by the translation module of the initial model to obtain output data of the initial model,
[0009] Based on the output data and a predetermined loss function, the model parameters of the initial model are adjusted until the initial model meets the preset conditions, thereby obtaining a target model, wherein the target model is used to obtain a sign language translation text based on the sign language video.
[0010] In a second aspect, an embodiment of the present invention provides a sign language translation device, the device comprising:
[0011] A first data determination module is used for, when the pre-established initial model does not meet the preset conditions, performing recognition processing on the training images of the pre-acquired training image set through the recognition module of the initial model to obtain input data of the gated mapping unit of the initial model; wherein the input data includes visual features, sequence features and recognition features of the training images;
[0012] A feature determination module, used for performing feature fusion and feature mapping on the input data through the gated mapping unit to obtain a gated mapping feature;
[0013] A second data determination module is used to translate the gated mapping feature through the translation module of the initial model to obtain output data of the initial model,
[0014] A model determination module is used to adjust the model parameters of the initial model based on the output data and a predetermined loss function until the initial model meets the preset conditions, thereby obtaining a target model, wherein the target model is used to obtain a sign language translation text based on the sign language video.
[0015] In a third aspect, an embodiment of the present invention further 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, a sign language translation method as described in any one of the embodiments of the present invention is implemented.
[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a sign language translation method as described in any one of the embodiments of the present invention.
[0017] In an embodiment of the present invention, when the pre-established initial model does not meet the preset conditions, the training images of the pre-acquired training image set are recognized and processed by the recognition module of the initial model to obtain the input data of the gated mapping unit of the initial model; wherein the input data includes the visual features, sequence features and recognition features of the training images; the input data is feature fused and feature mapped by the gated mapping unit to obtain the gated mapping features; the gated mapping features are translated and processed by the translation module of the initial model to obtain the output data of the initial model, and the model parameters of the initial model are adjusted based on the output data and the predetermined loss function until the initial model meets the preset conditions to obtain the target model, wherein the target model is used to obtain the sign language translation text according to the sign language video. The method of the embodiment of the present invention can connect the recognition module and the translation module through the gated mapping unit, so that the initial model (sign language translation model) becomes an end-to-end model, while adaptively controlling the feature mapping relationship between the two modules, removing errors and invalid information, so that the functions of the two modules are effectively combined, thereby improving the overall performance of the sign language translation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A first flow chart of a sign language translation method provided by an embodiment of the present invention;
[0020] Figure 2 A schematic diagram of the structure of an initial model provided by an embodiment of the present invention;
[0021] Figure 3 A second flow chart of a sign language translation method provided by an embodiment of the present invention;
[0022] Figure 4 A third flow chart of a sign language translation method provided by an embodiment of the present invention;
[0023] Figure 5 A structural schematic diagram of a sign language translation device provided by an embodiment of the present invention;
[0024] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0026] Figure 1 This is a first flow chart of a sign language translation method provided in an embodiment of the present invention. The method in the embodiment of the present invention can adaptively control the feature mapping relationship while removing errors and invalid information, so that the translation module can receive more accurate feature information, thereby improving the overall performance of the sign language translation model, and further improving the accuracy of the sign language translation model in sign language translation. The method can be executed by a sign language translation device provided in an embodiment of the present invention, and the device can be implemented in software and / or hardware. The following embodiments will be described by taking the device integrated in an electronic device as an example. The electronic device can be a server or a computer device, etc., with reference to Figure 1 , the method may specifically include the following steps:
[0027] Step 101: When the pre-established initial model does not meet the preset conditions, the recognition module of the initial model performs recognition processing on the training images of the pre-acquired training image set to obtain input data of the gated mapping unit of the initial model.
[0028] Among them, the input data of the gated mapping unit includes the visual features, sequence features and recognition features of the training images. The training image set is a set of images obtained based on the pre-acquired sign language video stream, and the training image set is composed of frames of images (training images) containing sign language movements. The initial model is a model that has not been trained and cannot accurately translate the sign language in the sign language video. The preset condition can be that the loss function of the initial model reaches a preset convergence condition, etc. The initial model includes a recognition module, a gated mapping unit and a translation module. The recognition module is used to perform recognition processing on the training images of the training image set to obtain the visual features, sequence features and recognition features of the training images.
[0029] In an optional embodiment, when the initial model does not meet the preset conditions, a training image is selected from the training image set, and the training image is input into the recognition module of the initial model. The recognition module extracts visual features of the training image to obtain visual features of the training image. For example, a convolutional neural network, a recurrent neural network, a self-attention mechanism, or a pyramid pooling method is used to obtain the visual features of the training image. After obtaining the visual features, the visual features are sequenced to obtain sequence features. The sequence features are input into the classifier of the recognition module to obtain recognition features and recognition text.
[0030] In this scheme, when the initial model does not meet the preset conditions, a training image is selected from the training image set, and visual features of the training image are extracted to obtain the visual features of the training image; the attention of the visual features is calculated by a pre-set nonlinear activation function to obtain the attention score of the visual features; a Gaussian distribution matrix is generated based on the training image, and the visual features are weighted according to the attention score and the Gaussian distribution matrix to obtain the sequence features. The sequence features are identified and classified to obtain the recognition features of the training image. Furthermore, the input data of the gated mapping unit of the initial model is obtained according to the visual features, sequence features and recognition features of the training image.
[0031] Step 102: Perform feature fusion and feature mapping on the input data through a gated mapping unit to obtain gated mapping features.
[0032] The gated mapping unit is used to connect the recognition module and the translation module, and perform feature fusion and feature mapping on the visual features, sequence features and recognition features. The gated mapping features are the features after gated mapping processing of the visual features, sequence features and recognition features output by the recognition module. The gated mapping features are the input data of the translation module.
[0033] In practical applications, the input of the translation module usually contains some special symbols, which causes the output data of the recognition module to not match the translation module and cannot be directly used as the input data of the translation module. After obtaining the output data of the recognition module, the corresponding text can be found in the preset translation dictionary according to the recognition text output by the recognition module, and then the corresponding text can be encoded as the input of the translation module. However, the feature representation of the vocabulary in the translation dictionary in this way is single, which will cause information loss. Alternatively, through the fully connected layer of the neural network, the channel dimension of the output feature of the recognition module is scaled to adapt it to the input of the translation module. This method retains the information of the output feature of the recognition module, but it also contains more errors and noise.
[0034] In this scheme, after obtaining the visual features, sequence features and recognition features, they are input into the gated mapping unit. The gated mapping unit can fuse the visual features output by the recognition module with the sequence features to generate a comprehensive feature. This fusion is controlled by certain weights, which determine the relative importance of different features in the final mapping. Furthermore, the gated mapping unit can perform linear transformation and feature mapping on the comprehensive features obtained after feature fusion to obtain the gated mapping features (input data of the translation module). The gated mapping unit is a neural network structure that connects the translation module and the recognition module, making the initial model an end-to-end model. Through the gated mapping unit, while adaptively controlling the feature mapping relationship between the two modules, errors and invalid information are removed, so that the functions of the two modules are effectively combined, and the overall performance of the initial model is fully exploited.
[0035] Step 103: The gated mapping features are translated by the translation module of the initial model to obtain output data of the initial model.
[0036] Among them, the translation module is used to obtain the translated text of the training image according to the gated mapping features. The translation module includes a pre-trained translation model. The gated mapping features are input into the translation model to obtain the translated text of the training image. The translation models include neural machine translation models, sequence-to-sequence translation models, and attention mechanism translation models. In this scheme, the gated mapping features are translated by the translation module of the initial model to obtain the output data of the initial model, including: encoding and normalizing the gated mapping features by the learning layer of the translation module to obtain candidate features; decoding and text prediction of the candidate features by the decoder of the translation module to obtain the output data of the initial model.
[0037] Specifically, the translation module includes the mBART model, which is a multi-language pre-trained model based on the Transformer architecture. The mBART model includes a learning layer and a decoding layer, and the decoding layer includes a decoder. The learning layer is used to encode the input data, and the decoding layer is used to decode the candidate features.
[0038] In an optional embodiment, after obtaining the gated mapping features, the gated mapping features are input into the mBART model. The mBART model uses its multi-language pre-training capability to encode the input gated mapping features through its pre-trained learning layer (such as the Transformer layer), capture the semantic information in the gated mapping features and convert them into vector representations in a high-dimensional space. After obtaining the vector representation in the high-dimensional space, it is normalized and processed by a feedforward neural network to obtain candidate features. The candidate features are output to the decoding layer, and the decoder can output the optimal sequence using position encoding and a beam search algorithm. Furthermore, a language text (output data) corresponding to a sign language action is generated according to the optimal sequence, and the language text follows the grammatical rules and vocabulary habits of the sign language.
[0039] In the above steps, the multilingual pre-training capability of the mBART model is used to convert the gated mapping features into predicted text that conforms to the grammatical structure of sign language, thereby improving the overall performance of the sign language translation model.
[0040] Step 104: Adjust the model parameters of the initial model based on the output data and a predetermined loss function until the initial model meets preset conditions to obtain a target model.
[0041] Among them, the target model is used to obtain the sign language translation text according to the sign language video. The output data is the translation text automatically translated by the initial model according to the training image. The loss function is used to measure the gap between the output data and the corresponding true value. The output data (sample value) and the predetermined true value (sample label) are substituted into the predetermined loss function, and the model parameters of the initial model are adjusted according to the result of the loss function. After adjusting the model parameters, the next training image is selected from the training image set, and the steps of recognizing the training image are repeated to obtain the input data of the gated mapping unit of the initial model, and the initial model is trained. By continuously adjusting the model parameters of the initial model, the target model that meets the preset conditions is obtained.
[0042] Figure 2 This is a schematic diagram of the structure of the initial model provided by the embodiment of the present invention. Figure 2 As shown, the initial model includes a recognition module, a gated mapping unit and a translation module. The recognition module includes a visual processing unit, a Gaussian attention mechanism unit and a classifier. The recognition module includes a translation model. V is a visual feature, S is a sequence feature, and R is a recognition feature. The recognition module of the initial model performs visual processing on the training image to obtain a visual feature V. The visual feature V is processed by the Gaussian attention mechanism to obtain a sequence feature S, and the sequence feature is classified and recognized by the classifier to obtain a recognition feature R. The feature R is recognized to obtain a recognized text. V, S and R are input into the gated mapping unit to obtain the input data of the translation module. The input data of the translation module is input into the translation model, and the translated text is obtained through the translation model.
[0043] The technical solution of this embodiment is that when the pre-established initial model does not meet the preset conditions, the training images of the pre-acquired training image set are recognized and processed by the recognition module of the initial model to obtain the input data of the gated mapping unit of the initial model; wherein the input data includes the visual features, sequence features and recognition features of the training images; the input data is feature fused and feature mapped by the gated mapping unit to obtain the gated mapping features; the gated mapping features are translated and processed by the translation module of the initial model to obtain the output data of the initial model; the model parameters of the initial model are adjusted based on the output data and the predetermined loss function until the initial model meets the preset conditions to obtain the target model, wherein the target model is used to obtain the sign language translation text according to the sign language video. In this embodiment, the recognition module and the translation module can be connected by the gated mapping unit, so that the initial model (sign language translation model) becomes an end-to-end model, while adaptively controlling the feature mapping relationship between the two modules, removing errors and invalid information, so that the functions of the two modules are effectively combined, thereby improving the overall performance of the sign language translation model.
[0044] Figure 3The second flow chart of a sign language translation method provided by an embodiment of the present invention is a refinement of the above embodiment. The specific method can be as follows Figure 3 As shown, the method may include the following steps:
[0045] Step 301: When the pre-established initial model does not meet the preset conditions, visual features of the training image are extracted to obtain visual features of the training image.
[0046] The training images are images in the sign language video stream. The purpose of visual feature extraction on images is to extract useful information from the images for further analysis and processing. In this solution, the S3D network is used to extract features from the training images. The S3D network contains multiple convolutional layers, pooling layers, and fully connected layers. The S3D network extracts spatiotemporal features from video (image) data by combining two-dimensional convolution and three-dimensional convolution.
[0047] In an optional implementation, the input data is a sign language video stream consisting of multiple two-dimensional images (training images). Mathematically expressed as That is, T images of size c×h×w. X represents the training image set, x i Represents the i-th training image. The S3D network is used to extract visual features from the training image. The processing formula is:
[0048]
[0049] Among them, downsampling the time dimension T can be obtained The image of size c×h×w is compressed and then expanded into a vector of length C1. Represents the feature space. represents the S3D algorithm, V is the visual feature obtained after visual feature extraction, and v i is the i-th visual feature.
[0050] Step 302: Process the visual features according to a preset Gaussian attention mechanism to obtain sequence features of the training image.
[0051] Among them, the Gaussian attention mechanism is an attention module that combines the Gaussian function and the self-attention mechanism. The Gaussian attention mechanism can enhance the model's ability to pay attention to feature maps. The sequence feature is a feature vector obtained after the visual feature is processed by the Gaussian attention mechanism. In this scheme, optionally, the visual features are processed according to a pre-set Gaussian attention mechanism to obtain the sequence features of the training image, including: performing attention calculation on the visual features through a pre-set nonlinear activation function to obtain the attention score of the visual features; generating a Gaussian distribution matrix based on the training image, and performing weighted calculation on the visual features according to the attention score and the Gaussian distribution matrix to obtain the sequence features.
[0052] Among them, the Gaussian attention score can reflect the importance of different features to the final task, and the nonlinear activation functions include Sigmoid function, Tanh function, ReLU function and softmax function. Specifically, after obtaining the visual features, the visual features are multiplied by a set of learnable weight matrices to obtain the attention score of each feature. The attention scores are then normalized by a nonlinear activation function (such as softmax) to ensure that their sum is 1. In this way, the obtained attention scores can reflect the importance of different features to the final task.
[0053] After generating the attention score, the value of the sequence position of the feature in the training image is obtained to follow the Gaussian distribution. Based on this value, the Gaussian distribution matrix is obtained. The role of the Gaussian distribution matrix is similar to adding a mask to each feature. The visual features are weighted according to the attention score and the Gaussian distribution matrix to obtain the sequence features. Specifically, the calculation formula of the typical self-attention mechanism is:
[0054]
[0055] Among them, V is the visual feature, Q and K' are features generated by the visual feature sequence of the training image, their scale is the same as the sequence of visual features, and C represents the channel length of the sequence / vector. A represents the self-attention mechanism, and the Gaussian distribution value matrix G is located after the operation of generating the attention score and before the operation of generating the attention weight: specifically:
[0056]
[0057] Among them, A gauss is the Gaussian attention mechanism, and G is a matrix that obeys the Gaussian distribution value according to the sequence position:
[0058]
[0059] g irepresents the i-th row in the matrix G, j represents the j-th column, and σ represents the window value in the Gaussian distribution, that is, the number of adjacent frames. The visual feature V is processed by the Gaussian attention mechanism to obtain the sequence feature
[0060] In the above steps, the Gaussian attention mechanism enables the sign language translation model to pay more attention to the relationship between adjacent frames while utilizing the ability of the self-attention mechanism to perform global sequence modeling, thereby strengthening local dependencies. This further greatly improves the sign language translation model's ability to distinguish adjacent actions, thereby improving the overall performance of the sign language translation model.
[0061] Step 303: Identify and classify the sequence features to obtain identification features of the training image.
[0062] The recognition module includes a classifier, which is used to identify and classify the sequence features to obtain the recognition features of the training image. The classifier can understand the differences between different categories by learning a large number of labeled samples. Specifically, after obtaining the sequence feature S, the sequence feature is identified and classified to obtain the recognition features of the training image:
[0063]
[0064] Among them, R represents the recognition feature, W is the weight matrix, b is the bias vector, is the dictionary length, It means adding blank characters to the original dictionary.
[0065] Step 304: perform feature fusion on the visual features and the sequence features to obtain comprehensive features of the training image.
[0066] Feature fusion is to combine features extracted from different layers or branches to form a more discriminative and information-rich feature. In this solution, the visual feature V and the sequence feature S are fused by tensor splicing to obtain a comprehensive feature. Tensor splicing connects multiple tensors along a specified dimension to form a new tensor. By fusing visual features and sequence features through tensor splicing, the flexibility and expressiveness of the model can be greatly enhanced.
[0067] Step 305: Activate the comprehensive feature according to a predetermined activation function and an initial weight matrix to obtain a feature selection weight of the comprehensive feature.
[0068] Among them, the predetermined activation function can be a Sigmoid activation function, which compresses the feature value to between 0 and 1 and generates a feature selection weight of the comprehensive feature:
[0069]
[0070] Among them, w represents the feature selection weight, W[V,S] is the comprehensive feature, σ is the Sigmoid activation function, b is the bias vector, and C2 represents the channel length of the sequence / vector.
[0071] Step 306: Perform feature mapping on the recognition features based on the feature selection weights and the activation function to determine the gated mapping features.
[0072] Specifically, after obtaining the feature selection weight, feature mapping is performed on the recognition feature according to the feature selection weight to obtain the gated mapping feature. In this solution, optionally, feature mapping is performed on the recognition feature based on the feature selection weight and the activation function to determine the gated mapping feature, including: performing a linear transformation on the recognition feature based on the activation function and the initial weight matrix to obtain the transformed feature of the recognition feature; performing feature mapping on the transformed feature based on the feature selection weight and the activation function to obtain the gated mapping feature.
[0073] Specifically, the recognition feature R is linearly transformed through the ReLU activation function to expand the channel dimension of the feature and obtain the transformation feature R' of the recognition feature:
[0074]
[0075] Furthermore, the feature selection weights are multiplied by the corresponding positions and applied to the dimensionally expanded recognition features (transformed features). Finally, the channel dimension of the feature is reduced through linear transformation to obtain the gated mapping feature M, which is used as the input of the translation module:
[0076]
[0077] C3 represents the channel length of the sequence / vector. The above steps can perform feature fusion and feature mapping through the gated mapping unit, filter out errors and useless information in the features, and obtain features that can be directly input into the translation module, laying the foundation for improving the translation performance of the translation module.
[0078] Step 307: The gated mapping features are translated by the translation module of the initial model to obtain output data of the initial model.
[0079] Step 308: Adjust the model parameters of the initial model based on the output data and a predetermined loss function until the initial model meets preset conditions to obtain a target model.
[0080] Among them, the target model is used to obtain sign language translation text based on the sign language video.
[0081] In the technical solution of this embodiment, when the pre-established initial model does not meet the preset conditions, visual features of the training image are extracted to obtain the visual features of the training image. The visual features are processed according to the preset Gaussian attention mechanism to obtain the sequence features of the training image. The sequence features are identified and classified to obtain the recognition features of the training image. The visual features and the sequence features are feature fused to obtain the comprehensive features of the training image. The comprehensive features are activated according to the predetermined activation function and the initial weight matrix to obtain the feature selection weights of the comprehensive features. The recognition features are feature mapped based on the feature selection weights and the activation function to determine the gated mapping features. The gated mapping features are translated by the translation module of the initial model to obtain the output data of the initial model. The model parameters of the initial model are adjusted based on the output data and the predetermined loss function until the initial model meets the preset conditions to obtain the target model. Among them, the target model is used to obtain the sign language translation text based on the sign language video. In this embodiment, the Gaussian attention mechanism is used to make the sign language translation model pay more attention to the relationship between adjacent frames, strengthen local dependencies, and greatly improve the sign language translation model's ability to distinguish adjacent actions. Feature fusion and feature mapping are performed through the gated mapping unit to filter out errors and useless information in the features, and obtain features that can be directly input into the translation module, so that the functions of the recognition module and the translation module are effectively combined, thereby improving the overall performance of the sign language translation model.
[0082] Figure 4 The third flow chart of a sign language translation method provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the method may include the following steps:
[0083] Step 401: Obtain the video stream to be processed sent by the user.
[0084] The video stream to be processed may be a video for which sign language translation is required. Specifically, when a user needs to use a target model to translate the sign language appearing in a video, the video (video stream to be processed) may be sent to a server, and the server may receive the video stream to be processed sent by the user.
[0085] Step 402: Input the video stream to be processed into the target model, perform sign language translation on the video stream to be processed through the target model, and obtain a sign language translation text of the video stream to be processed.
[0086] Among them, the target model is a trained initial model, and the target model can perform sign language translation for the video stream to be processed. After receiving the video stream to be processed sent by the user, the target model recognizes the video stream to be processed through the recognition module to obtain the input data of the gated mapping unit. The gated mapping unit performs feature fusion and feature mapping on the input data to obtain the gated mapping feature. The target model translates the gated mapping feature through the translation module to obtain the sign language translation text of the video stream to be processed.
[0087] Step 403: Display the sign language translation text of the video stream to be processed to the user.
[0088] After the sign language translation text of the video stream to be processed is obtained, the sign language translation text is displayed to the user so that the user can view the sign language translation text.
[0089] In this embodiment, a video stream to be processed sent by a user is obtained, the video stream to be processed is input into a target model, and the video stream to be processed is translated into sign language by the target model to obtain a sign language translation text of the video stream to be processed. The sign language translation text of the video stream to be processed is displayed to the user. The method of this embodiment can accurately obtain the translation text of the video stream to be processed by using the target model, and display the translation text to the user, thereby improving the user experience.
[0090] Figure 5 Schematic diagram of the structure of a sign language translation device provided in an embodiment of the present invention, which is suitable for executing the sign language translation method provided in an embodiment of the present invention. Figure 5 As shown, the device may specifically include:
[0091] The first data determination module 501 is used for, when the pre-established initial model does not meet the preset conditions, performing recognition processing on the training images of the pre-acquired training image set through the recognition module of the initial model to obtain input data of the gated mapping unit of the initial model; wherein the input data includes visual features, sequence features and recognition features of the training images;
[0092] A feature determination module 502, configured to perform feature fusion and feature mapping on the input data through the gated mapping unit to obtain a gated mapping feature;
[0093] The second data determination module 503 is used to translate the gate mapping feature through the translation module of the initial model to obtain the output data of the initial model.
[0094] The model determination module 504 is used to adjust the model parameters of the initial model based on the output data and a predetermined loss function until the initial model meets the preset conditions to obtain a target model, wherein the target model is used to obtain a sign language translation text based on the sign language video.
[0095] Optionally, the first data determination module 501 is specifically used to: extract visual features from the training image to obtain visual features of the training image;
[0096] Processing the visual features according to a preset Gaussian attention mechanism to obtain sequence features of the training image;
[0097] The sequence features are identified and classified to obtain identification features of the training image.
[0098] Optionally, the first data determination module 501 is further used to: perform attention calculation on the visual feature through a preset nonlinear activation function to obtain an attention score of the visual feature;
[0099] A Gaussian distribution matrix is generated based on the training image, and the visual features are weightedly calculated according to the attention score and the Gaussian distribution matrix to obtain the sequence features.
[0100] Optionally, the feature determination module 502 is specifically used to: perform feature fusion on the visual feature and the sequence feature to obtain a comprehensive feature of the training image;
[0101] Activating the comprehensive feature according to a predetermined activation function and an initial weight matrix to obtain a feature selection weight of the comprehensive feature;
[0102] Feature mapping is performed on the recognition feature based on the feature selection weight and the activation function to determine the gated mapping feature.
[0103] Optionally, the feature determination module 502 is further used to: perform a linear transformation on the recognition feature based on the activation function and the initial weight matrix to obtain a transformation feature of the recognition feature;
[0104] Feature mapping is performed on the transformed features based on the feature selection weights and the activation function to obtain the gated mapping features.
[0105] Optionally, the second data determination module 503 is specifically configured to: encode and normalize the gated mapping features through the learning layer of the translation module to obtain candidate features;
[0106] The candidate features are decoded and text predicted by the decoder of the translation module to obtain output data of the initial model.
[0107] Optionally, the model determination module 504 is specifically used to: obtain a video stream to be processed sent by a user;
[0108] Inputting the video stream to be processed into the target model, performing sign language translation on the video stream to be processed through the target model, and obtaining a sign language translation text of the video stream to be processed;
[0109] The sign language translation text of the video stream to be processed is displayed to the user.
[0110] The sign language translation device provided in the embodiment of the present invention can execute the sign language translation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For the contents not described in detail in this embodiment, reference can be made to the description in any method embodiment of the present invention.
[0111] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, referring to Figure 6 , Figure 6 The electronic device 12 shown is only an example and should not limit the functions and scope of use of the embodiments of the present application. Figure 6 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0112] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0113] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0114] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0115] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0116] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although Figure 6 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0117] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, a sign language translation method provided in an embodiment of the present invention is implemented: when the pre-established initial model does not meet the preset conditions, the training images of the pre-acquired training image set are recognized and processed by the recognition module of the initial model to obtain input data of the gated mapping unit of the initial model; wherein the input data includes visual features, sequence features and recognition features of the training images; the gated mapping unit performs feature fusion and feature mapping on the input data to obtain gated mapping features; the translation module of the initial model translates the gated mapping features to obtain output data of the initial model; the model parameters of the initial model are adjusted based on the output data and a predetermined loss function until the initial model meets the preset conditions to obtain a target model, wherein the target model is used to obtain a sign language translation text based on the sign language video.
[0118] The embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, a sign language translation method provided by all the embodiments of the present invention is implemented: when the pre-established initial model does not meet the preset conditions, the training images of the pre-acquired training image set are recognized and processed by the recognition module of the initial model to obtain input data of the gated mapping unit of the initial model; wherein the input data includes visual features, sequence features and recognition features of the training images; the input data is subjected to feature fusion and feature mapping by the gated mapping unit to obtain gated mapping features; the gated mapping features are translated and processed by the translation module of the initial model to obtain output data of the initial model; the model parameters of the initial model are adjusted based on the output data and a predetermined loss function until the initial model meets the preset conditions to obtain a target model, wherein the target model is used to obtain a sign language translation text according to a sign language video. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electronic device, device or device of electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction-executing electronic device, apparatus, or device.
[0119] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction-executing electronic device, apparatus, or device.
[0120] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0121] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0122] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A sign language translation method, characterized in that: The method comprises: When the pre-established initial model does not meet the preset conditions, the recognition module of the initial model is used to perform recognition processing on the training images of the pre-acquired training image set to obtain input data of the gated mapping unit of the initial model; wherein the input data includes visual features, sequence features and recognition features of the training images; Performing feature fusion and feature mapping on the input data by the gated mapping unit to obtain gated mapping features; The gating mapping feature is translated by the translation module of the initial model to obtain output data of the initial model; Based on the output data and a predetermined loss function, the model parameters of the initial model are adjusted until the initial model meets the preset conditions, thereby obtaining a target model, wherein the target model is used to obtain a sign language translation text based on the sign language video.
2. The method according to claim 1, characterized in that The recognition module of the initial model performs recognition processing on the training images of the pre-acquired training image set to obtain input data of the gated mapping unit of the initial model, including: Extracting visual features from the training image to obtain visual features of the training image; Processing the visual features according to a preset Gaussian attention mechanism to obtain sequence features of the training image; The sequence features are identified and classified to obtain identification features of the training image.
3. The method according to claim 2, characterized in that The visual features are processed according to a preset Gaussian attention mechanism to obtain sequence features of the training image, including: Performing attention calculation on the visual feature through a preset nonlinear activation function to obtain an attention score of the visual feature; A Gaussian distribution matrix is generated based on the training image, and the visual features are weightedly calculated according to the attention score and the Gaussian distribution matrix to obtain the sequence features.
4. The method according to claim 1, characterized in that: The gated mapping unit performs feature fusion and feature mapping on the input data to obtain gated mapping features, including: Performing feature fusion on the visual features and the sequence features to obtain comprehensive features of the training image; Activating the comprehensive feature according to a predetermined activation function and an initial weight matrix to obtain a feature selection weight of the comprehensive feature; Feature mapping is performed on the recognition feature based on the feature selection weight and the activation function to determine the gated mapping feature.
5. The method according to claim 4, characterized in that Performing feature mapping on the recognition feature based on the feature selection weight and the activation function to determine the gated mapping feature includes: Performing a linear transformation on the recognition feature based on the activation function and the initial weight matrix to obtain a transformation feature of the recognition feature; Feature mapping is performed on the transformed features based on the feature selection weights and the activation function to obtain the gated mapping features.
6. The method according to claim 1, characterized in that The gating mapping feature is translated by the translation module of the initial model to obtain output data of the initial model, including: encoding and normalizing the gated mapping features through the learning layer of the translation module to obtain candidate features; The candidate features are decoded and text predicted by the decoder of the translation module to obtain output data of the initial model.
7. The method according to claim 1, characterized in that The method further comprises: Get the video stream to be processed sent by the user; Inputting the video stream to be processed into the target model, performing sign language translation on the video stream to be processed through the target model, and obtaining a sign language translation text of the video stream to be processed; The sign language translation text of the video stream to be processed is displayed to the user.
8. A sign language translation device, characterized in that: include: A first data determination module is used for, when the pre-established initial model does not meet the preset conditions, performing recognition processing on the training images of the pre-acquired training image set through the recognition module of the initial model to obtain input data of the gated mapping unit of the initial model; wherein the input data includes visual features, sequence features and recognition features of the training images; A feature determination module, used for performing feature fusion and feature mapping on the input data through the gated mapping unit to obtain a gated mapping feature; A second data determination module is used to translate the gated mapping feature through the translation module of the initial model to obtain output data of the initial model, A model determination module is used to adjust the model parameters of the initial model based on the output data and a predetermined loss function until the initial model meets the preset conditions, thereby obtaining a target model, wherein the target model is used to obtain a sign language translation text based on the sign language video.
9. 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, a sign language translation method as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a sign language translation method as described in any one of claims 1 to 7 is implemented.
