Motion sequence retrieval model training method and motion sequence retrieval method and device
The hierarchical semantic alignment model is used to align motion sequences and text features, solving the matching problem of complex motion and subtle changes, achieving accurate capture of superimposed motion and matching of text descriptions, and improving the accuracy of text to three-dimensional human motion retrieval. sex.
Patent Information
- Application Number
- CN202410674239.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-09-24
Smart Images

Figure CN118691784A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information retrieval technology, and in particular to a motion sequence retrieval model training method, a motion sequence retrieval method and a device. Background Art
[0002] Text-to-3D human motion retrieval is a challenging task in information retrieval, which aims to map queries from natural language descriptions to relevant motion sequences by building a common space where semantically similar texts and motions are closely aligned.
[0003] However, in real-world scenarios, multiple actions often occur simultaneously and are superimposed on the same character model. In addition, most motion changes occur locally and are subtle, which poses a huge challenge to accurately aligning motion sequences and corresponding text. Therefore, an effective solution is urgently needed to solve the above problems. Summary of the invention
[0004] In view of the problems existing in the prior art, the embodiments of the present invention provide a motion sequence retrieval model training method, a motion sequence retrieval method and a device.
[0005] The present invention provides a motion sequence retrieval model training method, comprising: obtaining a training set and a hierarchical semantic alignment model, wherein the training set comprises at least one sample pair, wherein the sample pair comprises a motion sequence and a corresponding description text, and the hierarchical semantic alignment model comprises a feature extraction layer, a coding layer and a semantic alignment layer; extracting any sample pair from the training set, inputting the motion sequence and the description text in the sample pair into the feature extraction layer for feature extraction, and obtaining frame-level features and text features; inputting the frame-level features and the text features into the coding layer for coding processing, and obtaining motion representation and motion probability distribution corresponding to the motion sequence, and text representation and text probability distribution corresponding to the description text; inputting the motion representation, the text representation, the motion probability distribution and the text probability distribution into the semantic alignment layer for semantic alignment processing, and obtaining representation alignment loss and distribution alignment loss; adjusting the model parameters of the hierarchical semantic alignment model according to the representation alignment loss and the distribution alignment loss, and continuously training the hierarchical semantic alignment model until a training stop condition is reached, and obtaining a motion sequence retrieval model.
[0006] According to a motion sequence retrieval model training method provided by the present invention, the feature extraction layer includes a text feature extraction layer and a motion feature extraction layer, and the motion feature extraction layer includes a skeleton feature extraction layer and a frame-level feature extraction layer; the motion sequence and the description text in the sample pair are input into the feature extraction layer for feature extraction to obtain frame-level features and text features, including: inputting the motion sequence in the sample pair into the skeleton feature extraction layer for feature extraction to obtain skeleton features, and inputting the skeleton features into the frame-level feature extraction layer for feature extraction to obtain frame-level features; inputting the description text in the sample pair into the text feature extraction layer for feature extraction to obtain text features.
[0007] According to a motion sequence retrieval model training method provided by the present invention, the encoding layer includes a frame-level feature encoding layer and a text feature encoding layer, the motion representation includes a global motion representation and a local motion representation, and the text representation includes a global text representation and a local text representation; the frame-level features and the text features are input into the encoding layer for encoding processing to obtain the motion representation and motion probability distribution corresponding to the motion sequence, and the text representation and text probability distribution corresponding to the description text, including: inputting the frame-level features into the frame-level feature encoding layer for encoding processing to obtain the global motion representation, local motion representation and motion probability distribution corresponding to the motion sequence; inputting the text features into the text feature encoding layer for encoding processing to obtain the global text representation, local text representation and text probability distribution corresponding to the text description.
[0008] According to a motion sequence retrieval model training method provided by the present invention, the semantic alignment layer includes a representation alignment layer and a probability alignment layer; the motion representation, the text representation, the motion probability distribution and the text probability distribution are input into the semantic alignment layer for semantic alignment processing to obtain a representation alignment loss and a distribution alignment loss, including: inputting the motion representation and the text representation into the representation alignment layer for semantic alignment processing to obtain the representation alignment loss; inputting the motion probability distribution and the text probability distribution into the probability alignment layer for semantic alignment processing to obtain the distribution alignment loss.
[0009] According to a motion sequence retrieval model training method provided by the present invention, the motion representation includes a global motion representation and a local motion representation, the text representation includes a global text representation and a local text representation; the representation alignment layer includes a global representation alignment layer and a local representation alignment layer; the representation alignment loss includes a global representation alignment loss and a local representation alignment loss; the step of inputting the motion representation and the text representation into the representation alignment layer for semantic alignment processing to obtain the representation alignment loss comprises: inputting the global motion representation and the global text representation into the global representation alignment layer for semantic alignment processing to obtain the global representation alignment loss; inputting the local motion representation and the local text representation into the local representation alignment layer for semantic alignment processing to obtain the local representation alignment loss.
[0010] According to a motion sequence retrieval model training method provided by the present invention, the probability alignment layer includes a probability distribution alignment layer and a probability distribution constraint layer; the distribution alignment loss includes a relative entropy loss and a probability distribution alignment loss; the inputting the motion probability distribution and the text probability distribution into the probability alignment layer for semantic alignment processing to obtain the distribution alignment loss comprises: inputting the motion probability distribution and the text probability distribution into the probability distribution alignment layer for semantic alignment processing to obtain the probability distribution alignment loss; inputting the motion probability distribution and the text probability distribution into the probability distribution constraint layer for relative entropy constraint processing to obtain the relative entropy loss.
[0011] According to a motion sequence retrieval model training method provided by the present invention, the representation alignment loss includes a global representation alignment loss and a local representation alignment loss; the distribution alignment loss includes a relative entropy loss and a probability distribution alignment loss; the model parameters of the hierarchical semantic alignment model are adjusted according to the representation alignment loss and the distribution alignment loss, including: obtaining a first contribution of the global representation alignment loss, a second contribution of the local representation alignment loss, a third contribution of the relative entropy loss, and a fourth contribution of the probability distribution alignment loss; adding the product of the global representation alignment loss and the first contribution, the product of the local representation alignment loss and the second contribution, the product of the relative entropy loss and the third contribution, and the product of the probability distribution alignment loss and the fourth contribution to obtain a total loss; and adjusting the model parameters of the hierarchical semantic alignment model according to the total loss.
[0012] The present invention also provides a motion sequence retrieval method, comprising: obtaining a query text and a motion sequence set, wherein the motion sequence set includes at least one initial motion sequence; inputting the query text and each of the initial motion sequences into a motion sequence retrieval model for retrieval to obtain a target motion sequence, wherein the motion sequence retrieval model is trained based on any one of the above-mentioned motion sequence retrieval model training methods.
[0013] The present invention also provides a motion sequence retrieval model training device, comprising: a first acquisition unit, configured to acquire a training set and a hierarchical semantic alignment model, wherein the training set includes at least one sample pair, wherein the sample pair includes a motion sequence and its corresponding description text, and the hierarchical semantic alignment model includes a feature extraction layer, a coding layer, and a semantic alignment layer; a feature extraction unit, configured to extract any sample pair from the training set, input the motion sequence and the description text in the sample pair into the feature extraction layer for feature extraction, and obtain frame-level features and text features; and a coding unit, configured to input the frame-level features and the text features into the coding layer. Encoding processing is performed to obtain motion representation and motion probability distribution corresponding to the motion sequence, as well as text representation and text probability distribution corresponding to the description text; a semantic alignment unit is configured to input the motion representation, the text representation, the motion probability distribution and the text probability distribution into the semantic alignment layer for semantic alignment processing to obtain representation alignment loss and distribution alignment loss; an adjustment unit is configured to adjust model parameters of the hierarchical semantic alignment model according to the representation alignment loss and the distribution alignment loss, and continue to train the hierarchical semantic alignment model until a training stop condition is reached to obtain a motion sequence retrieval model.
[0014] The present invention also provides a motion sequence retrieval device, comprising: a second acquisition unit, configured to query text and a motion sequence set, wherein the motion sequence set includes at least one initial motion sequence; a retrieval unit, configured to input the query text and each initial motion sequence into a motion sequence retrieval model for retrieval to obtain a target motion sequence, wherein the motion sequence retrieval model is trained based on any one of the above-mentioned motion sequence retrieval model training methods.
[0015] 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, it implements any one of the motion sequence retrieval model training methods or the motion sequence retrieval methods described above.
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the motion sequence retrieval model training method or the motion sequence retrieval method described above is implemented.
[0017] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the motion sequence retrieval model training methods or the motion sequence retrieval methods described above.
[0018] The motion sequence retrieval model training method, motion sequence retrieval method and device provided by the present invention are as follows: a training set and a hierarchical semantic alignment model are obtained, wherein the training set includes at least one sample pair, the sample pair includes a motion sequence and its corresponding description text, and the hierarchical semantic alignment model includes a feature extraction layer, a coding layer and a semantic alignment layer; any sample pair is extracted from the training set, and the motion sequence and the description text in the sample pair are input into the feature extraction layer for feature extraction to obtain frame-level features and text features; the frame-level features and the text features are input into the coding layer for coding processing to obtain motion representation and motion probability distribution corresponding to the motion sequence, and text representation and text probability distribution corresponding to the description text; the motion representation, the text representation, the motion probability distribution and the text probability distribution are input into the semantic alignment layer for semantic alignment processing to obtain representation alignment loss and distribution alignment loss; the model parameters of the hierarchical semantic alignment model are adjusted according to the representation alignment loss and the distribution alignment loss, and the hierarchical semantic alignment model is continuously trained until the training stop condition is reached to obtain a motion sequence retrieval model. By aligning motion representation and text representation, accurate semantic alignment between text and motion sequence is achieved; by aligning motion probability distribution and text probability distribution, the semantics of superimposed motion can be effectively captured, and the superimposed action can be accurately matched with the corresponding text description, thereby improving the accuracy of text-to-motion sequence retrieval. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] 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.
[0020] Figure 1 It is one of the flow charts of the motion sequence retrieval model training method provided by the present invention.
[0021] Figure 2This is the second flow chart of the motion sequence retrieval model training method provided by the present invention.
[0022] Figure 3 It is a schematic diagram of the process of aligning local representations provided by the present invention.
[0023] Figure 4 This is the third flow chart of the motion sequence retrieval model training method provided by the present invention.
[0024] Figure 5 This is one of the flow charts of the motion sequence retrieval method provided by the present invention.
[0025] Figure 6 This is the second flow chart of the motion sequence retrieval method provided by the present invention.
[0026] Figure 7 It is a structural schematic diagram of the motion sequence retrieval model training device provided by the present invention.
[0027] Figure 8 It is a structural schematic diagram of the motion sequence retrieval device provided by the present invention.
[0028] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0029] 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.
[0030] First, the relevant contents of the present invention are briefly described.
[0031] In related technologies, text and action sequences are represented as point embeddings for alignment. However, a single global embedding can only capture the rough semantics of the motion sequence and cannot accurately distinguish the complex semantics of complex motions. Therefore, how to perform more sensitive and sophisticated cross-modal alignment to accurately match these superimposed motions and subtle motion changes in text to 3D human motion retrieval has become a technical problem that needs to be solved urgently.
[0032] Combine the following Figure 1-Figure 9 The present invention describes a motion sequence retrieval model training method, a motion sequence retrieval method and a device.
[0033] Figure 1 is one of the flow charts of the motion sequence retrieval model training method provided by the present invention, such as Figure 1 As shown, the method includes the following steps 101 to 105.
[0034] Step 101: Obtain a training set and a hierarchical semantic alignment model, wherein the training set includes at least one sample pair, wherein the sample pair includes a motion sequence and its corresponding description text, and the hierarchical semantic alignment model includes a feature extraction layer, a coding layer, and a semantic alignment layer.
[0035] Specifically, the motion sequence is also three-dimensional human motion sequence information, including three-dimensional human motion video, motion position and its rotation invariant features and rotation feature vectors. The description text refers to the text describing the motion sequence. The hierarchical semantic alignment model can be a hierarchical semantic alignment neural network.
[0036] In practical applications, in order to accurately and efficiently perform hierarchical semantic alignment of motion sequences and description texts, we can first obtain at least one set of motion sequences to be aligned and their corresponding description texts, as well as a hierarchical semantic alignment model, that is, obtain a training set containing at least one sample pair and a hierarchical semantic alignment model.
[0037] Among them, the process of obtaining the training set can be: obtaining at least one motion sequence; for each motion sequence, performing action recognition on the motion sequence to obtain an action recognition result, and generating a description text corresponding to the motion sequence based on the action recognition result; combining each of the motion sequences and its corresponding description text to obtain at least one sample pair.
[0038] Step 102: extract any sample pair from the training set, input the motion sequence and description text in the sample pair into the feature extraction layer for feature extraction, and obtain frame-level features and text features.
[0039] Specifically, the frame-level feature refers to the frame-level feature corresponding to the motion sequence. The feature extraction layer can be a pre-trained feature extractor.
[0040] In practical applications, a sample pair is first extracted from the training set: the sample pairs can be extracted in a certain order so that each sample pair can participate in the model training process in a polling manner; or the sample pairs can be extracted randomly so that the sample pairs extracted in different iterative processes can be the same or different, thereby improving the randomness of training sample extraction and thus helping to improve the robustness of training.
[0041] In order to map the motion sequence and description text into a lower-dimensional feature space, thereby reducing the complexity and redundancy of the data and extracting a more compact, discriminative and representative feature representation, the motion sequence and description text can be respectively extracted through the feature extraction layer to obtain the frame-level features corresponding to the motion sequence and the text features corresponding to the description text.
[0042] Step 103: Input the frame-level features and the text features into the coding layer for coding processing to obtain the motion representation and motion probability distribution corresponding to the motion sequence, and the text representation and text probability distribution corresponding to the description text.
[0043] Specifically, the encoding layer can be a pre-trained encoder, that is, a feature encoder. The encoder can be built based on the Transformer model, which is a generative variational auto-encoder (VAE) based on the Transformer, and adds additional learnable special tags as input to obtain data representation and probability distribution.
[0044] In practical applications, frame-level features and text features can be input into the encoding layer, and the corresponding category embedding, mean parameters and standard deviation parameters are added to the frame-level features and text features for encoding, so as to obtain the motion representation and motion probability distribution corresponding to the frame-level features, as well as the text representation and text probability distribution corresponding to the text features, so as to perform subsequent multi-level semantic alignment operations.
[0045] Step 104: Input the motion representation, the text representation, the motion probability distribution and the text probability distribution into the semantic alignment layer for semantic alignment processing to obtain a representation alignment loss and a distribution alignment loss.
[0046] In practical applications, in order to semantically align data representation and probability distribution, the motion representation and text representation can be input into the semantic alignment layer for semantic alignment to obtain the representation alignment loss, and the motion probability distribution and text probability distribution can be input into the semantic alignment layer for semantic alignment to obtain the distribution alignment loss.
[0047] Step 105: According to the representation alignment loss and the distribution alignment loss, the model parameters of the hierarchical semantic alignment model are adjusted, and the hierarchical semantic alignment model is continuously trained until a training stop condition is reached, thereby obtaining a motion sequence retrieval model.
[0048] In practical applications, in order to better perform alignment training, the total loss can be determined based on the representation alignment loss and the distribution alignment loss, such as taking the weighted sum of the representation alignment loss and the distribution alignment loss as the total loss.
[0049] Furthermore, the model parameters of the hierarchical semantic alignment model are adjusted according to the total loss to make the alignment function of the hierarchical semantic alignment model more perfect, and then the hierarchical semantic alignment model is continued to be trained, that is, the steps of extracting any sample pair from the training set and the subsequent steps are re-executed until the training stop condition is reached, that is, the training is completed. At this time, the trained hierarchical semantic alignment model is the motion sequence retrieval model.
[0050] Among them, the training stop condition may include at least one of the following: the total loss is lower than the loss value threshold; the number of iterations reaches the iteration threshold; the rate of change of the total loss is lower than the loss change threshold.
[0051] The motion sequence retrieval model training method provided by the present invention realizes accurate semantic alignment between text and motion sequence by aligning motion representation and text representation; by aligning motion probability distribution and text probability distribution, the semantics of superimposed motion can be effectively captured, and the superimposed action can be accurately matched with the corresponding text description, thereby improving the accuracy of text-to-motion sequence retrieval.
[0052] Optionally, the feature extraction layer includes a text feature extraction layer and a motion feature extraction layer, and the motion feature extraction layer includes a skeleton feature extraction layer and a frame-level feature extraction layer; the step of inputting the motion sequence and the description text in the sample pair into the feature extraction layer for feature extraction to obtain frame-level features and text features includes: inputting the motion sequence in the sample pair into the skeleton feature extraction layer for feature extraction to obtain skeleton features, and inputting the skeleton features into the frame-level feature extraction layer for feature extraction to obtain frame-level features; and inputting the description text in the sample pair into the text feature extraction layer for feature extraction to obtain text features.
[0053] Specifically, the text feature extraction layer can be a pre-trained text feature extractor, that is, the text feature extraction module is built based on the Transformer model, which is a model based on the Transformer bidirectional encoder representation (BERT, Bidirectional Encoder Representations from Transformers) architecture, and text feature extraction is performed by pre-training and freezing parameters. The motion feature extraction layer can be a pre-trained motion feature extractor. The skeleton feature extraction layer, that is, the motion sequence skeleton feature extraction module, can be a model based on skinned vertices, which can accurately represent various body shapes in natural human postures. Its parameters are obtained through data learning, including the remaining posture templates, mixing weights, posture-related mixed shapes, identity-related mixed shapes, and regressors from vertices to joint positions. The frame-level feature extraction layer, that is, the motion sequence frame-level feature extraction module, is composed of two layers of convolution with a filter size of 4 and a step size of 2 to extract frame-level features from skeleton features.
[0054] In practical applications, in order to map motion sequences and description texts into a lower-dimensional feature space, thereby reducing the complexity and redundancy of the data, and extracting more compact, discriminative and representative feature representations to improve the accuracy of feature representations, text feature extraction can be performed on the description text through a text feature extraction layer to obtain text features; and skeleton feature extraction can be performed on the motion sequence through a skeleton feature extraction layer to obtain skeleton features, and further, frame-level feature extraction can be performed on the skeleton features through a frame-level feature extraction layer to obtain frame-level features.
[0055] Specifically, see Figure 2 , Figure 2 This is the second flow chart of the motion sequence retrieval model training method provided by the present invention. The skeleton feature extraction layer in the motion feature extraction layer performs skeleton feature extraction on the motion sequence M. Extraction, where H represents the number of input frames, J represents the number of skeleton nodes, represents the feature dimension of the skeleton feature, and R represents the number of skeleton nodes; further, the frame-level feature extraction layer in the motion feature extraction layer extracts the skeleton feature m s Perform frame-level feature extraction to obtain frame-level features in Represents the dimension of motion embedding.
[0056] The text feature extraction layer extracts features from the text description T to obtain text features Where L represents the number of words, Represents the dimension of text embedding.
[0057] Optionally, the encoding layer includes a frame-level feature encoding layer and a text feature encoding layer, the motion representation includes a global motion representation and a local motion representation, and the text representation includes a global text representation and a local text representation; the frame-level features and the text features are input into the encoding layer for encoding processing to obtain the motion representation and motion probability distribution corresponding to the motion sequence, as well as the text representation and text probability distribution corresponding to the description text, including: inputting the frame-level features into the frame-level feature encoding layer for encoding processing to obtain the global motion representation, local motion representation and motion probability distribution corresponding to the motion sequence; inputting the text features into the text feature encoding layer for encoding processing to obtain the global text representation, local text representation and text probability distribution corresponding to the text description.
[0058] Specifically, the frame-level feature encoding layer may be an encoder that specifically processes frame-level features. The text feature encoding layer may be an encoder that specifically processes text features.
[0059] In practical applications, in order to improve the accuracy and comprehensiveness of data representation and probability distribution, the text representation can be encoded through the text feature encoding layer to obtain the text global representation, text local representation and text probability distribution corresponding to the text description; and the frame-level features can be encoded through the frame-level feature encoding layer to obtain the motion global representation, motion local representation and motion probability distribution corresponding to the motion sequence.
[0060] Specifically, see Figure 2 , the frame-level feature encoding layer encodes the frame-level feature m into global motion representation, motion probability distribution and local motion representation. First, the frame-level feature Join [CLS] m (Category embedding corresponding to frame-level features), [MU] m (mean parameter of frame-level features) and [SIGMA] m (Standard deviation parameter of frame-level features) is specially embedded and sent to the frame-level feature encoding layer E m Encode, that is, m g , m μ , m ∑ , m l =E m ([[CLS] m , [MU] m , [SIGMA] m , m]). Among them, m g is the global representation of motion, m μ and m ∑ are the mean and variance of the motion probability distribution, is the local representation of motion, d c Represents the dimension of local representation.
[0061] The text feature encoding layer encodes the text feature t into text global representation, text local representation and text probability distribution. First, the text feature Join [CLS] t (Category embedding corresponding to text features), [MU] t (mean parameter of text features) and [SIGMA] t (Standard deviation parameter of text features) and (special embedding), then sent to the text encoder E t Encode, that is, t g , t μ , t ∑ , t l =E t ([[CLS] t , [MU] t , [SIGMA] t , t]). Among them, t gis the global representation of text features, t μ and t ∑ are the mean and variance of the probability distribution of text features, It is a local representation of text features.
[0062] Optionally, the semantic alignment layer includes a representation alignment layer and a probability alignment layer; the motion representation, the text representation, the motion probability distribution and the text probability distribution are input into the semantic alignment layer for semantic alignment processing to obtain a representation alignment loss and a distribution alignment loss, including: inputting the motion representation and the text representation into the representation alignment layer for semantic alignment processing to obtain the representation alignment loss; inputting the motion probability distribution and the text probability distribution into the probability alignment layer for semantic alignment processing to obtain the distribution alignment loss.
[0063] In practical applications, in order to semantically align data representation and probability distribution and improve the efficiency and accuracy of semantic alignment, the motion representation and text representation can be semantically aligned through the representation alignment layer to obtain the representation alignment loss, and the motion probability distribution and text probability distribution can be semantically aligned through the probability alignment layer to obtain the distribution alignment loss.
[0064] Optionally, the motion representation includes a global motion representation and a local motion representation, the text representation includes a global text representation and a local text representation; the representation alignment layer includes a global representation alignment layer and a local representation alignment layer; the representation alignment loss includes a global representation alignment loss and a local representation alignment loss; the step of inputting the motion representation and the text representation into the representation alignment layer for semantic alignment processing to obtain the representation alignment loss includes: inputting the global motion representation and the global text representation into the global representation alignment layer for semantic alignment processing to obtain the global representation alignment loss; inputting the local motion representation and the local text representation into the local representation alignment layer for semantic alignment processing to obtain the local representation alignment loss.
[0065] Specifically, the global representation alignment layer, i.e., the global semantic alignment module of motion sequence and text, is used to semantically align the global representation of motion sequence and text. The local representation alignment layer, i.e., the local semantic alignment module of motion sequence and text, is used to aggregate motion sequence and text into a batch of local descriptors and perform fine-grained alignment on the features aggregated into the local descriptors.
[0066] In practical applications, in order to perform global semantic alignment, the global representation alignment layer is used to semantically align the global motion representation and the global text representation, thereby obtaining the global alignment loss. In order to better align local and slightly changing motion, a fine-grained alignment method based on descriptors is used to adaptively allocate frame-level and word-level features through a set of descriptors through the local representation alignment layer, thereby achieving comprehensive semantic alignment of local features, that is, aggregating motion sequences (local motion representations) and description texts (local text representations) into a batch of local descriptors, and fine-grained alignment of the representations aggregated into local descriptors.
[0067] Specifically, see Figure 2 , the global representation alignment layer is used to semantically align the motion global representation and the text global representation. The global representation alignment layer uses the following formula for alignment: L Global =L info (t g , m g )+L info (m g , t g );
[0068] Among them, L Global refers to the global alignment loss; x and y are the data that need to be aligned, here it refers to m g and t g ; n represents the index of the positive sample, q represents the index of the negative sample, that is, x n and n is a set of positive samples, x n and q is a set of negative samples; τ represents the temperature parameter, s represents the cosine similarity, and the calculation method is as follows:
[0069] See also Figure 2 and Figure 3 , Figure 3 , which is a schematic diagram of the process of aligning local representations provided by the present invention. The local representation alignment layer aligns the motion sequence (motion local representation m l ) and description text (text local representation t l ) are aggregated into a batch of local descriptors, and the features aggregated into the local descriptors are fine-grainedly aligned. Specifically, depending on m g and t g To calculate the motion significance score G i , and suppress meaningless local features through gating mechanism The calculation process is:
[0070] Where mi ∈m l Similarly, the text saliency score after the gating mechanism is obtained Optionally, through K shared descriptors A cross-modal descriptor set is established, and a warm-up strategy is used to initialize the descriptor to provide semantic supplementation. For the jth descriptor, the similarity between the motion representation and the descriptor is calculated, and the filtered motion representation is used Assigned to the corresponding descriptor, the feature corresponding to the jth descriptor The calculation process is:
[0071] Among them, τ represents the temperature parameter, / / · / / 2 represents L2 normalization. Similarly, the local representation of the i-th filtered text The same process can be used to assign the jth descriptor. After assigning each local representation to a descriptor, the motion representation based on the descriptor is obtained. and text representation in And the descriptor-based motion representation p m and text representation p t Alignment is performed. Specifically, in the embodiment of the present invention, the local representation alignment loss L DFA The calculation formula is: L DFA =L info (p t , p m )+L info (p m , p t ).
[0072] Optionally, the probability alignment layer includes a probability distribution alignment layer and a probability distribution constraint layer; the distribution alignment loss includes a relative entropy loss and a probability distribution alignment loss; the step of inputting the motion probability distribution and the text probability distribution into the probability alignment layer for semantic alignment processing to obtain the distribution alignment loss comprises: inputting the motion probability distribution and the text probability distribution into the probability distribution alignment layer for semantic alignment processing to obtain the probability distribution alignment loss; inputting the motion probability distribution and the text probability distribution into the probability distribution constraint layer for relative entropy constraint processing to obtain the relative entropy loss.
[0073] Specifically, the probability distribution constraint layer, i.e., the multidimensional probability distribution constraint module, is used to constrain the motion probability distribution and the text probability distribution to prevent the probability distribution from collapsing. The probability distribution alignment layer, i.e., the motion sequence and text probability distribution alignment module, is used to match and align the motion probability distribution and the text probability distribution. The relative entropy loss is also the KL loss determined based on the KL (Kullback-Leibler) divergence.
[0074] In practical applications, before probability distribution alignment, in order to prevent the probability distribution of motion features and text features from collapsing, the probability distribution can be constrained by calculating the KL divergence with the unit Gaussian distribution to obtain the KL loss. At the same time, in order to better represent the coupled semantics of the complex superimposed motion and align the superimposed motion with the text, the data instance can be mapped to a multidimensional probability embedding corresponding to various superimposed motions, and then the text motion alignment can be modeled as distribution matching to achieve precise semantic alignment, that is, the motion probability distribution and the text probability distribution are semantically aligned through the probability distribution alignment layer to obtain the probability distribution alignment loss.
[0075] Specifically, see Figure 2 , the probability distribution constraint layer constrains the motion probability distribution and the text probability distribution to prevent the probability distribution from collapsing. The mean and variance of the motion probability distribution are m μ and m ∑ , the mean and variance of the text probability distribution are t μ and t ∑ , then the motion probability distribution d m With the text probability distribution d t It can be expressed as:
[0076] To prevent d m and d t The probability collapse occurs, and d m and d t With unit Gaussian distribution Perform KL divergence calculation to constrain, L KL Represents the overall KL loss:
[0077] The probability distribution alignment layer is used to match and align the motion probability distribution with the text probability distribution. The motion probability distribution d is calculated by Dist. m With the text probability distribution d t Because the same motion model may have multiple superimposed actions at the same time, it is necessary to calculate and measure the semantic overlap Dist between the two:
[0078] Where ∑ represents m ∑ and t∑ The output range of Dist is from 0 to 1, where 0 means no overlap and 1 means complete overlap.
[0079] In addition, the present invention reduces d by the following formula m With d t The distribution difference, probability distribution alignment loss L PDA :
[0080] Optionally, the representation alignment loss includes a global representation alignment loss and a local representation alignment loss; the distribution alignment loss includes a relative entropy loss and a probability distribution alignment loss; and adjusting the model parameters of the hierarchical semantic alignment model according to the representation alignment loss and the distribution alignment loss includes: obtaining a first contribution of the global representation alignment loss, a second contribution of the local representation alignment loss, a third contribution of the relative entropy loss, and a fourth contribution of the probability distribution alignment loss; adding the product of the global representation alignment loss and the first contribution, the product of the local representation alignment loss and the second contribution, the product of the relative entropy loss and the third contribution, and the product of the probability distribution alignment loss and the fourth contribution to obtain a total loss; and adjusting the model parameters of the hierarchical semantic alignment model according to the total loss.
[0081] Exemplarily, the global representation alignment loss L is obtained Global The first contribution of is 1; the local representation alignment loss L DFA The second contribution of is β; the relative entropy loss is L KL The third contribution and probability distribution alignment loss L PDA The fourth contribution is α, which is the total loss L in the training phase. Total For: L Total =L Global +α·(L PDA +L KL )+β·L DFA Among them, α and β are hyperparameters that balance the semantic contributions of different alignment levels.
[0082] In addition, the hierarchical semantic alignment model also includes a multi-level semantic balancing layer, which is used to keep the semantic contributions of different alignment levels in the training phase and the reasoning phase consistent, so as to ensure that the contribution of different similarities in the reasoning phase to the final retrieval results is consistent with the training process.
[0083] Combine the following Figure 4 The motion sequence retrieval model training method provided by the present invention is further explained. Figure 4This is the third flow chart of the motion sequence retrieval model training method provided by the present invention.
[0084] The three-dimensional human motion video, motion position and its rotation-invariant features and rotation feature vectors in the training set are input into the motion sequence skeleton feature extraction module to obtain the skeleton features corresponding to the motion sequence.
[0085] The skeleton features are input into the motion sequence frame-level feature extraction module to obtain the frame-level features corresponding to the skeleton features.
[0086] The frame-level features of the motion sequence are input into the motion feature encoder module to obtain the global representation, local representation and probability distribution of the motion sequence.
[0087] The description text in the training set is input into the text feature extraction module to obtain the text features corresponding to the motion sequence.
[0088] The text features describing the text are input into the text feature encoder module to obtain the global representation, local representation and probability distribution of the text.
[0089] The global representations of the motion sequence and the description text are input into the motion sequence and text global semantic alignment module, and the global representations of the motion sequence and the text are semantically aligned to obtain the global representation alignment loss.
[0090] The probability distribution of motion sequence and description text is input into the multidimensional probability distribution constraint module, the probability distribution of motion sequence and text is constrained, the KL divergence of the probability distribution of motion sequence and text and the unit Gaussian distribution is calculated, and the two are added to obtain the overall KL loss.
[0091] The probability distribution of the motion sequence and the description text is input into the motion sequence and text probability distribution alignment module, and the probability distribution of the motion sequence and the text are matched and aligned to obtain the probability distribution alignment loss.
[0092] The local representations of motion sequence and description text are input into the motion sequence and text local semantic alignment module, the local representations of motion sequence and text are aggregated into a batch of local descriptors, and the representations aggregated into local descriptors are fine-grainedly aligned to obtain the local representation alignment loss.
[0093] Based on the weighted fusion value of global representation alignment loss, KL loss, probability distribution alignment loss and local representation alignment loss, the hierarchical semantic alignment neural network for 3D human motion retrieval is trained to obtain the hierarchical semantic alignment neural network for 3D human motion retrieval trained based on the training set.
[0094] The motion sequence retrieval model provided by the embodiment of the present invention combines global semantic alignment with probability distribution-based alignment and descriptor-based fine-grained alignment, thereby achieving precise semantic alignment between text and motion sequences. The probability distribution-based alignment method projects the text and motion sequence into a multi-dimensional probabilistic embedding, which can effectively capture the semantics of superimposed motion, and accurately matches the superimposed action with the corresponding text description by aligning the distribution. The descriptor-based fine-grained alignment method adaptively assigns the local representation of text and motion to a set of descriptors with shared semantics, and performs detailed interactions between these assigned features, thereby achieving fine-grained semantic alignment. Based on the above method, precise semantic alignment between text and motion sequences is achieved, thereby improving the accuracy of text-to-motion sequence retrieval.
[0095] Figure 5 is one of the flow charts of the motion sequence retrieval method provided by the present invention, such as Figure 5 As shown, the method includes the following steps 501 and 502.
[0096] Step 501: Acquire a query text and a motion sequence set, wherein the motion sequence set includes at least one initial motion sequence.
[0097] Step 502: Input the query text and each of the initial motion sequences into a motion sequence retrieval model for retrieval to obtain a target motion sequence. The motion sequence retrieval model is trained based on any of the above-mentioned motion sequence retrieval model training methods.
[0098] In practical applications, a motion sequence set and a query text are obtained, wherein the motion sequence set includes at least one initial motion sequence, and each initial motion sequence includes a three-dimensional human motion video, a motion position and its rotation-invariant features and a rotation feature vector.
[0099] Furthermore, multiple three-dimensional human motion videos to be retrieved, motion positions and their rotation-invariant features and rotation feature vectors, and retrieval texts are input into a hierarchical semantic alignment neural network for three-dimensional human motion retrieval, namely, a motion sequence retrieval model. A multi-level semantic balancing module is used to keep the semantic contributions of different alignment levels in the training stage and the reasoning stage consistent, so as to ensure that the contributions of different similarities in the reasoning stage to the final retrieval results are consistent with the training process, and finally the retrieval results of the motion sequence and the query text are obtained.
[0100] Specifically, the motion sequence retrieval model is based on a multi-level semantic balance module to keep the semantic contributions of different alignment levels in the training phase and the inference phase consistent, and calculate the similarity between the query text and each initial motion sequence through the semantic contribution. The first Q initial motion sequences with the highest similarity are determined as the target motion sequences.
[0101] For example, in the reasoning (retrieval) stage, given i description texts and j initial motion sequences, Calculate the global representation similarity by Calculate the probability distribution similarity by Calculate the local representation similarity, then the final similarity S i,j for:
[0102] The inference stage uses the same α and β as the training stage to ensure that the contribution of different similarities to the final retrieval is consistent with the training process.
[0103] The motion sequence retrieval method provided by the present invention realizes accurate semantic alignment between text and motion sequence by aligning motion representation and text representation; by aligning motion probability distribution and text probability distribution, the semantics of superimposed motion can be effectively captured, and the superimposed action can be accurately matched with the corresponding text description, thereby improving the accuracy of text-to-motion sequence retrieval.
[0104] Figure 6 FIG. 2 is a flow chart of the motion sequence retrieval method provided by the present invention. Figure 6 As shown: a query text and a motion sequence set are obtained, wherein the motion sequence set includes at least one initial motion sequence; the semantic contributions of different alignment levels in the training phase and the reasoning phase are kept consistent through a multi-level semantic balancing module to ensure that the contribution of different similarities in the reasoning phase to the final retrieval result is consistent with the training process, and the similarity between the retrieval text and each initial motion sequence is output; the initial motion sequence with the highest similarity is selected as the target motion sequence and output to complete the retrieval.
[0105] In order to evaluate the accuracy of the retrieval results of the motion sequence retrieval model in the embodiment of the present invention, the test results of the present invention are compared with the existing three-dimensional human motion retrieval methods. The hierarchical semantic alignment neural network for three-dimensional human motion retrieval outperforms other methods and achieves the best performance. The test was conducted on the test sets of HumanML3D and KIT Motion-Language, 3D human motion datasets with text descriptions. On the most stringent text-to-motion retrieval index R@1, the motion sequence retrieval model of the present invention achieved the most advanced results, indicating that the proposed method can achieve accurate text-to-3D human motion retrieval by achieving fine-grained semantic alignment. On the index Rsum that reports the overall retrieval performance, the motion sequence retrieval model of the present invention surpasses the current state-of-the-art work with scores of 244.88 and 392.74 on HumanML3D and KIT-ML, respectively. This proves the superiority of applying hierarchical semantic alignment technology to text-to-3D human motion retrieval.
[0106] The motion sequence retrieval model training device provided by the present invention is described below. The motion sequence retrieval model training device described below and the motion sequence retrieval model training method described above can be referenced to each other.
[0107] Figure 7 is a schematic diagram of the structure of the motion sequence retrieval model training device provided by the present invention, such as Figure 7 As shown, the motion sequence retrieval model training device includes: a first acquisition unit 701, a feature extraction unit 702, an encoding unit 703, a semantic alignment unit 704 and an adjustment unit 705.
[0108] The first acquisition unit 701 is configured to acquire a training set and a hierarchical semantic alignment model, wherein the training set includes at least one sample pair, wherein the sample pair includes a motion sequence and its corresponding description text, and the hierarchical semantic alignment model includes a feature extraction layer, a coding layer, and a semantic alignment layer.
[0109] The feature extraction unit 702 is configured to extract any sample pair from the training set, input the motion sequence and description text in the sample pair into the feature extraction layer for feature extraction, and obtain frame-level features and text features.
[0110] The encoding unit 703 is configured to input the frame-level features and the text features into the encoding layer for encoding processing to obtain the motion representation and motion probability distribution corresponding to the motion sequence, and the text representation and text probability distribution corresponding to the description text.
[0111] The semantic alignment unit 704 is configured to input the motion representation, the text representation, the motion probability distribution and the text probability distribution into the semantic alignment layer for semantic alignment processing to obtain a representation alignment loss and a distribution alignment loss.
[0112] The adjustment unit 705 is configured to adjust the model parameters of the hierarchical semantic alignment model according to the representation alignment loss and the distribution alignment loss, and continue to train the hierarchical semantic alignment model until the training stop condition is reached to obtain a motion sequence retrieval model.
[0113] Optionally, the feature extraction layer includes a text feature extraction layer and a motion feature extraction layer, and the motion feature extraction layer includes a skeleton feature extraction layer and a frame-level feature extraction layer; the feature extraction unit 702 is further configured to: input the motion sequence in the sample pair into the skeleton feature extraction layer for feature extraction to obtain skeleton features, and input the skeleton features into the frame-level feature extraction layer for feature extraction to obtain frame-level features; input the description text in the sample pair into the text feature extraction layer for feature extraction to obtain text features.
[0114] Optionally, the encoding layer includes a frame-level feature encoding layer and a text feature encoding layer, the motion representation includes a global motion representation and a local motion representation, and the text representation includes a global text representation and a local text representation; the encoding unit 703 is further configured to: input the frame-level feature into the frame-level feature encoding layer for encoding processing to obtain the global motion representation, local motion representation and motion probability distribution corresponding to the motion sequence; input the text feature into the text feature encoding layer for encoding processing to obtain the global text representation, local text representation and text probability distribution corresponding to the text description.
[0115] Optionally, the semantic alignment layer includes a representation alignment layer and a probability alignment layer; the semantic alignment unit 704 is further configured to: input the motion representation and the text representation into the representation alignment layer for semantic alignment processing to obtain the representation alignment loss; input the motion probability distribution and the text probability distribution into the probability alignment layer for semantic alignment processing to obtain the distribution alignment loss.
[0116] Optionally, the motion representation includes a global motion representation and a local motion representation, the text representation includes a global text representation and a local text representation; the representation alignment layer includes a global representation alignment layer and a local representation alignment layer; the representation alignment loss includes a global representation alignment loss and a local representation alignment loss; the semantic alignment unit 704 is further configured to: input the global motion representation and the global text representation into the global representation alignment layer for semantic alignment processing to obtain a global representation alignment loss; input the local motion representation and the local text representation into the local representation alignment layer for semantic alignment processing to obtain a local representation alignment loss.
[0117] Optionally, the probability alignment layer includes a probability distribution alignment layer and a probability distribution constraint layer; the distribution alignment loss includes a relative entropy loss and a probability distribution alignment loss; the semantic alignment unit 704 is further configured to: input the motion probability distribution and the text probability distribution into the probability distribution alignment layer for semantic alignment processing to obtain the probability distribution alignment loss; input the motion probability distribution and the text probability distribution into the probability distribution constraint layer for relative entropy constraint processing to obtain the relative entropy loss.
[0118] Optionally, the representation alignment loss includes a global representation alignment loss and a local representation alignment loss; the distribution alignment loss includes a relative entropy loss and a probability distribution alignment loss; the adjustment unit 705 is further configured to: obtain a first contribution of the global representation alignment loss, a second contribution of the local representation alignment loss, a third contribution of the relative entropy loss, and a fourth contribution of the probability distribution alignment loss; add the product of the global representation alignment loss and the first contribution, the product of the local representation alignment loss and the second contribution, the product of the relative entropy loss and the third contribution, and the product of the probability distribution alignment loss and the fourth contribution to obtain a total loss; and adjust the model parameters of the hierarchical semantic alignment model according to the total loss.
[0119] The motion sequence retrieval device provided by the present invention is described below. The motion sequence retrieval device described below and the motion sequence retrieval method described above can be referenced to each other.
[0120] Figure 8 is a schematic diagram of the structure of the motion sequence retrieval device provided by the present invention, such as Figure 8 As shown, the motion sequence retrieval device includes: a second acquisition unit 801 and a retrieval unit 802.
[0121] The second acquisition unit 801 is configured to query text and a motion sequence set, where the motion sequence set includes at least one initial motion sequence.
[0122] The retrieval unit 802 is configured to input the query text and each of the initial motion sequences into a motion sequence retrieval model for retrieval to obtain a target motion sequence. The motion sequence retrieval model is trained based on any of the above-mentioned motion sequence retrieval model training methods.
[0123] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9As shown, the electronic device may include: a processor (processor) 910, a communication interface (CommunicationsInterface) 920, a memory (memory) 930 and a communication bus 940, wherein the processor 910, the communication interface 920, and the memory 930 communicate with each other through the communication bus 940. The processor 910 can call the logic instructions in the memory 930 to execute the motion sequence retrieval model training method, which includes: obtaining a training set and a hierarchical semantic alignment model, the training set includes at least one sample pair, the sample pair includes a motion sequence and its corresponding description text, and the hierarchical semantic alignment model includes a feature extraction layer, a coding layer and a semantic alignment layer; extracting any sample pair from the training set, inputting the motion sequence and the description text in the sample pair into the feature extraction layer for feature extraction, and obtaining frame-level features and text features; inputting the frame-level features and the text features into the coding layer for coding processing, and obtaining the motion representation and motion probability distribution corresponding to the motion sequence, and the text representation and text probability distribution corresponding to the description text; inputting the motion representation, the text representation, the motion probability distribution and the text probability distribution into the semantic alignment layer for semantic alignment processing, and obtaining the representation alignment loss and the distribution alignment loss; adjusting the model parameters of the hierarchical semantic alignment model according to the representation alignment loss and the distribution alignment loss, and continuing to train the hierarchical semantic alignment model until the training stop condition is reached, and obtaining the motion sequence retrieval model.
[0124] Alternatively, the processor 910 can call the logic instructions in the memory 930 to execute a motion sequence retrieval method, which includes: obtaining a query text and a motion sequence set, wherein the motion sequence set includes at least one initial motion sequence; inputting the query text and each of the initial motion sequences into a motion sequence retrieval model for retrieval to obtain a target motion sequence, wherein the motion sequence retrieval model is trained based on any of the above-mentioned motion sequence retrieval model training methods.
[0125] In addition, the logic instructions in the above-mentioned memory 930 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 is essentially 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 to enable 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.
[0126] On the other hand, the present invention also provides a computer program product, which includes a computer program, which 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 motion sequence retrieval model training method provided by the above methods, the method comprising: obtaining a training set and a hierarchical semantic alignment model, the training set comprising at least one sample pair, the sample pair comprising a motion sequence and its corresponding description text, the hierarchical semantic alignment model comprising a feature extraction layer, a coding layer and a semantic alignment layer; extracting any sample pair from the training set, inputting the motion sequence and the description text in the sample pair into the feature extraction layer for feature extraction Extraction to obtain frame-level features and text features; input the frame-level features and the text features to the encoding layer for encoding processing to obtain the motion representation and motion probability distribution corresponding to the motion sequence, as well as the text representation and text probability distribution corresponding to the description text; input the motion representation, the text representation, the motion probability distribution and the text probability distribution to the semantic alignment layer for semantic alignment processing to obtain representation alignment loss and distribution alignment loss; according to the representation alignment loss and the distribution alignment loss, adjust the model parameters of the hierarchical semantic alignment model, and continue to train the hierarchical semantic alignment model until the training stop condition is reached to obtain a motion sequence retrieval model.
[0127] Alternatively, when the computer program is executed by the processor, the computer can execute the motion sequence retrieval method provided by the above methods, the method comprising: obtaining a query text and a motion sequence set, the motion sequence set including at least one initial motion sequence; inputting the query text and each of the initial motion sequences into a motion sequence retrieval model for retrieval to obtain a target motion sequence, the motion sequence retrieval model being trained based on any of the above-mentioned motion sequence retrieval model training methods.
[0128] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the motion sequence retrieval model training method provided by the above methods, the method comprising: obtaining a training set and a hierarchical semantic alignment model, the training set comprising at least one sample pair, the sample pair comprising a motion sequence and its corresponding description text, the hierarchical semantic alignment model comprising a feature extraction layer, a coding layer and a semantic alignment layer; extracting any sample pair from the training set, inputting the motion sequence and the description text in the sample pair into the feature extraction layer for feature extraction, and obtaining frame-level features and text features; The frame-level features and the text features are input into the encoding layer for encoding processing to obtain the motion representation and motion probability distribution corresponding to the motion sequence, and the text representation and text probability distribution corresponding to the description text; the motion representation, the text representation, the motion probability distribution and the text probability distribution are input into the semantic alignment layer for semantic alignment processing to obtain the representation alignment loss and the distribution alignment loss; according to the representation alignment loss and the distribution alignment loss, the model parameters of the hierarchical semantic alignment model are adjusted, and the hierarchical semantic alignment model is continuously trained until the training stop condition is reached to obtain the motion sequence retrieval model.
[0129] Alternatively, when the computer program is executed by the processor, it is implemented to execute the motion sequence retrieval method provided by the above-mentioned methods, the method comprising: obtaining a query text and a motion sequence set, the motion sequence set including at least one initial motion sequence; inputting the query text and each of the initial motion sequences into a motion sequence retrieval model for retrieval to obtain a target motion sequence, the motion sequence retrieval model being trained based on any of the above-mentioned motion sequence retrieval model training methods.
[0130] 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.
[0131] 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.
[0132] 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 motion sequence retrieval model training method, It is characterized in that include: Acquire a training set and a hierarchical semantic alignment model, wherein the training set includes at least one sample pair, the sample pair includes a motion sequence and its corresponding description text, and the hierarchical semantic alignment model includes a feature extraction layer, a coding layer, and a semantic alignment layer; extract any sample pair from the training set, input the motion sequence and the description text in the sample pair into the feature extraction layer for feature extraction, and obtain frame-level features and text features; Inputting the frame-level features and the text features into the encoding layer for encoding processing to obtain the motion representation and motion probability distribution corresponding to the motion sequence, and the text representation and text probability distribution corresponding to the description text; Inputting the motion representation, the text representation, the motion probability distribution and the text probability distribution into the semantic alignment layer for semantic alignment processing to obtain a representation alignment loss and a distribution alignment loss; According to the representation alignment loss and the distribution alignment loss, the model parameters of the hierarchical semantic alignment model are adjusted, and the hierarchical semantic alignment model is continuously trained until a training stop condition is reached to obtain a motion sequence retrieval model.
2. The motion sequence retrieval model training method according to claim 1, It is characterized in that The feature extraction layer includes a text feature extraction layer and a motion feature extraction layer, and the motion feature extraction layer includes a skeleton feature extraction layer and a frame-level feature extraction layer; The step of inputting the motion sequence and the description text in the sample pair into the feature extraction layer for feature extraction to obtain frame-level features and text features includes: Inputting the motion sequence in the sample pair into the skeleton feature extraction layer for feature extraction to obtain skeleton features, and inputting the skeleton features into the frame-level feature extraction layer for feature extraction to obtain frame-level features; The description text in the sample pair is input into the text feature extraction layer for feature extraction to obtain text features.
3. The motion sequence retrieval model training method according to claim 1, It is characterized in that The coding layer includes a frame-level feature coding layer and a text feature coding layer, the motion representation includes a global motion representation and a local motion representation, and the text representation includes a global text representation and a local text representation; The step of inputting the frame-level features and the text features into the coding layer for coding processing to obtain the motion representation and motion probability distribution corresponding to the motion sequence, and the text representation and text probability distribution corresponding to the description text, comprises: inputting the frame-level features into the frame-level feature coding layer for coding processing to obtain the motion global representation, motion local representation and motion probability distribution corresponding to the motion sequence; The text features are input into the text feature encoding layer for encoding processing to obtain a text global representation, a text local representation and a text probability distribution corresponding to the text description.
4. The motion sequence retrieval model training method according to claim 1, It is characterized in that The semantic alignment layer includes a representation alignment layer and a probability alignment layer; The step of inputting the motion representation, the text representation, the motion probability distribution and the text probability distribution into the semantic alignment layer for semantic alignment processing to obtain a representation alignment loss and a distribution alignment loss includes: Inputting the motion representation and the text representation into the representation alignment layer for semantic alignment processing to obtain the representation alignment loss; The motion probability distribution and the text probability distribution are input into the probability alignment layer for semantic alignment processing to obtain the distribution alignment loss.
5. The motion sequence retrieval model training method according to claim 4, It is characterized in that The motion representation includes a global motion representation and a local motion representation, the text representation includes a global text representation and a local text representation; the representation alignment layer includes a global representation alignment layer and a local representation alignment layer; The representation alignment loss includes a global representation alignment loss and a local representation alignment loss; The step of inputting the motion representation and the text representation into the representation alignment layer for semantic alignment processing to obtain the representation alignment loss includes: Inputting the motion global representation and the text global representation into the global representation alignment layer for semantic alignment processing to obtain a global representation alignment loss; The motion local representation and the text local representation are input into the local representation alignment layer for semantic alignment processing to obtain a local representation alignment loss.
6. The motion sequence retrieval model training method according to claim 4, It is characterized in that The probability alignment layer includes a probability distribution alignment layer and a probability distribution constraint layer; the distribution alignment loss includes a relative entropy loss and a probability distribution alignment loss; the motion probability distribution and the text probability distribution are input into the probability alignment layer for semantic alignment processing to obtain the distribution alignment loss, including: Inputting the motion probability distribution and the text probability distribution into the probability distribution alignment layer for semantic alignment processing to obtain the probability distribution alignment loss; The motion probability distribution and the text probability distribution are input into the probability distribution constraint layer for relative entropy constraint processing to obtain the relative entropy loss.
7. The motion sequence retrieval model training method according to any one of claims 1 to 6, It is characterized in that The representation alignment loss includes a global representation alignment loss and a local representation alignment loss; the distribution alignment loss includes a relative entropy loss and a probability distribution alignment loss; The adjusting the model parameters of the hierarchical semantic alignment model according to the representation alignment loss and the distribution alignment loss includes: Obtaining a first contribution of the global representation alignment loss, a second contribution of the local representation alignment loss, a third contribution of the relative entropy loss, and a fourth contribution of the probability distribution alignment loss; Adding the product of the global representation alignment loss and the first contribution, the product of the local representation alignment loss and the second contribution, the product of the relative entropy loss and the third contribution, and the product of the probability distribution alignment loss and the fourth contribution to obtain a total loss; Model parameters of the hierarchical semantic alignment model are adjusted according to the total loss.
8. A motion sequence retrieval method, It is characterized in that include: Acquire a query text and a motion sequence set, wherein the motion sequence set includes at least one initial motion sequence; The query text and each of the initial motion sequences are input into a motion sequence retrieval model for retrieval to obtain a target motion sequence. The motion sequence retrieval model is trained based on the motion sequence retrieval model training method according to any one of claims 1 to 7.
9. A motion sequence retrieval model training device, It is characterized in that include: A first acquisition unit is configured to acquire a training set and a hierarchical semantic alignment model, wherein the training set includes at least one sample pair, wherein the sample pair includes a motion sequence and its corresponding description text, and the hierarchical semantic alignment model includes a feature extraction layer, a coding layer, and a semantic alignment layer; A feature extraction unit is configured to extract any sample pair from the training set, input the motion sequence and description text in the sample pair into the feature extraction layer for feature extraction, and obtain frame-level features and text features; The encoding unit is configured to input the frame-level features and the text features into the encoding layer for encoding processing to obtain the motion representation and motion probability distribution corresponding to the motion sequence, and the text representation and text probability distribution corresponding to the description text; A semantic alignment unit is configured to input the motion representation, the text representation, the motion probability distribution and the text probability distribution into the semantic alignment layer for semantic alignment processing to obtain a representation alignment loss and a distribution alignment loss; The adjustment unit is configured to adjust the model parameters of the hierarchical semantic alignment model according to the representation alignment loss and the distribution alignment loss, and continue to train the hierarchical semantic alignment model until a training stop condition is reached to obtain a motion sequence retrieval model.
10. A motion sequence retrieval device, It is characterized in that include: A second acquisition unit is configured to query the text and the motion sequence set, wherein the motion sequence set includes at least one initial motion sequence; The retrieval unit is configured to input the query text and each of the initial motion sequences into a motion sequence retrieval model for retrieval to obtain a target motion sequence. The motion sequence retrieval model is trained based on the motion sequence retrieval model training method described in any one of claims 1-7.
Citation Information
Patent Citations
Adhesion detection model training method, adhesion detection method and related devices
CN113850203A
Model training method and device based on difficult sample mining and storage medium
CN116704217A
Headword extraction method and apparatus, device, and storage medium
US20220343074A1
Cited By
Text-aligned human motion generation method and system
CN119941942A
Generating motion from text in content generation systems and applications
US20260065562A1
