A robot action generation model training method and action generation method
By building a robot motion generation model that combines human posture and text data, the problems of manual dependence and insufficient generalization in automotive wiring harness assembly are solved, and more accurate and flexible robot motion generation is achieved.
Patent Information
- Application Number
- CN202411871795.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-12-18
AI Technical Summary
Existing technologies rely heavily on manual labor in automotive wiring harness assembly, and existing robot motion generation methods are not very generalizable, making them difficult to apply to automotive wiring harness assembly.
By building a robot action generation model, combining human posture and text data, and using the motion segmenter, language model module, and vocabulary integration module, the robot action generation model is trained to generate actions that are more in line with automotive wiring harness operations.
It improves the accuracy and flexibility of robot motion generation, reduces online matching and training time, and is suitable for a variety of automotive wiring harness tasks.
Smart Images

Figure CN119526414B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of humanoid robots, and in particular to a robot action generation model training method and an action generation method. Background Art
[0002] Wiring harnesses are crucial in modern vehicles, especially electric vehicles, transmitting power and signals to enable critical functions. With the rapid development of smart cars, the number of wiring harnesses in various areas, such as vehicle doors, engines, and entire vehicle bodies, has increased exponentially. However, current automotive wiring harness assembly relies heavily on manual labor, placing significant pressure on both operators and factories. One obvious solution is to reduce labor requirements and improve productivity through robotic automation. Deformable automotive wiring harnesses require robots with both dexterity and intelligence, making intelligent and dexterous robotic assembly crucial.
[0003] Generative approaches have achieved significant results in robotic skill learning and have proven their effectiveness in improving robotic operations on various physical robotic arms. Chinese patent application CN106600000A discloses a method for mapping human-robot motion data. This method uses human motion data as input to a deep learning model and robot sample data as the desired output. While this method achieves a mapping relationship between human-robot motion data, it does not incorporate textual information to guide robot motion generation, making it unsuitable for automotive wiring harness assembly and lacking generalizability.
[0004] Therefore, a problem that needs to be solved is to provide a robot motion generation method that can be applied to automobile wiring harness assembly and has generalization. Summary of the Invention
[0005] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a robot motion generation model training method and a motion generation method. On the basis of language-motion understanding, prompt data is constructed with human posture, which effectively improves the accuracy of robot motion generation.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] According to a first aspect of the present invention, a method for training a robot motion generation model is provided. The robot motion generation model includes a motion segmenter, a language model module, and a vocabulary integration module. The steps include:
[0008] Constructing an automotive wiring harness operation dataset, the dataset includes a motion dataset and a text dataset of workers operating the wiring harness, and extracting human posture based on the motion data;
[0009] Constructing an instruction set based on the text dataset, the action dataset, and the human body posture, wherein the data types of the instruction set include the function description, function label, function category, input, and output of the language model;
[0010] Obtaining a text vocabulary in the language model module, pre-training the motion word segmenter based on the text vocabulary and the motion dataset, and generating a text vocabulary and an motion vocabulary containing motion semantics;
[0011] Based on the text vocabulary, the text vocabulary containing action semantics, and the action vocabulary, the vocabulary integration module is used to integrate the text vocabulary to obtain a text-action vocabulary;
[0012] Pre-train a language model based on the dataset, instruction set, and text-action vocabulary described above;
[0013] An operation dataset is constructed, and a pre-trained language model is fine-tuned based on the operation dataset to complete the training. The data types in the operation dataset include human automobile wiring harness routing, wiring harness terminal plugging, and wiring harness winding operation data.
[0014] As a preferred technical solution, the human body posture is three-dimensional data.
[0015] As a preferred technical solution, the pre-training method of the motion word segmenter includes:
[0016] Randomly selecting multiple action sequences from the action data set as a training set;
[0017] The action sequence is expressed as Where F represents the F-frame action sequence, i represents the i-th action sequence, and x represents the action;
[0018] Discretize the action sequence into action discrete tokens of preset length Wherein, t represents a single data in a discrete word; i represents the i-th data in a discrete word; f represents a preset length and f=F / l, l represents the sampling time;
[0019] Decode the action discrete words into action sequences And based on the decoded action sequence With action sequence m 1:F Calculate losses;
[0020] The motion tokenizer is optimized based on the loss.
[0021] As a preferred technical solution, the method for generating the action vocabulary is: using a pre-trained motion segmenter to discretize each action sequence in the action data set into action discrete word units, and integrating all action discrete word units to obtain the action vocabulary.
[0022] As an optimal technical solution, the method for obtaining the text vocabulary containing action semantics is: randomly giving the motion segmenter a language text description containing time information, and repeatedly performing text-action matching based on the text vocabulary and the action vocabulary until the text sequence of the text vocabulary and the action sequence in the motion coding book maintain a consistent temporal order.
[0023] As a preferred technical solution, the method for obtaining the text-action vocabulary is:
[0024] Obtaining the text vocabulary and all text discrete words in the text vocabulary containing action semantics;
[0025] Encode all the discrete words of the text into basic units;
[0026] All action discrete words in the action vocabulary are obtained, and the action discrete words and basic units are input into a vocabulary integration module for integration in chronological order.
[0027] As a preferred technical solution, the pre-training loss of the language model is calculated using log-likelihood, which is expressed as:
[0028]
[0029] in, Represents the i-th discrete word in the action sequence at time t; Represents the first i discrete words in the action sequence at time t; Lt Indicates the length of the current action sequence; represents the probability at time t.
[0030] According to a second aspect of the present invention, a robot motion generation method is provided. The method generates robot motion using a robot motion generation model trained by the above-mentioned generation model training method, comprising:
[0031] Obtaining the instruction of the operation harness and inputting it into the motion word segmenter, and outputting discrete action words;
[0032] Input the action word into the language model module and output a 3D humanoid action sequence;
[0033] The robot motion is generated using a redirection method based on the 3D humanoid motion sequence.
[0034] As a preferred technical solution, the method for generating robot actions is:
[0035] The minimum distance between the current position of the robot's end effector and the target position is used as the objective function, and its expression is:
[0036] F(θ)=||p target -p(θ)|| 2 ,
[0037] Among them, p target represents the target position, and p(θ) represents the position of the end effector at the current joint angle;
[0038] Obtaining a position of each end effector based on the objective function;
[0039] The positions of each end effector are integrated to generate the robot motion.
[0040] As a preferred technical solution, the method for obtaining the position of each joint key point based on the objective function is: using the gradient descent method to find the position of the end effector that makes the objective function the minimum value.
[0041] Compared with the prior art, the present invention has the following advantages:
[0042] 1) During the generative model training process, the present invention uses human posture as prompt data for the language model. It integrates the instructions from text to text, text to action, and action to action used by the action generation model to generate robot actions, and uses this to construct an instruction set. The robot action generation model is trained based on this instruction set and human posture, so that it can generate actions that are more consistent with automotive wiring harnesses based on its understanding of the action description grammar. The model training method provided by the present invention can ensure that the robot action generation model can effectively learn and generalize to a variety of automotive wiring harness-related tasks.
[0043] 2) During the robot motion generation process, the present invention maps the motions generated by the robot motion generation model to the humanoid robot in a redirected manner, which not only improves the accuracy of the robot motion generation, but also generates richer automotive wiring harness operation motions and improves the flexibility of the robot in operating the automotive wiring harness;
[0044] 3) The present invention pre-trains the robot action generation model so that when operating the automotive wiring harness, it does not need to perform online matching and training for given task text instructions, effectively saving time and operating efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 is a general flow chart of the model training and action generation method of the present invention;
[0046] Figure 2 A schematic diagram of the robot motion generation model training of the present invention;
[0047] Figure 3 A framework diagram is generated for the actions of the present invention. DETAILED DESCRIPTION
[0048] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0049] Obviously, the drawings described below are merely examples or embodiments of the present application. Those skilled in the art can, without inventive effort, apply the present application to other similar scenarios based on these drawings. Furthermore, it is also understood that, although the effort involved in such a development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, changes in design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as an insufficiency of the content disclosed in this application.
[0050] The present invention relates to a humanoid robot motion generation model training method and a humanoid robot motion generation method for dexterous operation of automotive wiring harnesses. In view of the large labor demand for operation tasks in automotive wiring harness production lines, a humanoid robot motion generation model is constructed using human motion. According to the motion requirements of the operation tasks, human posture data is used as a prompt to improve the motion generated by the model. The detailed process of the present invention is as follows: Figure 1 As shown in Figure 2, it is divided into two modules: model training and action generation.
[0051] Example 1
[0052] This embodiment provides a method for training a robot motion generation model. This method uses human posture data from automobile wiring harness operations as prompt data for the robot motion generation model. It then combines text data and motion data from the wiring harness process to construct an instruction set. The robot motion generation model is pre-trained based on this instruction set, human posture data, motion data, and text data. This eliminates the need for online text matching and training, saving model training time and efficiency. Specifically, the robot motion generation model includes a motion segmenter, a language model Llama module, and a vocabulary integration module. The vocabulary integration module can leverage the SentencePiece model to implement its functionality.
[0053] The framework of the training method of the robot action generation model is as follows Figure 2 As shown, the following steps are included:
[0054] S1. Arrange an automotive wiring harness operation scenario and collect a dataset of worker actions and text. These datasets are collectively referred to as the dataset. Human posture data is extracted from the action dataset as prompt data for the subsequent robot motion generation model. The human posture data is formatted in three-dimensional space.
[0055] The method of obtaining motion data and text data includes at least a motion capture camera, an RGB camera and an IMU sensor, and the data types collected include at least: joint coordinates in three-dimensional directions, pitch-roll-rotation angles of joints, angular accelerations and a complete operation video of an operation task.
[0056] S2. Instruction set construction:
[0057] An instruction set is constructed based on text datasets, action datasets, and human pose data, and saved in JSON format. The instruction set data types include the language model Llama's function descriptions, which contain multiple action semantic textual descriptions; function tags such as "text-to-pose," "text-to-motion," and "text-to-text"; function categories such as "t2p," "t2m," and "t2t"; and inputs and outputs. This constructs an instruction set containing text-to-text, text-to-motion, and action-to-action instructions, helping the language model Llama better understand text and generate corresponding humanoid action sequences.
[0058] During the pre-training process of the Llama language model, an instruction set defines input and output templates for different tasks, providing clear guidance on task structure and data format. The model parses and processes different types of task data based on the content in the file, populating the placeholders with actual data, learning the patterns and characteristics of different tasks and how to map inputs to desired outputs. Therefore, this instruction set primarily serves to define the task structure and standardize the data format, ensuring that the Llama language model effectively learns and generalizes to a variety of sports-related tasks.
[0059] Specifically, the code for building the instruction set is shown in Table 1:
[0060] Table 1 Instruction set construction code table
[0061]
[0062]
[0063] S3. Obtain the text vocabulary in the language model module, pre-train the motion segmenter based on the text vocabulary and the motion dataset, the motion segmenter includes the motion decoder D and the motion encoder E, and generate a text vocabulary and an action vocabulary containing motion semantics.
[0064] The specific steps are:
[0065] S31, randomly select multiple action sequences in the action data set as a training set;
[0066] S32, express the action sequence as Where F represents the F-frame action sequence, i represents the i-th action sequence, and x represents the action;
[0067] S33, using the action encoder to discretize the action sequence into action discrete words of preset length Wherein, t represents a single data in a discrete word; i represents the i-th data in a discrete word; f represents a preset length and f=F / l, l represents the sampling time;
[0068] S34, decoding the action discrete word into an action sequence using an action decoder And based on the decoded action sequence With action sequence m 1:F Calculate losses;
[0069] S35. Loss-based optimization of motion segmenter.
[0070] S4. Based on the text vocabulary, the text vocabulary containing action semantics, and the action vocabulary, the SentencePiece module is used to integrate them to obtain the text-action vocabulary.
[0071] S41. Generate an action vocabulary: Use a pre-trained motion segmenter to discretize each action sequence in the action dataset into action discrete word units, and integrate all the action discrete word units to obtain the action vocabulary.
[0072] S42. Obtain a text vocabulary containing action semantics: randomly give the motion segmenter VQ-VAE a language text description containing time information and of length N, and repeatedly perform text-action matching based on the text vocabulary and the action vocabulary until the text sequence in the text vocabulary and the action sequence in the motion coding book maintain temporal consistency.
[0073] S43. Construct a text-action vocabulary: obtain all text discrete words in the text vocabulary and the text vocabulary containing action semantics, and encode all text discrete words into basic units; obtain all action discrete words in the action vocabulary, and input the action discrete words and basic units into the SentencePiece module for integration in chronological order, and in the integration process, it is necessary to ensure that the chronological order of the text and the action is consistent.
[0074] S5. Pre-trained language model.
[0075] The main purpose of language model-based action generation is to learn the semantic coupling between actions and text. Therefore, its pre-training involves pre-training the language model based on the dataset, instruction set, and text-action vocabulary obtained in steps S1-S4. To achieve better performance in generation tasks and improve the language model's understanding and generation of results similar to samples in the training dataset, the probability of predicting the next token is measured using the log-likelihood. This probability is converted into a probability in the form of a transformation product and presented as a logarithmic sum. This facilitates processing long sequences of data such as action sequences, avoiding numerical overflow caused by the exponential reduction of the probability product with the sequence length. This facilitates optimization of model parameters by maximizing the log-likelihood and facilitates gradient calculation. The calculated gradient adjusts the model parameters so that the model output probability distribution is as consistent as possible with the actual data distribution, that is, the joint distribution of text-action sequences in the text-action vocabulary, to better understand and generate text similar to the training data samples.
[0076] Specifically, the log-likelihood is used to calculate the loss of pre-training, which is expressed as:
[0077]
[0078] in, Represents the i-th discrete word in the action sequence at time t; Represents the first i discrete words in the action sequence at time t; Lt Indicates the length of the current action sequence; represents the probability at time t.
[0079] S6. Construct an operation dataset that includes human automotive wiring harness routing, wiring harness terminal plugging, and wiring harness winding operation data. Fine-tune the pre-trained language model based on the operation dataset to enhance the model's performance in related tasks and complete the training.
[0080] Example 2
[0081] This embodiment provides a robot motion generation method, which generates robot motions using a robot motion generation model trained by the model training method provided in the above embodiment. The process is as follows: Figure 3 ,include:
[0082] A1. Get the command of the operation harness and input it into the motion word segmenter, which outputs discrete action words.
[0083] A2. Input the action word into the language model module and output the 3D humanoid action sequence.
[0084] A3. Generate robot motions using the redirection method based on 3D humanoid motion sequences.
[0085] A31. The minimum distance between the current position of the robot's end effector and the target position is used as the objective function, and its expression is:
[0086] F(θ)=||p target -p(θ)||2,
[0087] Among them, p t arg et represents the target position, and p(θ) represents the position of the end effector at the current joint angle;
[0088] A32. Based on the objective function, use the gradient descent method to find the position of the end effector corresponding to the minimum objective function of each end effector;
[0089] A33. Integrate the position of each end effector to generate robot motion.
[0090] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A robot action generation model training method, characterized in that: The robot action generation model includes a motion segmenter, a language model module and a vocabulary integration module, and the steps include: Arrange an automotive wiring harness operation scene, and collect action datasets and text datasets of workers operating the wiring harnesses. The action datasets and text datasets are collectively referred to as datasets, and extract human posture based on the action datasets. Constructing an instruction set based on the text dataset, the action dataset, and the human body posture, wherein the data types of the instruction set include a function description, a function label, a function category, an input, and an output of a language model; Obtain the text vocabulary in the language model module, pre-train the motion segmenter based on the text vocabulary and the motion data set, and generate a text vocabulary and an action vocabulary containing motion semantics; the pre-training method of the motion segmenter includes: randomly selecting multiple action sequences in the action data set as a training set; representing the action sequence as , where F represents the F-frame action sequence, i represents the i-th action sequence, and x represents the action; the action sequence is discretized into action discrete words of preset length , where t represents a single data in a discrete word; i represents the i-th data in a discrete word; f represents the preset length and , l represents the sampling time; the action discrete word is decoded into an action sequence , where D represents the action decoder and E represents the action encoder, and based on the decoded action sequence and action sequences Calculating a loss; optimizing the motion tokenizer based on the loss; Based on the text vocabulary in the language model module, the text vocabulary containing action semantics, and the action vocabulary, the vocabulary integration module is used to integrate them to obtain a text-action vocabulary; Pre-train a language model based on the dataset, instruction set, and text-action vocabulary described above; An operation dataset is constructed that includes human automobile wiring harness routing, wiring harness terminal plugging, and wiring harness winding operation data. The pre-trained language model is fine-tuned based on the operation dataset to complete the training.
2. A robot action generation model training method according to claim 1, characterized in that: The human body posture is three-dimensional data.
3. A robot action generation model training method according to claim 1, characterized in that: The method for generating the action vocabulary is as follows: using a pre-trained motion segmenter to discretize each action sequence in the action data set into action discrete word units, and integrating all the action discrete word units to obtain the action vocabulary.
4. A robot action generation model training method according to claim 3, characterized in that: The method for obtaining the text vocabulary containing action semantics is: randomly giving the motion segmenter a language text description containing time information, and repeatedly performing text-action matching based on the text vocabulary and action vocabulary in the language model module until the text sequence of the text vocabulary in the language model module and the action sequence in the motion coding book maintain a consistent temporal order.
5. A robot action generation model training method according to claim 4, characterized in that: The method for obtaining the text-action vocabulary is: Obtaining all text discrete words in the text vocabulary in the language model module and the text vocabulary containing action semantics; Encode all the discrete words of the text into basic units; All action discrete words in the action vocabulary are obtained, and the action discrete words and basic units are input into a vocabulary integration module for integration in chronological order.
6. A robot action generation model training method according to claim 1, characterized in that: The pre-training of the language model uses log-likelihood to calculate the pre-training loss, which is expressed as: , in, Represents the i-th discrete word in the action sequence at time t; Represents the first i discrete words in the action sequence at time t; Indicates the length of the current action sequence; represents the probability at time t.
7. A robot motion generation method, characterized in that: The method generates robot motions using a robot motion generation model trained by the method according to any one of claims 1 to 6, comprising: Obtaining the instruction of the operation harness and inputting it into the motion word segmenter, and outputting discrete action words; Input the action word into the language model module and output a 3D humanoid action sequence; The robot motion is generated using a redirection method based on the 3D humanoid motion sequence.
8. A robot motion generation method according to claim 7, characterized in that: The method for generating robot actions is: The distance between the position of the end effector at the current joint angle of the robot and the target position is used as the objective function, and its expression is: , in, Indicates the target location, Indicates the position of the end effector at the current joint angle; Obtaining a position of each end effector based on the objective function; The positions of each end effector are integrated to generate the robot motion.
9. A robot motion generation method according to claim 8, characterized in that: The method for obtaining the position of each end effector based on the objective function is: using the gradient descent method to find the position of the end effector that makes the objective function the minimum value.
Citation Information
Patent Citations
Method and system for human-robot motion data mapping
CN106600000A
Model training method and device, action text description method and device, equipment and medium
CN117609795A
Intelligent robot control method and system based on pre-training language model
CN117681198A