Shape control system and method for deformable objects based on spatiotemporal attention mechanism
Through the deformable object shape control system based on the spatiotemporal attention mechanism, using the spatiotemporal feature extraction and grabbing/placement position generation module, the problems of low operating efficiency and high data cost of deformable objects in the existing technology are solved, and an efficient, Autonomous multi-step operation control.
Patent Information
- Application Number
- CN202210573963.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-05-24
AI Technical Summary
Existing technology makes it difficult to effectively control and operate deformable objects, especially in multi-step operation tasks with low efficiency and high data costs, and it is difficult to autonomously complete complex shape control.
A deformable object shape control system based on the spatiotemporal attention mechanism is adopted. Through the spatiotemporal feature extraction module and the grab/place position generation module, the spatial and temporal feature information of the teaching operation sequence is used to generate grab and place heat maps to realize the robot. Operate autonomously and reduce data costs with pre-trained models and fine-tuned data.
It improves the operational efficiency and autonomy of shape control of deformable objects, reduces human participation, reduces data acquisition and training costs, and achieves learning and efficient control of multi-step operation capabilities.
Smart Images

Figure CN114863282B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robotics technology, and in particular to a shape control system and method for a deformable object based on a spatiotemporal attention mechanism. Background Art
[0002] Deformable objects can be found everywhere in human daily life. Designing algorithms to enable robots to interact with deformable objects has broad application prospects, such as: cable assembly in industrial applications, clothing sorting in household applications, dressing assistance in elderly care services, organ and tissue manipulation in medical surgery, and collection of fragile samples by underwater / space robots, etc.
[0003] Compared with the more mature robotic manipulation of rigid objects, robotic manipulation of deformable objects is more difficult, and there are fewer related studies and applications. The challenges it faces are mainly the following three points: (1) It is difficult to represent the state of deformable objects: Compared with the state of rigid objects, which can be represented by finite-dimensional state quantities (such as 6D pose, etc.), deformable objects have infinite degrees of freedom, so it is difficult to model deformable objects; and how to map high-dimensional observations of deformable objects (such as images, point clouds, and tactile perception, etc.) to low-dimensional and compact state representations for subsequent planning and manipulation is still a thorny problem. (2) The dynamics of deformable objects are complex and nonlinear: Due to the interactions within deformable objects, even small interactive operations on simple objects can cause them to exhibit complex and unpredictable behaviors, which makes it difficult to model deformable objects and perform traditional tasks and motion planning. (3) Deformable objects are often only partially observable: Deformable objects often have self-occlusion. For example, when a piece of cloth is wrinkled or folded, part of it will be covered by another part, making it only partially observable, which increases the difficulty of subsequent state representation and planning operations. For the above reasons, mature robotics theories and traditional modeling and analysis methods for rigid objects are difficult to apply to deformable objects.
[0004] FabricFlowNet (Fabric Manipulation Network using Optical Flow) is a relatively excellent deformable object shape manipulation framework at this stage. It is based on a dual-arm robot and is designed for two-dimensional deformable objects (such as cloth, clothes, etc.). Its main structure is as follows Figure 1As shown in the figure, the main idea is: (1) combining the depth image of the current deformable object with the depth image 110 of the deformable object under the target shape, calculate the optical flow map 101 between the two images; (2) input the optical flow map into the first grasping network 102 (a fully convolutional network), and output a grasping heat map 103. The pixel point corresponding to the maximum value in the grasping heat map 103 is the optimal grasping point of the first robot; (3) with the optimal grasping point of the first robot as the center, add Gaussian noise to construct an additional image 104 for representing the grasping point information of the first robot, and splice the additional image 104 with the optical flow map 101, input it into the second grasping network 105 (the same fully convolutional network as the first grasping network 102), and output a grasping heat map 106. The pixel point corresponding to the maximum value in the grasping heat map 106 is the optimal grasping point of the second robot. (4) Find the displacement of the pixel points corresponding to the optimal grasping points of the two robotic arms in the optical flow graph 101, and calculate the optimal placement point based on the binary cross entropy loss function, such as Figure 1 The actual value of the grasping point in the image is 107. The inventors have found that the main deficiencies of the FabricFlowNet framework are as follows: (1) FabricFlowNet is essentially designed for single-step operations, and the model can only learn limited single-step operation capabilities, that is, only when the difference between the current shape and the target shape is small, or the difference between the two can be achieved with one-step operation, the network can output a relatively ideal result. Therefore, for tasks that require multiple steps to complete, the operation of the framework requires human participation, that is, artificially dividing the complex shape control task into multiple single-step simple shape control subtasks, and then letting the robot complete these simple shape control subtasks in turn. In this process, it is necessary for people to judge whether each subtask is completed and whether the next subtask can be carried out. In general, the algorithm is not autonomous enough in application. (2) The training data acquisition method is limited: the algorithm needs to train the network to estimate the optical flow map between the two images, and its training data requires the displacement of the pixel points as labels, and this part of the displacement data can only be obtained in the simulator. Therefore, the training data of the algorithm can only be obtained from the simulator, and the data collected in the real scene cannot be used.
[0005] Transporter-Goal-Split is a widely applicable shape manipulation framework for deformable objects. It can be applied to many deformable objects, such as ropes, cloth, and even pockets. Its main structure is as follows: Figure 2 As shown in the figure, the main idea is: (1) the RGB image of the current deformable object and the RGB image of the deformable object under the target shape are input into four fully convolutional networks to obtain four feature maps (respectively denoted as Q pick , ψ goal , ψ query, ψ key );(2) Grasping point determination: feature map Q pick The pixel corresponding to the maximum value in is the optimal grasping point. (3) Feature fusion: The feature map ψ goal With ψ query Perform Hadamard product operation to obtain the characteristic map ψ goal×query ; The feature map ψ goal With ψ key Perform Hadamard product operation to obtain the characteristic map ψ goal×key (4) Determine the placement point: Take the pixel corresponding to the optimal grasping point as the center and goal×query Take an image patch and use it as the convolution kernel feature map ψ goal×key Perform convolution to obtain the feature map Q place , where the pixel corresponding to the maximum value is the optimal placement point. The inventors have found that the main deficiencies of the Transporter-Goal-Split framework are as follows: (1) Like FabricFlowNet, Transporter-Goal-Split is essentially designed for single-step operations, and the model can only learn limited single-step operation capabilities. However, compared with FabricFlowNet, for tasks that require multiple steps to complete, Transporter-Goal-Split adopts a feedback operation method, that is, after each operation of the robot, the current shape and the target shape are input into the network to obtain new operation instructions and execute them. This continuous feedback execution can make the shape of the object closer and closer to the target shape. However, in actual applications, it is found that since the model has only learned the ability of single-step operations, if a complex shape is directly used as the target shape, the model will feel "confused" during operation and may output many counterproductive operations, thereby causing the task to fail; it may also require many steps of feedback operations to approach the target shape. In general, the algorithm is less efficient in the application of complex operation tasks. (2) High training data cost: The algorithm requires expert teaching operations as training data, and because the network structure is relatively complex, each shape control task requires a large amount of expert teaching, which is costly.
[0006] The disclosure of the above background technology content is only used to assist in understanding the concept and technical solution of the present invention. It does not necessarily belong to the prior art of this patent application. In the absence of clear evidence that the above content has been disclosed on the filing date of this patent application, the above background technology should not be used to evaluate the novelty and creativity of the present application. Summary of the invention
[0007] In order to solve the above technical problems, the present invention proposes a deformable object shape control system and method based on the spatiotemporal attention mechanism, which not only improves the operational efficiency and autonomy of the system framework, but also effectively solves the data cost and utilization efficiency problems.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] The present invention discloses a deformable object shape control system based on a spatiotemporal attention mechanism, comprising a spatiotemporal feature extraction module and a grasping and placing position generation module, wherein: the spatiotemporal feature extraction module performs feature embedding on an input image of the current shape of the deformable object and an image group of a teaching operation sequence that reaches a target shape of the deformable object to obtain an embedded vector block, then extracts the spatiotemporal features of the embedded vector block, and screens out the spatiotemporal features of the current shape and the target shape in the embedded vector block from the extracted spatiotemporal features, and according to the spatial structure of the current shape and the target shape of the deformable object in the input image and the image group, The spatiotemporal features of the current shape and the target shape are respectively rearranged to obtain two sets of feature vectors, and then the two sets of feature vectors are concatenated to obtain the spatiotemporal feature vectors, and the spatiotemporal feature vectors are output to the grasping and placing generation module; the grasping and placing generation module includes a grasping point generation decoder and a placement point generation decoder, the grasping point generation decoder and the placement point generation decoder respectively receive the spatiotemporal feature vectors, and obtain a grasping heat map and a placing heat map according to the spatiotemporal feature vectors, so that the robot can grasp and place deformable objects according to the grasping heat map and the placing heat map.
[0010] The present invention also discloses a shape control method for a deformable object based on a spatiotemporal attention mechanism, which uses the above system to control the shape of the deformable object, and includes the following steps:
[0011] S1: inputting an image of the current shape of the deformable object and an image group of a teaching operation sequence to achieve a target shape of the deformable object into the spatiotemporal feature extraction module, and performing feature embedding on the input image and image group to obtain an embedding vector block;
[0012] S2: extracting the spatiotemporal features of the embedding vector block;
[0013] S3: Filtering out the spatiotemporal features of the current shape and the target shape in the embedding vector block from the extracted spatiotemporal features;
[0014] S4: according to the spatial structure of the current shape and the target shape of the deformable object in the image and the image group input to the spatiotemporal feature extraction module, the spatiotemporal features of the current shape and the target shape in step S3 are respectively rearranged to obtain two sets of feature vectors, and then the two sets of feature vectors are concatenated to obtain a spatiotemporal feature vector, and the spatiotemporal feature vector is output to the grab and place generation module;
[0015] S5: the grasping point generation decoder and the placement point generation decoder respectively receive the spatiotemporal feature vector, and obtain a grasping heat map and a placement heat map according to the spatiotemporal feature vector, so that the robot can grasp and place the deformable object according to the grasping heat map and the placement heat map;
[0016] S6: Acquire an image of the deformable object after the robot grasps and places the object, and use the image of the deformable object after the robot grasps and places the object as the image of the current shape of the deformable object to repeat steps S1 to S6 until a preset condition is met and stop.
[0017] Preferably, the step S1 of embedding the input image and image group with features to obtain the embedding vector block specifically includes: decomposing each input image with a size of N×N into small blocks of a×a, and performing linear feature embedding on all the small blocks obtained by the decomposition to embed them into an M-dimensional feature vector to obtain an embedding vector block; the dimension of the spatiotemporal feature vector obtained in step S4 is Where a is divisible by N.
[0018] Preferably, step S2 specifically includes:
[0019] S21: performing a layer normalization operation on the embedding vector block, and performing a multi-head attention calculation on the embedding vector block in a time dimension;
[0020] S22: Perform a residual connection between the embedding vector block calculated in step S21 and the embedding vector block input to step S21;
[0021] S23: performing a layer normalization operation on the embedding vector block obtained in step S22, and performing multi-head attention calculation on the embedding vector block in the spatial dimension;
[0022] S24: Perform a residual connection between the embedding vector block calculated in step S23 and the embedding vector block input to step S23;
[0023] S25: performing a layer normalization operation on the embedding vector block obtained in step S22, and inputting the embedded vector block after the layer normalization operation into the multi-layer perceptron;
[0024] S26: Perform a residual connection between the embedding vector block obtained in step S25 and the embedding vector block input to step S25;
[0025] Repeat steps S21 to S26 at least once to extract the spatiotemporal features of the embedding vector block.
[0026] Preferably, the grasping point generation decoder and the placement point generation decoder in step S5 respectively upsample the spatiotemporal feature vector to generate a grasping heat map and a placement heat map, wherein each point in the grasping heat map represents the grasping success rate of the corresponding pixel point in the input image, and each point in the placement heat map represents the placement success rate of the corresponding pixel point in the input image, and the robot grasps and places the deformable object using the pixel point corresponding to the maximum value in the grasping heat map as the grasping position and the pixel point corresponding to the maximum value in the placement heat map as the placement position.
[0027] Preferably, in step S5, the grab point generation decoder and the placement point generation decoder respectively upsample the spatiotemporal feature vector in a progressive upsampling manner.
[0028] Preferably, the grab point generation decoder and the placement point generation decoder respectively include log2n / m grab point generation decoding units and placement point generation decoding units, and each of the grab point generation decoding units and each of the placement point generation decoding units respectively perform the following steps: first, a 1×1 two-dimensional convolution operation is performed to change the number of channels of the feature vector, and then a bilinear difference operation is performed to double the original size; wherein n is the size of the spatiotemporal feature vector, and m is the size of the grab heat map or the placement heat map.
[0029] Preferably, before executing steps S1 to S6, the method further includes S0: pre-training the system according to claim 1 using random data.
[0030] Preferably, steps A1 to A4 are repeatedly performed to generate the random data used for pre-training, wherein steps A1 to A4 are as follows:
[0031] A1: Build a simulation scene and randomly generate deformable objects;
[0032] A2: Randomly select a point of the deformable object as a grasping point and randomly generate a placement point so that the robot can perform grasping and placement operations in the simulation scene;
[0033] A3: Collect images before and after the robot performs grabbing and placing operations in the simulation scene to record the specific positions of the grabbing and placing operations when the robot performs grabbing and placing operations;
[0034] A4: Repeat steps A1 to A3 T times to obtain a set of T-step random interaction data with the deformable object.
[0035] The present invention further discloses a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the steps of the above method.
[0036] Compared with the prior art, the beneficial effects of the present invention are: the deformable object shape control system and method based on the spatiotemporal attention mechanism proposed in the present invention provides the entire target operation sequence as network input, designs the network based on multi-step operations, and adopts the spatiotemporal attention mechanism to efficiently extract the target operation sequence and the feature information between sequences, fully utilizing the spatial feature information and temporal feature information of the teaching operation sequence, further improving the operational efficiency and autonomy of the system framework.
[0037] In a further solution, the system proposed in the present invention can use a large amount of low-cost data with random interactions for training to obtain a pre-trained model, and then only use a small amount of expert data for fine-tuning for each specific task, effectively solving the problems of data cost and utilization efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram of the existing FabricFlowNet framework;
[0039] Figure 2 It is a schematic diagram of the existing Transporter-Goal-Split framework;
[0040] Figure 3 It is a schematic diagram of a general deformable object shape control system framework based on a spatiotemporal attention mechanism provided by a preferred embodiment of the present invention;
[0041] Figure 4 yes Figure 3 A schematic diagram of the structure of the spatiotemporal feature extraction unit in FIG.
[0042] Figure 5 yes Figure 3 Schematic diagram of the structure of the grab point generation decoder and the placement point generation decoder. DETAILED DESCRIPTION
[0043] The following is a detailed description of the embodiments of the present invention. It should be emphasized that the following description is only exemplary and is not intended to limit the scope and application of the present invention.
[0044] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0045] With the development of deep learning and high-precision simulators, data-driven imitation learning methods have gradually shown great potential in the operation of deformable objects and have received widespread attention in recent years. The main steps of data-driven imitation learning methods are: first, build a scene related to the operation of deformable objects in the simulator; then let the robot interact with the deformable object continuously in the scene, and then obtain a large amount of operation data of interaction with the deformable object; finally, use these large amounts of interactive operation data to train the deep learning model, and the trained deep learning model can be used to operate the deformable object. However, based on the idea of imitation learning, for different shape control tasks, current solutions generally need to collect a large amount of expert teaching data in the simulator to train the network; and in order for the trained network to be better transferred to the real scene, a large amount of domain randomization (Domain Randomization) is required in the simulator; during model training, a large amount of data augmentation (Data Augmentation) is performed.
[0046] Based on the current scheme, training generally requires a large amount of expert data, and its training data cost is generally high. In order to improve the efficiency of data utilization, the present invention combines the idea of transfer learning. First, a large amount of data that randomly interacts with deformable objects is used to train the model to obtain a pre-trained model. The pre-trained model contains the basic laws of shape change of deformable objects. Then, for specific tasks, a small amount of expert data is used for fine-tuning, so that the same effect can be achieved at a lower data cost.
[0047] With the help of the idea of imitation learning, the present invention proposes a deformable object shape control framework based on the spatiotemporal attention mechanism. The spatiotemporal attention mechanism can make the network pay attention to the feature information of the input RGB image sequence in space (the shape of the deformable object) and time (the connection between the shapes of the deformable object at different times) at the same time, thereby extracting the shape information and dynamic change law of the object at the same time, and then outputting reasonable operation actions to make the deformable object reach the target shape. At the same time, the present invention adopts an architecture based on the spatiotemporal attention mechanism, so that the framework proposed by the present invention has good scalability. For different types of shape control tasks, the pre-trained model that has been trained on a large data set can be directly used, and on this basis, a small expert data set is used for fine-tuning, thereby greatly shortening the model training time and reducing the size of the expert data set required for the target task.
[0048] like Figure 3 As shown, the preferred embodiment of the present invention discloses a deformable object shape control system based on a spatiotemporal attention mechanism, including a spatiotemporal feature extraction module 10 and a grasping and placing position generation module 20, wherein: the spatiotemporal feature extraction module 10 embeds the input image 31 of the current shape of the deformable object and the image group 32 of the teaching operation sequence that reaches the target shape of the deformable object to obtain an embedded vector block, and then extracts the spatiotemporal features of the embedded vector block, and filters out the spatiotemporal features of the current shape and the target shape in the embedded vector block from the extracted spatiotemporal features, and then according to the input image 31 and the image group 32, the current shape and the target shape of the deformable object are generated. The spatial structure of the current shape and the target shape are rearranged to obtain two sets of feature vectors by splicing the two sets of feature vectors to obtain the spatiotemporal feature vectors, and the spatiotemporal feature vectors are output to the grasping and placing generation module 20; the grasping and placing generation module 20 includes a grasping point generation decoder 21 and a placement point generation decoder 22, the grasping point generation decoder 21 and the placement point generation decoder 22 receive the spatiotemporal feature vectors respectively, and obtain a grasping heat map 23 and a placement heat map 24 according to the spatiotemporal feature vectors, so that the robot 30 can grasp and place deformable objects according to the grasping heat map 23 and the placement heat map 24.
[0049] Another preferred embodiment of the present invention discloses a method for controlling the shape of a deformable object based on the above system, comprising the following steps:
[0050] S1: Input the image of the current shape of the deformable object and the image group of the teaching operation sequence to achieve the target shape of the deformable object into the spatiotemporal feature extraction module, and perform feature embedding on the input sequence (i.e., the input image and image group) to obtain an embedding vector block;
[0051] Specifically, the input of the system consists of an RGB image 31 of the current deformable object shape and an RGB image group 32 of the taught operation sequence to reach the target shape. The RGB image group 32 of the taught operation sequence to reach the target shape includes a taught intermediate shape 321 (containing multiple RGB images) and a target shape 322 (containing one RGB image); that is, the input of the system includes the taught operation sequence of the entire task, so that the model can learn the ability of multi-step operations and make full use of the timing information between sequences in the expert teaching data.
[0052] In a specific embodiment, each input image of size N×N is decomposed into small blocks of size 16×16, and linear feature embedding is performed on the small blocks to embed them into M-dimensional feature vectors to obtain embedded vector blocks.
[0053] S2: Extracting spatiotemporal features of embedding vector blocks;
[0054] Specifically, these feature vectors are input into the encoder based on the spatiotemporal attention mechanism ( Figure 3 In the spatiotemporal attention feature extraction unit 11), the spatiotemporal features of the embedded vector block are extracted.
[0055] S3: Filter the spatiotemporal features of the current shape and the target shape in the embedding vector block from the extracted spatiotemporal features;
[0056] S4: according to the spatial structure of the current shape and the target shape of the deformable object in the image and the image group input to the spatiotemporal feature extraction module, the spatiotemporal features of the current shape and the target shape in step S3 are respectively rearranged to obtain two sets of feature vectors, and then the two sets of feature vectors are concatenated to obtain the spatiotemporal feature vector, and the spatiotemporal feature vector is output to the grasping and placing generation module;
[0057] Specifically, the spatiotemporal features of the current shape and the target shape in step S3 are rearranged respectively (i.e., the spatiotemporal features of the target shape and the spatiotemporal features of the current shape are processed respectively using the same feature rearrangement method to obtain two sets of rearranged features, corresponding to the target shape and the current shape respectively), and these features are restored to the spatial structure before being input to the encoder, and two sets of dimensions are obtained. The feature vector of ; then concatenate these two sets of feature vectors to get a dimension of The space-time feature vector of .
[0058] S5: The grasping point generation decoder and the placement point generation decoder receive the spatiotemporal feature vectors respectively, and obtain a grasping heat map and a placement heat map respectively according to the spatiotemporal feature vectors, so that the robot can grasp and place the deformable object according to the grasping heat map and the placement heat map;
[0059] The dimensions obtained are After the spatiotemporal feature vector is obtained, it is simultaneously input into two decoder modules ( Figure 3 In the grasping point generation decoder 21 and the placement point generation decoder 22), two heat maps of size N×N (grasping heat map 23 and placement heat map 24) are output. Each point in the grasping heat map 23 and the placement heat map 24 represents the grasping success rate and the placement success rate at the corresponding pixel point in the input image, respectively. The pixel points corresponding to the maximum values in the grasping heat map 23 and the placement heat map 24 are respectively used as the grasping position and the placement position of the robot.
[0060] The robot operates according to the grabbing position and placement position. The specific operation steps are as follows:
[0061] (1) Move the end effector to the grasping point and then grasp the deformable object.
[0062] (2) Move the end effector vertically upward for a certain distance to pull up the deformable object.
[0063] (3) Move the end effector horizontally to above the placement point.
[0064] (4) Release the end effector to allow the deformable object to fall.
[0065] S6: Acquire an image of the deformable object after the robot grasping and placing operation, and use the image of the deformable object after the robot grasping and placing operation as the image of the current shape of the deformable object to repeat steps S1 to S6 until a preset condition is met and stop. The preset condition may be that the number of repetitions reaches a threshold, or when the deformable object reaches a target shape.
[0066] After the robot operation is completed, the shape of the deformable object changes, the shape information of the current deformable object is updated, and its RGB image and the RGB image group of the teaching sequence are used as input again, and the above process is carried out, and then the next operation is carried out. Such continuous feedback operation can make the shape of the deformable object gradually reach the target shape, and there is no need for human participation in the process. It only needs to pre-set an operation stop condition (such as after accumulating p steps of operation), and then let the robot continuously feedback the operation, which has a high degree of autonomy.
[0067] In the scheme of the preferred embodiment of the present invention, firstly, a universal deformable object shape control framework is proposed, which has high operating efficiency and operating autonomy and reduces human involvement; secondly, the network is designed based on multi-step operations, and the entire target operation sequence is provided as network input, so that the model can learn the ability of multi-step operations; thirdly, the target shape operation sequence is feature extracted by the spatiotemporal attention mechanism, and its spatial feature information and temporal feature information are extracted at the same time, which further strengthens the description of the underlying shape change law of the deformable object.
[0068] In some embodiments, in the system and method disclosed in the embodiments of the invention, in the spatiotemporal feature extraction module, the feature extraction network backbone for extracting the spatiotemporal features of the embedded vector block is TimeSfomer, which is a video understanding network based on the spatiotemporal attention mechanism, and its structure is as follows: Figure 4 shown.
[0069] The specific extraction process of the spatiotemporal features of the embedded vector block in step S2 is as follows:
[0070] (1) Perform layer normalization (LayerNorm) on the embedded block vectors (i.e., embedded vector blocks), and then perform multi-head attention calculation on these block vectors in the time dimension (multi-head attention calculation is performed between blocks at the same position in different frames of the input sequence); and perform residual connection on the obtained block vectors with the original block vector of the input.
[0071] (2) Perform layer normalization (LayerNorm) on the vectors calculated in the previous step, and then perform multi-head attention calculation on these block vectors in the spatial dimension (multi-head attention calculation is performed between blocks at different positions in each frame of the input sequence); and perform residual connection on the obtained block vector and the block vector before calculation.
[0072] (3) Perform layer normalization (LayerNorm) on the vectors calculated in the previous step, and then input these block vectors into a multi-layer perceptron; and perform residual connection with the block vectors before calculation (the calculation here refers to the layer normalization operation and the calculation in the multi-layer perceptron, and the vector before calculation refers to the block vector calculated in step (2)).
[0073] Since the block vector dimensions of the input and output of the spatiotemporal feature extraction unit 11 remain unchanged, the modules can be stacked and used according to the actual situation and the complexity of the problem; Figure 4 The spatiotemporal feature extraction units 11 in the embodiment can be stacked and used. After being stacked and used N1 times, the spatiotemporal features of the embedded vector blocks are extracted, thereby realizing the spatiotemporal feature sequence extraction of the target operation sequence.
[0074] In some embodiments, in the system and method disclosed in the embodiments of the invention, in the grasping and placing generation module, the grasping point generation decoder and the placement point generation decoder respectively upsample the extracted spatiotemporal feature vectors, and respectively generate a grasping heat map and a placing heat map, wherein the grasping heat map reflects the grasping success rate of the corresponding position of each pixel point, and the placing heat map reflects the placing success rate of the corresponding position of each pixel point; the points corresponding to the maximum values in the grasping heat map and the placing heat map are respectively selected as the grasping position and placing position of the robot. The structures of the grasping point generation decoder and the placing point generation decoder are exactly the same, such as Figure 5 shown.
[0075] The grab point generation decoder and the placement point generation decoder use a progressive upsampling method and consist of two parts: (1) a 1×1 two-dimensional convolution operation to change the number of channels of the feature vector and (2) a bilinear interpolation operation to double the size of the original.
[0076] After each action of the above-mentioned grab point generation decoder and placement point generation decoder, the size of the feature vector changes to twice the original size, and the number of channels decreases according to the settings in the convolution operation. When the target size is n and the current size is m, log2n / m such grab point generation decoders and placement point generation decoders are used, and the number of channels is reasonably set to achieve the target upsampling effect. Among them, the current size refers to the size of the original feature vector (that is, the spatiotemporal feature vector obtained after feature concatenation), and the target size refers to the size of the image to be restored (that is, the grab heat map or the placement heat map); for example, the size of the current feature vector is 16×16×M, and the size of the image to be restored is 256×256×1, then 4 such modules are required, that is Figure 5 N2=5 as shown in FIG.
[0077] In the specific implementation process of the present invention, since the above-mentioned system framework is based on a deep learning method, a large amount of data is required for training, and the sampling speed in the actual scene is slow and the cost is high, the present invention uses the data generated in the high-precision simulator (the simulator refers to a program that can simulate the physical properties of deformable objects in a computer. In the specific embodiment of the present invention, the existing open source simulator can be directly used) for training, and then the model is migrated to the actual scene for application to reduce data costs. The data required by the system framework proposed in the preferred embodiment of the present invention is in the form of: (1) RGB image sequence during the operation of the deformable object; (2) The position corresponding to the grab and place operation of each operation.
[0078] The specific embodiment of the present invention generates simulation data in a simulator. First, a large amount of data of random interaction between a robot and a deformable object is generated in a simulation environment. The random interaction data generation process is as follows:
[0079] (1) Build a simulation scene (robotic arm, camera, etc.) in the simulator and randomly generate deformable objects (randomly set their color, stiffness and other attributes, i.e., domain randomization operation)
[0080] (2) Using the global information provided by the simulator, a point on the deformable object is randomly selected as a grasping point and a placement point is randomly generated. The robot is then made to perform grasping and placement operations in the simulation environment.
[0081] (3) Use the camera in the simulation environment to record the RGB images before and after the operation, and record the specific locations of the grabbing and placing operations taken during the operation.
[0082] (4) Repeat the above process T times to obtain a set of T-step random interaction data with the deformable object (wherein, the set of data refers to the initial state and the RGB image after each operation when the deformable object is operated T times, a total of T+1 images).
[0083] The present invention uses a large amount of random data generated by the above process to pre-train the model (the pre-trained model refers to the use of a large amount of random data to Figure 3 After training the system framework shown in the figure, the model parameters are obtained), and a pre-trained model is obtained. The pre-trained model contains model parameters such as the underlying shape information and dynamic change law of the deformable object. The parameters of these pre-trained models are deployed to Figure 3 The system framework (algorithm framework for how to operate deformable objects) shown in the figure can be applied. When the model needs to be deployed to a specific deformable object operation task in an actual scene, a small amount of expert teaching data in an actual scene is used for fine-tuning to complete the migration of the model. The training data generation and use method proposed in the present invention can improve the efficiency of data use and reduce the cost of obtaining training data.
[0084] The deformable object shape control system and method based on the spatiotemporal attention mechanism provided by the preferred embodiment of the present invention have the following advantages:
[0085] (1) Existing shape control frameworks for deformable objects are all designed based on single-step operations, and the models can only learn limited single-step operation capabilities. Therefore, these existing frameworks have problems such as low operation efficiency and the need for real-time human participation in practical applications. The framework proposed in the present invention is designed based on multi-step operations. By adopting a spatiotemporal attention mechanism to efficiently extract the target operation sequence and the feature information between sequences, the spatial feature information and temporal feature information of the teaching sequence are fully utilized, which further improves the operational efficiency and autonomy of the framework and reduces human participation.
[0086] (2) The existing deformable object shape control framework needs to collect a large amount of expert data for separate training for different shape control tasks, which has the problem of high data cost. The present invention introduces the idea of transfer learning and adopts the pre-training-fine-tuning method. First, a large amount of low-cost data with random interactions is used for training to obtain a pre-trained model. Then, only a small amount of expert data is used for fine-tuning for each specific task, which effectively solves the problem of data cost and utilization efficiency. Through the proposed training data generation method and the migration method from the simulation environment to the actual scene, the data cost is reduced and the data utilization efficiency is improved.
[0087] Another preferred embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the steps of the above method.
[0088] The background section of the present invention may contain background information about the problem or environment of the present invention, rather than describing the prior art by others. Therefore, the content contained in the background section is not an admission by the applicant that the prior art is available.
[0089] The above content is a further detailed description of the present invention in combination with specific / preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, without departing from the concept of the present invention, it can also make several substitutions or modifications to these described embodiments, and these substitutions or modifications should be regarded as belonging to the protection scope of the present invention. In the description of this specification, the description of reference terms "an embodiment", "some embodiments", "preferred embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in combination with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, in the absence of mutual contradiction, the technical personnel in this field can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples. Although the embodiments of the present invention and their advantages have been described in detail, it should be understood that various changes, substitutions and modifications can be made herein without departing from the scope defined by the attached claims.
Claims
1. A deformable object shape control system based on spatiotemporal attention mechanism, characterized in that: It includes a spatiotemporal feature extraction module and a grab and place location generation module, where: The spatiotemporal feature extraction module performs feature embedding on an input image of the current shape of the deformable object and an image group of a teaching operation sequence that reaches a target shape of the deformable object to obtain an embedded vector block, then extracts the spatiotemporal features of the embedded vector block, and screens out the spatiotemporal features of the current shape and the target shape in the embedded vector block from the extracted spatiotemporal features, rearranges the spatiotemporal features of the current shape and the target shape according to the spatial structures of the current shape and the target shape of the deformable object in the input image and the image group, respectively, to obtain two groups of feature vectors, then concatenates the two groups of feature vectors to obtain a spatiotemporal feature vector, and outputs the spatiotemporal feature vector to the grab and place generation module; The grasping and placing generation module includes a grasping point generation decoder and a placing point generation decoder, the grasping point generation decoder and the placing point generation decoder respectively receive the spatiotemporal feature vector, and obtain a grasping heat map and a placing heat map respectively according to the spatiotemporal feature vector, so that the robot can grasp and place deformable objects according to the grasping heat map and the placing heat map.
2. A shape control method for a deformable object based on a spatiotemporal attention mechanism, characterized in that: Using the system of claim 1 to control the shape of a deformable object comprises the following steps: S1: inputting an image of the current shape of the deformable object and an image group of a teaching operation sequence to achieve a target shape of the deformable object into the spatiotemporal feature extraction module, and performing feature embedding on the input image and image group to obtain an embedding vector block; S2: extracting the spatiotemporal features of the embedding vector block; S3: Filtering out the spatiotemporal features of the current shape and the target shape in the embedding vector block from the extracted spatiotemporal features; S4: according to the spatial structure of the current shape and the target shape of the deformable object in the image and the image group input to the spatiotemporal feature extraction module, the spatiotemporal features of the current shape and the target shape in step S3 are respectively rearranged to obtain two sets of feature vectors, and then the two sets of feature vectors are concatenated to obtain a spatiotemporal feature vector, and the spatiotemporal feature vector is output to the grab and place generation module; S5: the grasping point generation decoder and the placement point generation decoder respectively receive the spatiotemporal feature vector, and obtain a grasping heat map and a placement heat map according to the spatiotemporal feature vector, so that the robot can grasp and place the deformable object according to the grasping heat map and the placement heat map; S6: Acquire an image of the deformable object after the robot grasps and places the object, and use the image of the deformable object after the robot grasps and places the object as the image of the current shape of the deformable object to repeat steps S1 to S6 until a preset condition is met and stop.
3. The method according to claim 2, characterized in that The step S1 of embedding the input image and image group to obtain the embedding vector block specifically includes: decomposing each input image of size N×N into small blocks of a×a, and performing linear feature embedding on all the small blocks obtained by decomposition to embed them into M-dimensional feature vectors to obtain embedding vector blocks; the dimension of the spatiotemporal feature vector obtained in step S4 is Where a is divisible by N.
4. The method according to claim 2, characterized in that: Step S2 specifically includes: S21: performing a layer normalization operation on the embedding vector block, and performing a multi-head attention calculation on the embedding vector block in a time dimension; S22: Perform a residual connection between the embedding vector block calculated in step S21 and the embedding vector block input to step S21; S23: performing a layer normalization operation on the embedding vector block obtained in step S22, and performing multi-head attention calculation on the embedding vector block in the spatial dimension; S24: Perform a residual connection between the embedding vector block calculated in step S23 and the embedding vector block input to step S23; S25: performing a layer normalization operation on the embedding vector block obtained in step S22, and inputting the embedded vector block after the layer normalization operation into the multi-layer perceptron; S26: Perform a residual connection between the embedding vector block obtained in step S25 and the embedding vector block input to step S25; Repeat steps S21 to S26 at least once to extract the spatiotemporal features of the embedding vector block.
5. The method according to claim 2, characterized in that: In step S5, the grasping point generation decoder and the placement point generation decoder respectively upsample the spatiotemporal feature vector to generate a grasping heat map and a placement heat map, wherein each point in the grasping heat map represents the grasping success rate of the corresponding pixel point in the input image, and each point in the placement heat map represents the placement success rate of the corresponding pixel point in the input image. The robot grasps and places the deformable object using the pixel point corresponding to the maximum value in the grasping heat map as the grasping position and the pixel point corresponding to the maximum value in the placement heat map as the placement position.
6. The method according to claim 2, characterized in that In step S5, the grab point generation decoder and the placement point generation decoder respectively upsample the spatiotemporal feature vector in a progressive upsampling manner.
7. The method according to claim 6, characterized in that The grab point generation decoder and the placement point generation decoder respectively include log2n / m grab point generation decoding units and placement point generation decoding units, and each of the grab point generation decoding units and each of the placement point generation decoding units respectively perform the following steps: first, a 1×1 two-dimensional convolution operation is performed to change the number of channels of the feature vector, and then a bilinear difference operation is performed to double the original size; wherein n is the size of the spatiotemporal feature vector, and m is the size of the grab heat map or the placement heat map.
8. The method according to claim 2, characterized in that: Before executing steps S1 to S6, the method further includes S0: pre-training the system according to claim 1 using random data.
9. The method according to claim 8, characterized in that Repeat steps A1 to A4 to generate the random data used for pre-training, wherein steps A1 to A4 are as follows: A1: Build a simulation scene and randomly generate deformable objects; A2: Randomly select a point of the deformable object as a grasping point and randomly generate a placement point so that the robot can perform grasping and placement operations in the simulation scene; A3: Collect images before and after the robot performs grabbing and placing operations in the simulation scene to record the specific positions of the grabbing and placing operations when the robot performs grabbing and placing operations; A4: Repeat steps A1 to A3 T times to obtain a set of T-step random interaction data with the deformable object.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the steps of the method according to any one of claims 2 to 9.
