Aspects of the present disclosure relate to motion control using machine learning specifically aspects of the present disclosure relate to the training and use of Neural Networks in physics based animation and motion control systems.
A common technique for models is to create a virtual skeleton for the model with flexible or movable joints and rigid bones. A virtual skin is overlaid on top the virtual skeleton similar to how human muscle, fat, organs, and skin is integrated over bones. Human artists then painstakingly hand animate movement sets for the object using the virtual skeleton as a guide for the range of motion. This is a time consuming process and also requires an artistic touch as there is a narrow window between life like movements and movements that fall into the uncanny valley. Some production studios avoid the difficult and time-consuming process of life-like animation by employing motion capture of human models. This technique is expensive and can be time consuming if a large number of motions are required or if there are many different characters that need to be modeled.
Robots may be modeled virtually with bones for rigid sections and joints for movable sections. This type of model control makes it easier for robot animators to create life-like movements for the robot. Movement of the joints in the virtual skeleton may be translated to movement of the motors controlling the joints in the robot. The virtual model applies constraints to the joints to simulate the real world limitations of the joints of the robot. Thus, a virtual model of the robot may be used to control the physical robot. This sort of control is useful for animatronics.
A major problem with animation is the need for human controlled movement creation. Hand animation of characters is time consuming and infeasible for situations where many characters are needed with different movement characteristics, such as a scene of a mall in space where there are many different alien characters that have vastly different anatomies. One technique that has been used to lighten the load of animators in these situations is to generate one or two different movement models and then apply those movement models randomly to moving characters in the scene. This technique works well with many different models and a few different characters but on large scale, it creates a noticeable unnatural effect where many characters obviously are identical.
Machine learning represents an area that could be employed in character animation to reduce the need for human animators. Currently movement produced by neural networks trained using machine learning techniques results in unnatural jittery movements and special efforts have to be taken and or constraints on the solution put in place to avoid the problem of jitter.
It is within this context that aspects of the present disclosure arise.
The teachings of the present disclosure can be readily understood by considering the following detailed description in conjunction with the accompanying drawings, in which:
Although the following detailed description contains many specific details for the purposes of illustration, anyone of ordinary skill in the art will appreciate that many variations and alterations to the following details are within the scope of the invention. Accordingly, the exemplary embodiments of the invention described below are set forth without any loss of generality to, and without imposing limitations upon, the claimed invention.
Physics based animation requires a control scheme to generate joint actuator commands in such a way that it fulfills 3 goals at the same time: 1) approximately follow target animation; 2) preserve balance (don't fall down in case of walk, for example); 3) recover from external disturbances such as stumbling, external force, real/virtual model mismatch. According to aspects of the present disclosure, smooth life-like motions of a character may be obtained through training a NN to accept controlled mechanism/object sensor readings/observations as inputs and outputs either first or second derivative of mechanism servo control commands. The commands in the case of first derivative are passed through external time integration. Output of time integration goes a) back to NN and b) to controlled mechanism. In the case of second derivative described above pattern is repeated twice. After first integration, result goes a) back to NN and b) to second integration. After second integration, the output similarly goes a) back to NN and b) to controlled mechanism.
General Neural Network Training
According to aspects of the present disclosure, the control input scheme may use machine learning with neural networks (NN). The NNs may include one or more of several different types of neural networks and may have many different layers. By way of example and not by way of limitation the neural network may consist of one or multiple convolutional neural networks (CNN), recurrent neural networks (RNN) and/or dynamic neural networks (DNN). The Motion Decision Neural Network may be trained using the general training method disclosed herein.
In some embodiments, a convolutional RNN may be used. Another type of RNN that may be used is a Long Short-Term Memory (LSTM) Neural Network which adds a memory block in a RNN node with input gate activation function, output gate activation function and forget gate activation function resulting in a gating memory that allows the network to retain some information for a longer period of time as described by Hochreiter & Schmidhuber “Long Short-term memory” Neural Computation 9(8):1735-1780 (1997), which is incorporated herein by reference.
As seen in
where n is the number of inputs to the node.
After initialization the activation function and optimizer is defined. The NN is then provided with a feature vector or input dataset at 142. Each of the different feature vectors may be generated by the NN from inputs that have known labels. Similarly, the NN may be provided with feature vectors that correspond to inputs having known labeling or classification. The NN then predicts a label or classification for the feature or input at 143. The predicted label or class is compared to the known label or class (also known as ground truth) and a loss function measures the total error between the predictions and ground truth over all the training samples at 144. By way of example and not by way of limitation the loss function may be a cross entropy loss function, quadratic cost, triplet contrastive function, exponential cost, etc. Multiple different loss functions may be used depending on the purpose. By way of example and not by way of limitation, for training classifiers a cross entropy loss function may be used whereas for learning pre-trained embedding a triplet contrastive function may be employed. The NN is then optimized and trained, using the result of the loss function and using known methods of training for neural networks such as backpropagation with adaptive gradient descent etc., as indicated at 145. In each training epoch, the optimizer tries to choose the model parameters (i.e., weights) that minimize the training loss function (i.e. total error). Data is partitioned into training, validation, and test samples.
During training, the Optimizer minimizes the loss function on the training samples. After each training epoch, the model is evaluated on the validation sample by computing the validation loss and accuracy. If there is no significant change, training can be stopped and the resulting trained model may be used to predict the labels of the test data.
Thus, the neural network may be trained from inputs having known labels or classifications to identify and classify those inputs. Similarly, a NN may be trained using the described method to generate a feature vector from inputs having a known label or classification. While the above discussion is relation to RNNs and CRNNS the discussions may be applied to NNs that do not include Recurrent or hidden layers.
Reinforcement Learning
According to aspects of the present disclosure, the NN training may include reinforcement learning. Reinforcement Learning is an area of machine learning concerned with how software agents ought to take actions in an environment so as to maximize some notion of cumulative reward. It may be used without a neural network but in situations where there are many possible actions a NN layout may be employed to capture the elements in reinforcement learning.
The goal of reinforcement learning is to choose the optimal action based on a current state. A reward mechanic is used to train the reinforcement model to make the correct decision based on the state. It should be noted that the reinforcement model is not limited to Neural Network and may include for example and without limitation values in a table or spreadsheet.
Loss=Σ(feedback−Q)2 EQ. 1
In reinforcement learning one example of feedback may be given by the Q-learning equation:
feedback=r(i,a,j)+λ maxb Q(j,b) EQ. 2
Where the immediate reward is denoted by r(i, a, j,) where i is the current state, a is the action chosen at current state and j is the next state. The value of any state is given by the maximum value of Q value of actions in that state. Thus max Q(j,b) represents the expected reward from the best possible action taken at the following state. λ represents the a future state discounting factor which serves to bias learning towards choosing immediate rewards. In some embodiments the λ=1/(1+R) where R is a discounting rate chosen to suit the particular task being learned. In the case of applications using Q-learning the controls must be made discrete for applications involving physical simulations or robots.
Thus, in reinforcement learning after an action is taken a feedback is calculated and a loss function is calculated using the feedback. The model is then updated using the loss function and backpropagation with adaptive gradient descent.
In other embodiments, a Proximal Policy Optimization training algorithm may be used. Such an algorithm uses two networks: a Policy network to determine which action to take and an Advantage network to determine how good each action is, given the current state. Some implementations of the motion decision NNs 202 may include a policy subnetwork configured to provide a probability distribution for each action that is optimal for achieving the desired effect 204 given the current state 201 and an advantage subnetwork for determining how good each action is given the current state 201. In other words, the policy π(s,a)=p(a|s) represents the conditional probability density function of selection action a∈A in state s∈S at each control step t; the network receives a state st and samples an action at from π. The environment responds 204 with a scalar reward rt 205 and a new state st′=st+1 206 sampled from its dynamics p(s′|s,a). For a parameterized policy, πθ(s,a) the goal of the agent is to learn the parameters θ, which maximize cumulative reward given by the equation:
J(πθ)=E[Σt=0Tγtrt|πθ] EQ. 3
Where γ∈[0,1] a discounting factor and T is the training horizon. The gradient of the expected reward ∇θJ(πθ) can be determined using a policy gradient theory, which adjusts policy parameter θ to provide a direction of improvement according to the equation:
∇θJ(πθ)=∫Sdθ(s)∫A∇θ log(πθ(s,a))(s,a)dads EQ. 4
dθ(s)=∫SΣt=0Tγtp0(s0)(p(s0→s|t, πθ)ds0 is a discounted state distribution, p0 is an initial state distribution and p(s0→s|t,πθ)models the likelihood of reaching state s by starting at s0 and following the policy πθ(s,a) for T steps. (s,a) represents a general advantage function. There are many advantage functions for policy gradient based reinforcement learning and any suitable advantage function may be used with this function according to aspects of the present disclosure. One advantage function that may be used is a one-step temporal advantage function given by the equation:
(st,at)=rt+γV(s′t)−V(st) EQ. 5
Where V(s)=[Σt=0Tθtrt|s0=s,πθ] is a state-value function defined recursively through EQ. 6
V(st)=r
Parameterized value function Vϕ(s), with parameters ϕ are learned iteratively similar to Q-learning as described above. The bellman loss function is minimized in this case according to the form:
L(ϕ)=s
πθ and Vϕ are trained in tandem using an actor critic framework. The action network may be biased toward exploration using a Gaussian distribution with a parameterized mean μθ and a fixed covariance matrix Σ=diag{σi2} where σi is specified for each action parameter. Actions are sampled from the distribution by applying Gaussian noise to the mean action choice EQ. 8
at=μθ(st)+(0,Σ) EQ. 8
The Gradient for maximizing the action choice in EQ. 8 takes the form:
∇θJ(μθ)=∫Sdθ(s)∫A∇θμθ(s)Σ−1(a−μθ(s))(s,a)dads EQ. 9
The result of optimization of the gradient EQ. 9 is to shift the mean of the action distribution towards actions that lead to higher expected rewards and away from lower expected rewards. For additional information see Peng et al. “Learning Locomotion Skills Using Deep RL: Does Choice of Action Space Matter?” SCA'17 Jul. 28, 2017.
Application to Movement
According to aspects of the present disclosure, the NN may be trained with a machine-learning algorithm to mimic realistic movement. The training set may be for example and without limitation, a time sequence of positions in space, directions, and/or orientations of a preselected subset of controlled object body parts. It is up to the machine learning algorithm to prepare a NN which is capable of changing joint angles in such a way that the controlled object exhibits a desired behavior and preserves balance at the same time. By way of example and not by way of limitation, time sequence of positions in space, directions, and/or orientations may be generated by motion capture of real movement, hand animation using motion capture dolls, hand animation using a virtual models, or any other method of capturing a set of realistic movements. In some embodiments, the training may use a reward function that uses misalignment errors of various raw and/or integral parameters which evolve the reward function towards a desired movement.
The State 201 may be a feature transformation Φ(q,v,ε) where ε is an integral input taken from the integral of velocity with respect to time ε=(∫vdt) generated as an output of the NN. According to some alternative aspects of the present disclosure, the feature transformation Φ(q,v,ε,i) may be include the second integral of acceleration with respect to time i=(∫∫Adt). The transformation extracts a set of features from inputs to place them in a form compatible with the variable of the model being trained. In training it useful to include target reference motions Φ({circumflex over (q)},{circumflex over (v)},{circumflex over (ε)}) thus giving a combined state of st=Φ(q,v,ε), Φ({circumflex over (q)},{circumflex over (v)},{circumflex over (ε)}).
The reward function may consist of a weighted sum of terms that encourage the policy to follow the reference motion:
r=wpositionrposition+wintegralrintegral EQ. 10
Where w is a weight for the given term and r reference term. According to aspects of the present disclosure, the reward function may include terms for example and without limitation, any of the reference position, velocity, torque, integral inputs and rewards for specific achievements (like lifting a foot when necessary). Additionally the reward function may include penalties subtracted from the reward for doing unwanted like, without limitation, falling down or stumbling. Iterations of the network may be trained updating algorithm to apply updates to the state as soon as possible based on sample rates of the inputs.
For this purpose, input includes as many observations as possible. All available sensor readings are fed into NN. Some sensor readings are also preprocessed. For example, accelerometer and gyroscope readings are fed both as-is and fused into attitude and gravity direction in robot's ref frame. Preprocessed readings are also fed into NN.
Improved Motion Control with NNs
One major problem with NN control is choosing which information to provide to the NN as input, which is enough to restore dynamical state of the system at each moment in time. As depicted on
As shown in
The motion decision NN 307 as discussed above, may be trained iteratively using machine learning algorithms that include reinforcement learning techniques such as policy learning. Q-leaning may be applied with discretized controls additionally any other machine learning technique suitable for the task may be used with control scheme provided according to aspects of the present disclosure. The motion decision NNs 307 may include additional subnetworks to generate embeddings or otherwise process state data. The motion decision NNs 307 may be configured to output one or more types of information to the movable joint or a motor/actuator controlling the movable joint.
The movable joint 302 may move based on the information output 309 by the motion decision NN 307 and this change may be detected by the sensor 303. Subsequently the new position and acceleration information may be used by the NN in a repetition of the process described above. This cycle may continue until a goal is achieved.
Here, an improvement to smooth movement imparted with the movable joint is achieved with the addition of integrated output 304 feedback calculated at the integrator 305 from the output 308 of the NN 307. One explanation for the smoothing effect created according to aspects of the present disclosure may be that the integral of the step function is a continuous function and the discontinuous controls output by the NN are converted to continuous actuator controls after going through the integrator.
As shown in
It should be noted that the controller or variable monitor according to aspects of the present disclosure may also detect torque from the movable joint and the torque information may also be provided to the NNs. The NNs may also be configured to produce torque information.
Control inputs obtained as discussed herein may be used for control of physical robots as well as for control of robot simulations, e.g., in video games, cloud video games, or game development engines, such as Unity3D from Unity Technologies of San Francisco, California, Lumberyard from Amazon Game Studios of Seattle, Washington, and Unreal Engine by Epic Games of Cary, North Carolina
System
The computing device 600 may include one or more processor units 603, which may be configured according to well-known architectures, such as, e.g., single-core, dual-core, quad-core, multi-core, processor-coprocessor, cell processor, and the like. The computing device may also include one or more memory units 604 (e.g., random access memory (RAM), dynamic random access memory (DRAM), read-only memory (ROM), and the like).
The processor unit 603 may execute one or more programs, portions of which may be stored in the memory 604 and the processor 603 may be operatively coupled to the memory, e.g., by accessing the memory via a data bus 605. The programs may include machine learning algorithms 621 configured adjusts the weights and transition values of NNs 610 as discussed above where, the NNs 610. Additionally, the Memory 604 may store an integrated outputs 608 that may be used, as input to the NNs 610 as state data additionally the integrated outputs may be stored database 622 for later training iterations. Sensor data 609 generated from the sensor may be stored in the Memory 604 and used as state data with the NNs 610 where the sensor data is either from a real sensor or a virtual model. The memory 604 may also store a database 622, the database may contain other information such as information associated with creation and movement of the virtual character rig, reference movement information and movement simulations. Additionally, the database 622 may be used during generation of the error 608 to store integral values of Control data 609 according to
Control data and the error, may be stored as data 618 in the Mass Store 615. The processor unit 603 is further configured to execute one or more programs 617 stored in the mass store 615 or in memory 604 which cause processor to carry out the one or more of the methods described above.
The computing device 600 may also include well-known support circuits, such as input/output (I/O) 607, circuits, power supplies (P/S) 611, a clock (CLK) 612, and cache 613, which may communicate with other components of the system, e.g., via the bus 605. The computing device may include a network interface 614. The processor unit 603 and network interface 614 may be configured to implement a local area network (LAN) or personal area network (PAN), via a suitable network protocol, e.g., Bluetooth, for a PAN. The computing device may optionally include a mass storage device 615 such as a disk drive, CD-ROM drive, tape drive, flash memory, or the like, and the mass storage device may store programs and/or data. The computing device may also include a user interface 616 to facilitate interaction between the system and a user. The user interface may include a monitor, Television screen, speakers, headphones or other devices that communicate information to the user.
The computing device 600 may include a network interface 614 to facilitate communication via an electronic communications network 620. The network interface 614 may be configured to implement wired or wireless communication over local area networks and wide area networks such as the Internet. The device 600 may send and receive data and/or requests for files via one or more message packets over the network 620. Message packets sent over the network 620 may temporarily be stored in a buffer in memory 604. The control data 609 and NNs 610 may be available through the network 620 and stored partially in memory 604 for use.
While the above is a complete description of the preferred embodiment of the present invention, it is possible to use various alternatives, modifications and equivalents. Therefore, the scope of the present invention should be determined not with reference to the above description but should, instead, be determined with reference to the appended claims, along with their full scope of equivalents. Any feature described herein, whether preferred or not, may be combined with any other feature described herein, whether preferred or not. In the claims that follow, the indefinite article “A”, or “An” refers to a quantity of one or more of the item following the article, except where expressly stated otherwise. The appended claims are not to be interpreted as including means-plus-function limitations, unless such a limitation is explicitly recited in a given claim using the phrase “means for.”
Number | Name | Date | Kind |
---|---|---|---|
5719480 | Bock et al. | Feb 1998 | A |
9786202 | Huang et al. | Oct 2017 | B2 |
10937240 | Anderson | Mar 2021 | B2 |
11278433 | Herr et al. | Mar 2022 | B2 |
20030216895 | Ghaboussi et al. | Nov 2003 | A1 |
20050179417 | Takenaka et al. | Aug 2005 | A1 |
20070255454 | Dariush | Nov 2007 | A1 |
20080027582 | Obinata et al. | Jan 2008 | A1 |
20110270443 | Kamiya et al. | Nov 2011 | A1 |
20120166165 | Nogami | Jun 2012 | A1 |
20140107841 | Danko | Apr 2014 | A1 |
20170083047 | Hélot et al. | Mar 2017 | A1 |
20170183047 | Takagi et al. | Jun 2017 | A1 |
20170252922 | Levine | Sep 2017 | A1 |
20170334066 | Levine | Nov 2017 | A1 |
20180001206 | Osman | Jan 2018 | A1 |
20180250812 | Narukawa | Sep 2018 | A1 |
20190324538 | Rihn et al. | Oct 2019 | A1 |
20190384316 | Qi et al. | Dec 2019 | A1 |
20200139539 | Hasunuma et al. | May 2020 | A1 |
20200143229 | Made et al. | May 2020 | A1 |
20200160535 | Akbarian et al. | May 2020 | A1 |
20200218365 | Todorov et al. | Jul 2020 | A1 |
20200290203 | Taylor et al. | Sep 2020 | A1 |
20200293881 | Taylor | Sep 2020 | A1 |
20200319721 | Erivantcev | Oct 2020 | A1 |
Number | Date | Country |
---|---|---|
3133873 | Apr 2020 | CA |
107610208 | Jan 2018 | CN |
110007750 | Jul 2019 | CN |
111653010 | Sep 2020 | CN |
201905729 | Feb 2019 | TW |
202026846 | Jul 2020 | TW |
2012079541 | Jun 2012 | WO |
2017129200 | Aug 2017 | WO |
2020008878 | Jan 2020 | WO |
Entry |
---|
Erlhagen et al, “The dynamic neural field approach to cognitive robotics” In J. Neural Eng. 3 (2006), R36-R54, [online] [retrieved on Jan. 5, 2022 (Jan. 5, 20220] Retrieved from the Internet. |
Hu et al, “Impedance with Finite-Time Control Scheme for Robot-Environment Interaction” in Mathematical Problems in Engineering, vol. 2020, Article ID 2796590 , 18 Pages May 25, 2020, [online] [retrieved on Jan. 5, 2022 (Jan. 5, 20220] Retrieved from the Internet. |
International Search Report and Written Opinion for International Application No. PCT/US2021/58388, Feb. 4, 2022. |
International Search Report and Written Opinion for International Application No. PCT/US2021/58390, Feb. 7, 2022. |
International Search Report and Written Opinion for International Application No. PCT/US2021/58392, Feb. 7, 2022. |
Peng et al., “Sim-to-Real Transfer of Robotic Control with Dynamics Randomization” in arXiv:1710.06537, 8 Pages, Submitted on Oct. 18, 2017 (v1), last revised Mar. 3, 2018 (this version, v3)], [online] [retrieved on Apr. 13, 2022 (Apr. 13, 2022] Retrieved from the Internet. |
Taiwanese Office Action for Country Code Application No. 893689, dated Jun. 28, 2022 . |
Arthur Juliani “Simple Reinforcement Learning with Tensorflow Part 8: Asynchronous Actor-Critic Agents (A3C)” Medium, Dated: Dec. 16, 2016, Available at: https://medium.com/emergent-future/simple-reinforcement-learning-with-tensorflow-part-8-asynchronous-actor-critic-agents-a3c-c88f72a5e9f2. |
Arthur Juliani, “Simple reinforcement Learning with Tensorflow Part 0: Q-learning with Tables and Neural Networks” Medium, dated: Aug. 25, 2016. Available at: https://medium.com/emergent-future/simple-reinforcement-learning-with-tensorflow-part-0-q-learning-with-tables-and-neural-networks-d195264329d0. |
Arthur Juliani, “Simple Reinforcement Learning with Tensorflow: Part 2—Policy-based Agents” Medium, Dated: Jun. 24, 2016. Available at: https://medium.com/@awjuliani/super-simple-reinforcement-learning-tutorial-part-2-ded33892c724. |
Zaiqiang Wu, et al. “Analytical Derivatives for Differentiable Renderer: 3D Pose estimation by Silhouette Consistency” Zhejiang University, ArXiv:1906.07870v1, Jun. 19, 2019 available at: https://arxiv.org/pdf/1906.07870v1.pdf. |
Coulom, Remi “Apprentissage par renforcement utilsant des resaux de neurones, avec des applications au control moteur” PHD Thesis Institute Nat. Polytech. of Grenoble Jun. 19, 2002. |
Ghoshavi, Abhijit “Neural Networks and Reinforcement Learning” Slide presentation Dept. of Eng. Mgmt. and Sys. Eng. Missouri Univ. of Sci. and Tech. Accessed Nov. 6, 2019. |
Kniewasser, Gerhard et al. “Reinforcemetn Learning with Dynamic Movement Primitives—DMPs” Dept. of Theoretical Comp. Sci. Univ. of Tech., Graz (2013) Accessed Nov. 6, 2019. |
Kober, Jens et al. “Reinforcement Learning to Adjust Robot Movements to New Situations” Proceedings of the Twenty-Second Int. Joint Conf. on Artificial Intelligence p. 2650-2655 Accessed Nov. 6, 2019. |
Peng, Xue Bin, and Michiel van de Panne. “Learning Locomotion Skills Using DeepRL.” Proceedings of the ACM SIGGRAPH / Eurographics Symposium on Computer Animation—SCA '17 (2017). |
Sepp Hochreiter et al., “Long Short-Term Memory”, Neural Computation, 9(8) 1735-1780, 1997, Cambridge, MA. |
Non-Final Office Action for U.S. Appl. No. 17/095,617, dated Oct. 26, 2023. |
Non-Final/Final Office Action for U.S. Appl. No. 17/095,640, dated Sep. 13, 2023. |
Notice of Allowance for U.S. Appl. No. 17/095,640, dated Feb. 22, 2024. |
Final Office Action for U.S. Appl. No. 17/095,617, dated Apr. 19, 2024. |
Bazzi, D., Messeri C., Zanchettin A. M., Rocco P. “Identification of Robot Forward Dynamics via Neural Network” Oct. 2020, 4th international Conference on Automation, Control and Robotics (ICACR) (pp. 13-21), IEEE. (Year:2020). |
Final Office Action for U.S. Appl. No. 17/095,586, dated Sep. 25, 2024. |
Kiemel, J. C. et al. “Learning Robot Trajectories Subject to Kinematic Joint Constraints,” Nov. 1, 2020. arXiv preprint arXiv: 2011.00563. (Year:2020). |
Kiemel, J.C. et al. True Aedept: Learning Smooth Online Trajectory Adaptation with Bounded Jerk, Acceleration and Velocity in Joint Space. Oct. 2020. In 2020 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) (pp. 5387-5394). IEEE. (YEar:2020). |
Non-Final Office Action for U.S. Appl. No. 17/095,586, dated May 6, 2024. |
Non-Final Office Action for U.S. Appl. No. 17/095,617, dated Dec. 4, 2024. |
Number | Date | Country | |
---|---|---|---|
20210158141 A1 | May 2021 | US |