{'fraction_non_alphanumeric': 0.026418735198666783, 'fraction_numerical': 0.00924480308744847, 'mean_word_length': 4.721770551038844, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Generating Emotive Gaits for Virtual Agents Using Affect-Based Autoregression

We present a novel autoregression network to generate virtual agents that convey various emotions through their walking styles or gaits. Given the 3D pose sequences of a gait, our network extracts pertinent movement features and affective features from the gait. We use these features to synthesize subsequent gaits such that the virtual agents can express and transition between emotions represented as combinations of happy, sad, angry, and neutral. We incorporate multiple regularizations in the training of our network to simultaneously enforce plausible movements and noticeable emotions on the virtual agents. We also integrate our approach with an AR environment using a Microsoft HoloLens and can generate emotive gaits at interactive rates to increase the social presence. We evaluate how human observers perceive both the naturalness and the emotions from the generated gaits of the virtual agents in a web-based study. Our results indicate around 89% of the users found the naturalness of the gaits satisfactory on a five-point Likert scale, and the emotions they perceived from the virtual agents are statistically similar to the intended emotions of the virtual agents. We also use our network to augment existing gait datasets with emotive gaits and will release this augmented dataset for future research in emotion prediction and emotive gait synthesis. Our project website is available at https://gamma.umd.edu/gen_emotive_gaits/.


INTRODUCTION
The generation of intelligent virtual agents (IVAs) is important for many virtual and augmented reality systems. The virtual agents correspond to embodied digital characters that are often used as avatars to represent the users and may look like real-world characters. Recent work in photorealistic rendering and capturing technologies has resulted in generating agents or avatars that closely resemble the humans and are widely used in VR and AR systems [2,21].
Many applications, including virtual assistance, training, and AI chatbots, need a computationally created virtual agent or an avatar that not only looks like a real human but also behaves like one and conveys emotions [35,60]. Perception of such emotional expressiveness is commonly described as the ability of an observer to make decisions on a subject's emotional state by observing certain patterns or cues physically expressed by the subject [22,58,66]. These physical cues are expressed through various "modalities," including, but not limited to, facial expressions [17], tones of voice [19], gestures, body expressions [15], walking styles or "gaits" [47], etc. Emotions coming from such different modalities [45], in conjunction with the different underlying situational and social contexts [32,46], have a significant impact on our everyday lives. They influence our social interactions and relationships and provide key insights into developing healthy social environments [29]. Similarly, emotions can greatly impact the perception of these virtual agents in terms of social presence and how the users behave when interacting with them in AR and VR environments [34,48,60].
In this paper, we mainly focus on designing virtual agents that are capable of expressing different emotions through their gaits, i.e. virtual agents with emotive gaits. When perceiving emotions from gaits, humans generally look at physical expressions such as arm swing, stride length, upper-body posture, head jerk, etc. [13], collectively referred to as affective features. In fact, studies have shown that observers often rely on such cues from gaits and other body expressions, especially when there are mismatches with cues from more common modalities such as facial expressions [4]. As a result, it is useful to generate virtual agents with emotive gaits for gaming and social VR [52,71], crowd simulation, and path planning [6,50], anomaly detection [63], therapy, rehabilitation [65], and psychology and neurobiology [5,51,68]. Studies indicate that virtual agents expressing various moods, emotions, and behaviors elicit more empathy and engagement from humans interacting with them [64]. However, automated methods to generate gaits that express certain emotions are challenging to design and implement. This is hard not only because of the complexity of modeling periodic and aperiodic motions constituting different gaits, but also because of the individual, social, and cultural diversities in terms of both expressing and perceiving emotions [3,20]. These challenges are further exacerbated by the difficulty of collecting and annotating large benchmark datasets of gaits with appropriate emotion labels. Datasets collected in controlled experimental settings are often exaggerated and not always generalizable. On the other hand, datasets collected in the wild often suffer from the long-tail nature of the distribution of emotions, with most emotion being close to neutral. Therefore, there is a need to develop automated methods to synthesize emotive gaits for virtual agents that can augment the existing datasets.
There is an extensive work in AR/VR, computer graphics, vision and related areas such as biomechanics, on automated techniques for generating human characters capable of performing locomotion activities, including walking, running, leaping, and more [24,25,57,[60][61][62]75]. These methods make use of movement features such as joint rotations, joint velocities, frequency of foot contact with the ground, and walking phases, and combine them with structural and kinematic constraints of the human body and learning techniques. While these methods can generate plausible locomotion, walking patterns, and actions, it is non-trivial to add emotional components to these techniques or use them to generate emotive gaits. Main Results: We present a novel autoregression method that takes as input 3D pose sequences of the gaits of virtual agents (VAs) and efficiently combines pose affective features such as arm swings, head jerks, body posture and more, and movement features such as stepping speed, root height and more, to generate future pose sequences of emotive gaits. We present a network architecture that incorporates both spatial information and spectral information available from the input pose sequences and enables the VAs to both express and transition smoothly between different emotions while walking. We construct VAs as both stick figures and human models using our generated emotive gaits and integrate these VAs in an AR environment using the Microsoft HoloLens ( Figure 1). Our learningbased algorithm takes a few milliseconds to generate an emotive gait for each agent on a pair of NVIDIA GeForce GTX 1080Ti GPUs. Our VAs, overlayed onto a real-world room, are rendered at interactive rates to increase their sense of social presence. The novel components of our work include: • An autoregression network that takes in 3D pose sequences of a VA's gait, the desired future trajectory, and the desired emotions. It outputs the VA's gait expressing the given emotion while following the given trajectory. • A novel training method combining movement features and psychologically-motivated affective features into a unified network to generate plausible, emotionally-expressive gaits. • A transition scheme for the characters to smoothly transition between gaits expressing different emotions. • An elaborate web-based user study to evaluate the benefits of the emotive gaits generated by our algorithm. We asked the observers to report the emotions they perceived from the generated gaits, as well as the Likert scale (LS) values of pose affective features that contributed to their perception. Based on the study, we conclude that -There is strong statistical evidence to suggest that the observers' perceived emotions are statistically similar to the corresponding intended emotions of our VAs, thereby showing that the generated gaits are emotive, -The observers consistently reported different LS values of the pose affective features for different emotions, making our choice of pose affective features statistically significant for perceiving emotional expressiveness. • An augmented dataset, "Synthesized Emotive Gait," which provides emotive gaits generated by our method to facilitate more research in this area.

RELATED WORK
In this section, we briefly survey prior work on representing emotions, perceiving emotions from gaits, generating and styling gaits for virtual agents, and making virtual agents emotionally expressive.

Modeling and Perceiving Emotions from Gaits
Various models for representing emotions have been studied in psychology, and the Valence-Arousal-Dominance (VAD) model [44] is one of the most popular. The VAD model considers a continuous 3D space, spanned by the valence, arousal, and dominance axes.
Valence is a measure of the pleasantness of emotion, arousal is a measure of the intensity of expression, and dominance is the measure of how much emotion makes one feel in control. Many methods use a simpler model that is a linear combination of discrete emotions and represents a subset of VAD. Humans perceive these emotions by observing physical features or cues expressed via different modalities. Studies conducted by Montepare et al. [47] concluded that observers were able to perceive emotions by only looking at the subjects' gaits. Subsequently, Roether et al. [66] and Gross et al. [22] identified that observers were most consistent when looking at gaits expressing emotions that varied on the arousal axis. Follow-up studies looked more closely at the gait-based expressions observers focused on for distinguishing between different perceived emotions and identified features including arm swing, gait velocity, upper body posture, and head jerk [9,10,13,28]. In contrast to prior approaches, our goal is to use affective features and movement features to synthesize gaits with emotions varying on the arousal axis.

Emotional Expressiveness in Virtual Agents
Prior works have commonly explored the generation of emotionally expressive virtual agents via modalities such as verbal communication [11,70], face movements [18], body gestures [27], and gaits [60][61][62]. These generation techniques have had significant performance benefits when combined with concepts from affective computing. For example, Pelczer et al. [55] designed a strategy to evaluate the accuracy of identifying the modalities of emotional expressiveness in a virtual agent. McHugh et al. [43] explored how different body postures influenced the emotion perception of individual agents in crowds. Clavel et al. [12] studied the combined effect of faces and postures of virtual agents on emotion perception, and Liebold et al. [39] generalized this to include combinations of other modalities such as verbal cues and faces. More recently, Randhavane et al. [61] developed an empirical mapping between gait and gaze features and different emotions to generate emotionally expressive virtual agents. Our approach to generating emotive gaits is complementary to these methods and can be combined with them.

Generating and Styling Gaits for Virtual Agents
There has been extensive prior work in computer graphics and AR/VR for generating and styling gaits for virtual agents. Early The last three figures on the bottom row show the triangles we use to compute area ratios. We use the ratios T 1 . These features are used by our network to generate emotive gaits of the virtual agents.
approaches used patch-based building blocks [36], kernel-based approaches [73], or modeled the motion paths as directed graphs [33] to generate natural-looking movement styles. Recent approaches have leveraged large-scale datasets using deep learning-based approaches to generate diverse movement styles. These approaches include training a network on specific joint trajectories [25,67], using periodic phase-functions, which are either modeled geometrically [24] or learned with a neural network [72], to represent walking cycles, and exploiting transfer to reduce over-dependency on data [42]. Other approaches use deep reinforcement learning to learn control policies for virtual characters exhibiting different movement styles and actions [37,53,56,57]. Yet other approaches model motion prediction as an autoregression problem, and have utilized recurrent networks [54] and convolutional networks [38] on motion captures pose sequences, and generative adversarial learning on dynamic pose graphs [14], to predict future motions. While these methods are not built for motion styling, their key concepts have been useful in developing many motion-based style transfer methods [16,30,74].
In contrast with these methods, we combine walking phases and gait-based affective features in an autoregression network to estimate future joint rotations and movement features for different emotive gaits. Instead of a DRL-based control policy, our network learns a feature-based latent representation space and maps from that space to emotion-styled predicted poses. Furthermore, our emotion styles are sampled from a continuous space of emotions. Therefore, they need to be modeled differently from conventional styles, which can be viewed as one-hot labels in a discrete space. We also demonstrate that our approach can generate gaits expressing a continuous range of emotions, for AR applications.

GENERATING EMOTIVE GAITS
In this section, we present our approach for generating emotive gaits of VAs. The inputs to our algorithm are the sample gaits of a VA provided as motion capture data, the desired trajectory, and the desired emotion. Our goal is to generate subsequent predictions of the gait that follow the desired trajectory and express the desired emotion. Since our approach depends only on the input motioncaptured gait samples and the desired trajectories, we can adapt to VAs with different skeletal dimensions, different natural walking styles, as well as to different AR environments.

Emotion Model
We choose to use an emotion model consisting of linear combinations of categorical emotions varying primarily on the arousal axis (happy, angry, sad, etc.). Although this model admittedly spans a smaller set of emotions than the VAD model, prior works have reported that categorical emotion terms are more easily understood by non-experts, leading to the availability of more labeled data and the generation of a diverse range of emotions [9,59].

Construction of the Generative Components
We present various components used by our network to perform generation: input gaits, emotions, pose affective features, and trajectory features.

Gaits
We denote a gait G as , where x t j , y t j , z t j denotes the 3D positions of joint j at time step t in the world frame, J denotes the total number of joints, and T denotes the total number of input time steps. The input to our network are joint rotations extracted from the gait G, and control signals obtained from the gait, its trajectory, and the associated emotions.
At each time step t, we model the pose graph of the input gait as a directed tree, as shown in Figure 2. The root joint in the pose is the root node of the tree and the two toes, the two hand indices, and the head, are the leaf nodes the tree. All edges in the tree are directed from the root node to the leaf nodes. We denote the parent of a joint j as P ( j). In our construction, each joint has a unique parent, except the root joint, which has no parent. We therefore assign P ( j) = −1 for the root joint. For each joint j at each time step t, we consider the rotation R t j ∈ SO (3) that transforms the joint from its offset o j ∈ R 3 -a pre-defined initial position relative to its parent P ( j) -to its position at time step t relative to its parent. That is, we consider the rotation R t j such that the global position X t j of the joint j at time step t is given by X t j = R t j o j + X t P( j) . For the root joint, we consider o 0 = 0 and obtain its position directly from the gait G.
Following the approach taken by Pavllo et al. [54], we represent these rotations as unit quaternions or versors q t j ∈ H ⊂ R 4 , where H denotes the space of versors. We have chosen to represent rotations as versors, as they are free of the gimbal-lock problem. We enforce the additional unit norm constraints for these versors when training our network. Thus, for each gait, our input rotations are given as We do not consider q t 0 for the root joint denoted by 0 as part of the input data, since o 0 = 0.

Emotions
We note that the modeling of emotions is fundamentally different from modeling conventional motion styles such as strutting, zombielike, etc. These conventional styles can be considered "discrete", such that clips or images can be categorized as belonging to a particular style. Emotions, on the other hand, span a continuous space [44], such that different motion clips can have different intensities of the same emotion. For example, a somewhat happy gait is expressed differently from one that is extremely happy. For conventional styles, it is generally not needed to account for such intensities, e.g., slightly strutting vs. heavily strutting. To account for this continuous nature, we assume each gait in the input dataset is associated with an emotion vector whose components are the C categorical emotion terms, i.e., each emotion m is a vector in R C . In practice, the value of each element l in an emotion vector m is the relative count of the number of annotators who labeled the corresponding gait with the We show the root height from the ground h t , the root speed s t , and the stepping phase θ t . The root speed is the distance travelled between time steps t and t − 1. The stepping phase θ t = 0 when the left foot touches the ground at time step t, θ t+∆t = π when the right foot touches the ground at time step t + ∆t, and θ t+∆t+τ = 0 when the left foot touches the ground again. We fill in the values for θ t between these time steps using linear interpolation. We use these features in our autoregression network.
categorical emotion term l. Also, for training, and due to the practical limitations of separately annotating the emotion at each time step, we repeat the same annotated emotion m in all the time steps. In other words, we assume the emotion vector remains unchanged throughout the corresponding input gait.

Pose Affective Features
Prior studies in psychology have shown that various physically-based pose features observed per-frame during a gait, better known as affective features, aid the identification of perceived emotions from gaits [13,28]. Roether et al. [66] identified such a set of necessary pose affective features for human perception. To make these features suitable for machine perception, prior works such as [9,10,59] have come up with necessary sets of scale-independent pose affective features that can be computed geometrically. Scale independence is an important factor in such intra-frame affective features, as observers can identify emotions irrespective of the distance from or the physical stature of the subject. In our work, we use the following three types of scale-independent pose affective features to encode the relevant emotion information: Angles. We use the angles subtended by a pair of joints at a third joint. For example, the angle between the two shoulder joints at the neck measures slouching, an indicator of valence and arousal.
Distance ratios. We use the ratios of the distances between two pairs of joints. For example, the ratio of the distance between the two feet joints to the distance between the neck and the root joints measures the stride, which can indicate arousal and dominance.
Area ratios. We use the ratios of areas formed by two triplets of joints. These can be considered as amalgamations of the angle-and the distance ratio-based features and they can be used to supplement observations from both these types of features. For example, the ratio of the area of the triangle formed by the hand indices and the neck to the area of the triangle formed by the toes at the root can be used to simultaneously measure arm swings and strides, which can collectively indicate the valence, arousal, and dominance.
We use 11 angles, four distance ratios and three area ratios for a total of 18 pose affective features, which we collectively denote as a t ∈ R 18 at each time step t. We list all these pose affective features in Figure 2, and direct the interested reader to [10] for a detailed analysis on choosing these features.

Movement Features
We use a trajectory followed throughout a gait to extract pertinent movement information for our network to generate gaits following given trajectories. We use two kinds of movement features: root joint features and stepping features. The former consists of root height deviation, root speed (a low-pass filtered component), and root orientation difference trajectory curvature. The latter consists of stepping phase and foot-step frequency, which are obtained from the trajectory. Figure 3 illustrates some of these features. Apart from movement information, the root joint features and the foot-step frequency also provide inter-frame or dynamic affective information for emotional expressions. We define these features below.
Root joint features The root height deviation (h t ) is the signed difference of the height of the root joint from its mean height from the ground plane across the time steps. Subjects expressing emotions with higher arousal tend to have their upper bodies more upright, thus keeping the root height above the mean more often than subjects expressing emotions with lower arousal. In our case, the XZ plane is the ground plane, making the root height h t = y t 0 . The root speed (s t ) is the magnitude of the difference of the 2D position of the root joint, as projected on the ground plane, between the current step t and the previous step t − 1. Root speed helps indicate the arousal as well, with higher arousal tending to result in faster speeds more often. We represent the root speed as With root speed, we also use its loss-pass filtered components t . This reduces the high-frequency noise in the root speed, which is especially useful when the network learns on trajectories with high curvatures. The root orientation difference (δ t ) is the angular difference between the root orientation α t w.r.t. the world coordinates and the tangent τ t to the 2D root joint positions x t 0 , z t 0 on the ground plane, w.r.t. the world coordinates at each time step t. We express the where d ang denotes the unsigned smaller angle between the unit vectors.
Stepping features The trajectory curvature (κ t ) is the norm of the second-order derivative of the 2D positions of the root joint on the ground plane, or equivalently, the derivative of the root joint tangents τ t on the ground plane. We compute this using forward difference as well, i.e. κ t = τ t − τ t−1 .
The stepping phase (θ ) represents the phases of the feet between the time steps where they touch the ground. We consider a halfperiod to be the time from the instant of one foot touching the ground, to the subsequent instant when the other foot touches the ground. Given the half-periods, we define the stepping phase θ t at each time step t as follows. We assign a phase θ t = 0 when the left foot touches the ground and a phase θ t = π when the right foot touches the ground, filling in the intermediate phases through linear interpolation.
The foot-step frequency (ω t ) is the angular velocity of the foot joints. Apart from generating realistic walk cycles (the motion between ipsilateral footsteps), this feature also supplements the root speed information to indicate the arousal in the emotions expressed by the gait. We compute the foot-step frequency at each time step t as the difference between the phase at that time step and the previous

AUTOREGRESSION
Given a sequence of values with some information content, the overall goal of autoregression is to predict subsequent values in the sequence to maintain a similar information content [40]. In our work, we use an autoregression network to encode gaits with given emotions and predict subsequent gaits while maintaining the same emotions. Our network consists of an encoder followed by a predictor. The encoder takes in the joint positions and rotations of the input gait for a number of time steps and extracts pose affective features and root joint features from the input gaits. Next, it learns the encoding functions to jointly map these extracted features, the corresponding input emotions, and the stepping features (such as curvature and foot-step frequency) to latent representations.
The predictor learns to compute the inverse mapping from the latent representations to the necessary affective and trajectory features and, by extension, the joint positions, and rotations, in the subsequent time steps. We train the encoder and the predictor in tandem, by adding the predictor's output back to the encoder's input and advancing the temporal window of the encoder. We are able to achieve emotional expressiveness by training our network with input gaits for different emotions and forcing the network to learn to predict the corresponding pose affective features in the prediction time steps from its latent representations. We simultaneously enforce a robust constraint on the network to adapt its trajectory features such that its predicted movements are close to the corresponding movements in the ground truth. This enables the network to take sharp turns and follow bends in the trajectory without smoothing out feet movements. Our overall approach is shown in Figure 4. We now elaborate on the operations of the encoder and the predictor.

Encoder
In the encoder, we separately combine our emotion vectors m with the pose affective features a t , the stepping features consisting of [sin θ t , cos θ t ] and ω t , and the root joint featuress t and κ t , giving us input vectors i t 1 = [a t , m] ∈ R 18+C and i t 2 = sin θ t , cos θ t , ω t , s t , κ t , m ∈ R 5+C .
We pass each of these inputs through a set of 3 fully connected layers, respectively, collectively denoted as the functions FC enc 1 ·, φ FC enc 1 : R T ×(18+C) → R T ×H 1 and FC enc 2 ·, φ FC enc 2 : Here, H 1 and H 2 denote the number of hidden units in the last fully connected layer in FC enc 1 and FC enc 2 respectively, and φ FC enc 1 and φ FC enc 2 denote the set of trainable parameters in the two sets of fully connected layers, respectively.
We combine the outputs of these fully connected networks to obtain intermediate representations γ t , i.e. we have where We then append γ t separately to our input joint rotations q t and to the remaining root joint trajectory features, h t , s t and δ t . We pass the appended rotation data through a GRU to obtain the latent representationsq, i.e., we havẽ where q = q 0 , . . . , q T −1 , -H 3 is the number of hidden units in the final layer of the GRU, and φ GRU versors denotes the trainable parameters in the GRU. We also pass the appended root joint trajectory features through a fully connected layer FC root : R T ×(3+H 1 +H 2 )→T ×H 4 , H 4 being the number of hidden units in the layer, to obtain the latent representationsh,s, andδ . That is, we have φ FC root denotes the trainable parameters in the fully connected layer.

Predictor
Our predictor takes in the latent representations of the joint rotations and the root joint trajectory features from the encoder and learns to predict the same for T pred subsequent time steps such that the corresponding generated gaits follow the input trajectory while expressing the input emotion vectors. The predictor consists of a set of 2 fully connected layers, denoted as FC versors : R T ×H 3 → R T pred ×4(J−1) to predict the joint rotations, and three separate fully connected layers, FC h : R T ×H 4 → R T pred , FC s : R T ×H 4 → R T pred , and FC δ : R T ×H 4 → R T pred to compute the respective root joint features. Thus, we have, where, as usual, φ FC versors , φ FC h , φ FC s , and φ FC δ respectively denote the respective trainable parameters. From the predicted joint rotations and root joint features at each time step t, we can also compute the predicted poseX t and the corresponding pose affective featuresâ t . We use these predicted variables, together with the input data, to train our network according to a curriculum schedule described in Section 5.3.

Loss Function for Training
We now describe the formulation of the loss function for training and validating our network. The loss function should accurately constrain the network both to learn the emotional expressions in the input gaits as well as to follow the gaits' trajectories in the subsequent time steps with plausible joint motions. We capture all Table 1: Joint Position and Rotation Errors. We compute position error relative to the longest diagonal of the bounding box of the characters we test, and we compute rotation errors in degrees. The performance of our method is on par with the current state-of-the-art in motion generation.

Method
Pose these requirements in the loss function using four loss terms: the motion loss, the pose loss, the pose affective features loss, and the root joint features loss.

Motion loss (L motion )
This loss ensures that the predicted joint motions remain plausible, i.e. close to the ground truth joint motions. To compute this loss, we measure the angle difference between the ground truth rotations q t and the predicted rotationsq t on each joint at each prediction time step t. We also add the unit norm constraint on the predicted versors as regularization. Thus, we write the motion loss as where q2e : H → [0, 2π] 3 maps the versors to corresponding Euler angles, and the summation is over all the joints across all the prediction time steps.

Pose loss L pose
The pose loss supplements the motion loss by adding an extra regularization to maintain plausible predicted joint motions. We require the predicted character posesX t at each prediction time step, obtained using the predicted versorsq t j , to be as close as possible to the corresponding ground truth poses X t . However, we do not require our predicted poses to follow the same trajectory as the ground truth poses since the desired trajectory will be provided to us at test time. We, therefore, subtract the root joint position from all the other joints at every time step and write our pose reconstruction loss L pose as

Pose affective features loss (L aff )
This loss constrains the network to predict pose affective features similar to the ones computed from the input gaits. Therefore, it forces the network to maintain the emotional expressions in the gaits. We compute this loss by measuring the norm difference between the ground truth affective features a t and the predicted featuresâ t . We write it as

Root joint features loss (L root )
This is a robust loss that we use to constrain the network to follow the ground truth gait trajectory at the prediction trajectory. The robustness ensures that the prediction follows sharp turns and bends in the trajectory without smoothing out the foot joint movements. We compute this loss by measuring the L 1 norm difference between the ground truth root joint features h, s, and δ , and the predicted featuresĥ,ŝ, andδ given by our network. We write it as

Foot contact loss (L ft ct )
We also require the generated characters to walk naturally without any foot sliding. Therefore, we add a robust L 1 norm loss to constrain the heel and toe positions of the generated character to match the ground truth heel and toe positions. The robustness ensures that the prediction follows sharp turns and bends in the trajectory without smoothing out the foot joint movements. We write this loss as Finally, we linearly combine all these loss terms to formulate our overall loss function L , which we write as L = λ motion L motion + λ pose L pose + λ aff L aff + λ root L root + λ ft ct L ft ct (13) where λ motion , λ pose , λ aff , λ root and λ ft ct are the corresponding scaling terms and assign relative importance to the different loss terms.

RESULTS
We show the performance of our autoregression network on the training dataset described below. We briefly describe the training dataset in Section 5.1 and discuss our augmented dataset in Section 5.2. We report our training routine in Section 5.3, elaborate on our performance benchmarks in Sections 5.4 and 5.5, and discuss the contributions of our novel components through ablation studies in Section 5.6. We summarize the details of integrating our setup with the AR environment in Section 5.7. For a video demonstration of the results, please refer to our supplementary material.

Dataset for Training
The datasets we use consist of temporal 3D pose sequences of human gaits for different types of walking, running, and other locomotion activities. This dataset was collected from various 3D pose sequence datasets, including BML [41], Human3.6M [26], ICT [49], CMU-MoCap [1], ELMD [23], and Emotion-Gait dataset [9]. All gaits in the dataset are 240 frames long and playable at 10 fps. Due to memory constraints, we sampled every 4 th frame and used the resultant 60 frames as input data to our network, i.e. we had T = 60 for all our data points. In total, the dataset consists of 1, 835 gaits with corresponding emotion vectors available. shows the results at the same four time instances for our network without the affective feature component. In this case, the gait is able to follow the trajectory, but not express the emotions (e.g., no shoulder slouching to indicate sadness). (e) shows the results at the same four time instances for our network without the movement feature component. In this case, the gait is able to express emotions, but not follow the desired trajectory.

Augmented Dataset: Synthesized Emotive Gaits
At test time, our network is able to generate predicted gaits on trajectories it did not encounter during training. Our network is also able to transition between different emotions on the test gaits as a result of the learned inverse mapping from the latent representation space of the encoder. We, therefore, use our network to augment synthesized gaits to the Emotion-Gait benchmark datasets. We generate gaits on 20 trajectories not present in the dataset, with 100 emotions, also not present in the dataset, on each trajectory, for a total of 2, 000 new gaits. We also perform transitions between 50 pairs of emotions on each trajectory, picking a pair of emotions from the 100 novel ones without replacement, thus adding another 1, 000 new gaits, taking the total new gaits added to 5, 000.

Training Routine
We use the Adam optimizer [31] with a learning rate of 0.001, which we decay by a factor of 0.999 at every epoch. We use the ELU activation [8] on all the fully connected layers in the network.
Similar to Pavllo et al. [54], we use a curriculum scheduling technique [7] to train our network. We begin training by presenting various sequences of the input data and control features, each of length T , to our network, and the network predicts the rotations and translations for a single subsequent time step. This is equivalent to having a teacher forcing ratio of 1. At every subsequent epoch E, we decay the teacher forcing ratio by β = 0.995, i.e. with probability β E , we supplement the data and controls at each input time step with the network's predicted data and controls at that time step. In other words, we progressively expose the network to more and more of its own predictions to make further predictions. Curriculum scheduling thus helps the network gently transition from a teacherguided prediction routine to a self-guided prediction routine, which significantly speeds up the training process.
We train our network for 500 epochs, which takes around 18 hours on an Nvidia GeForce GTX 1080Ti GPU with 12 GB memory. We use 90% of the available data for training our network, and validate its performance on the remaining 10% of the data. We also observed that our network performs well for any values of the scaling terms in Equation 13 between 0.5 and 2.0. We used a value of 1.0 for all of the performances reported in our experiments in Section 5.4.

Performance Benchmarks
We note here that methods generating motions with discrete styles test generalizability by providing their network with novel discretestyle labels not seen during training [30,42], as opposed to ranges in the styles. Our network, on the other hand, learns the mapping between gaits and the underlying continuous space of emotions, rather than the mapping between the gaits and annotated emotions in the training samples. As a result, we test the generalizability of our network by generating gaits corresponding to continuous ranges of emotion vectors not seen during training. In order to benchmark our network on its ability to generalize to these continuous ranges of emotions, we perform experiments on emotion expressiveness and emotion transitions.

Emotion Expressiveness
We randomly pick gaits from the test set and extract the first 18 frames ( 1 3 rd of the total data length) to provide as inputs to our network. We set the associated emotion vector of the input gait as the desired emotion, initially set a straight line as the desired trajectory, and predict for 200 time steps. Figure 5 (top row) shows some snapshots of the results of this evaluation. Next, we evaluate our method on trajectories with bends and sharp turns for 200 steps ( Figure 5, middle row). We note that the generated gait maintains the emotion of the input, and follows all the trajectories. For example, the gait slows down while taking sharp turns and adjusts its stride and other joint movements such that the affective features remain similar when walking on a path with bends and sharp turns.

Emotion transitions
In this set of evaluations, we modify the desired emotion at each prediction time step to be different from those in the previous time steps, as well as the emotion vector associated with the input gait. To track the performance of our network, we first choose a particular emotion vector for the final prediction time step. Next, we linearly interpolate the value of each element of the emotion vector at each prediction time step separately, including everything from the input vector to the vector at the final time step. We normalize the vector at each time step to convert the values to a probability distribution that can be passed to our network. We test the results of emotion transition on trajectories with bends and turns for 200 time steps ( Figure 5, bottom row). We observe that our network is able to smoothly transition between the different emotions, with no sharp limb movement or jarring action at any time step.

Comparisons with Motion Generation
We visually compare the performance of our autoregression network with QuaterNet developed by Pavllo et al. [54] in Figure 6  (rows (a) and (b)). QuaterNet is a state-of-the-art motion prediction network, and our network builds on the core prediction framework of QuaterNet. Since QuaterNet performs motion prediction but not emotional expressiveness, the gaits are not able to express the different emotions. We also summarize the mean pose errors relative to the scale of the input data and the joint rotation errors in degrees as they are produced by our method, QuaterNet, as well as prediction networks based on alternative approaches such as the phase-functioned neural network (PFNN) [24] in Table 1. We keep the desired emotion for our network the same as the input emotion vector to perform a fair comparison. We also require ground truth gaits to be available so the prediction time steps can actually compute these errors. Therefore, we present the first 18 frames of each data point in the test set as inputs to both the methods and compute their predicted motions on the trajectory of the ground truth data for the remaining 42 frames. We notice negligible differences between the performances of the two networks, showing that our approach is comparable to the stateof-the-art in motion prediction. However, for predicting motion beyond the 60 frames in the dataset, we noticed that the motions predicted by QuaterNet eventually reduce to no movement and the character comes to a stop, whereas both PFNN and our method can predict plausible motions for up to 200 prediction steps.
Thus, while current motion generation methods can produce highly realistic gaits for VAs, our method can additionally produce emotional expressiveness for those gaits. Therefore, our method helps improve the social presence of the VAs in an AR environment, as we observe through user evaluations in Section 6.

Ablation Studies
We have two main contributions to the design of our autoregression network. First, we provide the pose affective features as part of the input and constrain the predicted pose affective features to remain close to the corresponding ground truth during training through the affective loss L aff (Eq. 10). This enables our network to achieve emotional expressiveness and emotion transition on the input data. We, therefore, remove this input component and the corresponding loss function from our network and the training process and compare the results on the experiments described in Sections 5.4.1 and 5.4.2. We observe ( Figure 6, rows (c) and (d)) that the ablated network does not maintain consistent pose affective features across the prediction time steps for the desired emotion.
Second, our network predicts the root joint features, consisting of the root height, the root speed, and the root orientation difference (as detailed in Section 3.2.4) alongside the predictions for the joint rotations. To ensure that the predicted motion follows the desired trajectory, we constrain these predicted root joint features to remain close to the corresponding ground truth during training through the root joint loss function L root (Eq. 11). To underscore the importance of this loss function, we remove it from our training and perform the experiments described in Section 5.4.2 on the ablated network. We notice (Figure 6, rows (c) and (e)) that the ablated network is not able to follow the desired trajectory. For linear trajectories, the predicted gaits often end up being oriented in arbitrary directions and not facing the direction of motion. For trajectories containing bends and turns, once the predicted gaits deviate from the desired trajectories, the ablated network is not able to reduce the deviations in subsequent prediction time steps.

Integration with the AR Environment
Our generative method can generate animation frames at the interactive rate of 40 ms per frame for 10 agents in an AR environment (Figure 7), i.e., at 4 ms per agent per frame on average, when utilizing two Nvidia GeForce GTX 1080Ti GPUs. We built the realtime AR demo by rigging the generated skeletons to humanoid meshes, modifying the posed meshes to handle minor visual distortions caused by body shape mismatch, and streaming a virtual environment containing the animated characters to the Microsoft Hololens.
Rigging Rigging the humanoid meshes to the generated skeletons requires that the rest pose of the generated skeleton is not modified to accommodate the desired mesh, as this would invalidate the rest of the animation. Thus, the rigging process must be done in reverse; the desired meshes must already contain a skeleton that allows us to repose it to meet the rest pose of the generated skeletons. We found free meshes with suitable skeletons from online 3D mesh databases. For the demo, we chose a humanoid stick figure and some humans from the Microsoft Rocketbox collection [21]. We performed the rigging in Blender 2.7.
Modifications To Rig Due to the body shapes of our desired meshes not exactly matching that of the people used to generate the original dataset, we use Blender's sculpt tools to iron out any distortions. In order to make the human meshes seem less synthetic, we used the original face bones in the meshes to create blendshapes such as blinking, breathing (mouth), and breathing (chest), which we activated at regular intervals. These blendshapes represent typical human behaviors independent of bodily animations. Our generated skeletons do not contain facial bones, thus, blendshapes are a good option for animating the face without requiring bones.
AR Implementation We made the realtime AR demo in Unreal 4.24 due to its strong animation system allowing trivial sharing of animation files between meshes. We created An environment in which we show pairs of animations of specific emotions, human or stick figure, with the meshes approximately walking along the real ground. We used the Unreal Hololens plugin to stream the rendered images directly to the Hololens through the Hololens' Holographic Remoting player, which receives images by listening on a specific IP address. Due to the start position of the user being non-deterministic, we also provide key inputs to reposition the animated characters in front of wherever the user is when the key is pressed. The animations loop in order to make it easier for the user to determine differences in gaits and the stick figure characters are given colored materials matching their emotion.
Animation artifacts We observe some jerkiness in the animation of the human characters in AR. The major sources of this jerkiness are (i) jerky motion of the user wearing the HoloLens, (ii) issues in the HoloLens software, e.g., frame rate clipping, and (iii) using textures instead of deformable cloth materials for the lowpoly human models, which makes the jerkiness more apparent due to aliasing. We observe much-reduced jerkiness for the textureless stick figures in AR, and almost none when rendering the stick figures in a purely virtual environment with a known ground plane.

USER EVALUATION
We conducted a web-based user study with our generated emotive gaits to test the following null hypothesis: The emotion vector used as input to generate each gait, and the emotion vector obtained by taking the arithmetic mean of the emotion vectors perceived by all the users from that generated gait, are two samples of the same statistical distribution.
In other words, the distribution of emotions we intend for a generated gait is statistically similar to the distribution of emotions perceived by the observing users. We also obtain the values of the pose affective features observed by the users from the generated gaits on a five-point Likert scale (LS) to validate our choice of pose affective features and emotional expressiveness of the VAs in Section 3.2.3.

Procedure
The study was divided into three sections. Each section took three to four minutes to complete on average, and the entire study lasted for around ten minutes on average.
In the first section, we showed the users ten-second clips of eight randomly chosen generated gaits, one at a time, and asked them to report the emotion they perceived from each of those gaits. Users could report multiple emotions. For example, if one gait looked less happy to the user than another (but not necessarily sad), then the user could potentially mark that gait as both happy and neutral.
In the second section, we again showed the users ten-second clips of six randomly chosen generated gaits, one at a time. However, in this section, we performed emotion transitions on the generated gaits, so the final emotions were different from the initial ones. We asked the users to report the initial and the final emotions they perceived from these gaits, with the option to report multiple emotions.
In the third section, we showed the users ten-second clips of the same eight generated gaits from the first section, one at a time, and asked them to report the observed values or intensities of four broad pose affective features on a five-point LS. The four pose affective features we chose to ask are inspired by the critical features identified in the study by Roether et al. [66]. We summarize the scales for each of the four features in Table 2.

Participants
Since emotion perceptions are influenced by numerous social and cultural factors, we invited participants from diverse demographics to draw useful conclusions. We had 102 participants in total, of which 58 were male and 44 were female. 31 male and 26 female participants were in the age group of 18-24. 25 male and 14 female participants were in the age group of 25-34. 2 male and 4 female participants were above 35. Based on the overall test statistics, we did not find any noticeable difference in the emotions perceived from the generated gaits across the different sexes and age groups.

Analysis
We analyze the results on single emotions (section 1), emotion transition (section 2), and pose affective features (section 3). Finally,  Table 2. we report the perceived naturalness of the gaits by the users and miscellaneous analyses in "other feedback".

Single Emotions
Given the perceived emotions from the first section of the user study, we plot the normalized perceived emotions for eight randomly chosen gaits, as well as the corresponding normalized intended emotions of the generated gaits, in Figure 9. The emotions are denoted as four-component vectors as described in Section 3.2.2. We perform l 1 normalization so that each component of the emotion vector represents the intensity of the corresponding emotion.
For each gait, we perform the 2-sample Anderson-Darling test [69] on the null hypothesis that the set of probability values of the perceived emotions and the set of probability values of the intended emotions are samples of the same underlying distribution. Table 3 summarizes the test statistic and the corresponding p-values for each of the eight gaits in Figure 9.
As we can observe from Table 3, we cannot reject our null hypothesis for seven of the eight gaits. This suggests strong statistical evidence that the intended and perceived emotions are statistically similar for those seven gaits. In Gait 2, where we reject the null hypothesis, the intended emotion was fully happy, but the observers mainly perceived it as either happy or neutral, indicating that the intensity of happiness did not come across to some of the observers.

Emotion Transition
We performed a similar 2-sample Anderson-Darling test [69] for each of the initial and the final intended and perceived emotions, and were unable to reject the null hypothesis in 10 out of the 12 gaits we tested with. This again provides strong statistical evidence that the intended emotions for the gaits and the corresponding perceived emotions are statistically similar.
In one rejected case, the initial emotion was predominantly angry while the final was predominantly happy, but many observers indicated that both the initial and the final emotions were neutral. In the other case, the transition was from predominantly sad to predominantly happy, but many observers reported the gait to be going from sad to neutral. We hypothesize two possibilities for the mismatches: • the intensities of the initial and final emotions did not come across in the generated gaits, Figure 9: Sets of normalized intended and perceived emotion vectors. As we can observe from the plots and the statistics in Table 3, except for Gait 2, the intended and perceived emotions of the gaits cannot be determined to belong to separate statistical distributions.
• the observers did not expect the gait to transition between extreme emotions such as angry to happy or sad to happy in the ten-second span of the clip, hence opted for choices they found more reasonable.

Pose affective features
Our goal here is to validate the usefulness of the pose affective features we use to train our network, as well as the emotional expressiveness of the VAs through these pose affective features. However, evaluating the values of angles and ratios is out of scope for a userstudy. We, therefore, opted to measure the user-observed LS values or intensities of the broad pose affective features that we used to formulate our geometric features. A good test is to verify if the observed intensities of these broad pose affective features are statistically consistent across different users. If this is verified, it justifies • basing the geometric features on these broad features, • the VAs are able to clearly express the different emotions through different LS values of the pose affective features. We show the distribution of the fraction of users that marked each particular intensity of the four broad pose affective features for each of the single intended emotions in our study in Figure 8. The values in the horizontal axis correspond to the LS values in Table 2. From this figure, we can observe different distinct modes in the distribution for the different intended emotions. For example, the mode for the torso is at "contracted, bowed" (0) for sad, while it is concentrated more around "somewhat expanded" (3) and "expanded, stretched" (4) for happy. For angry, the users observed it to be less expanded than happy overall, but less than 10% found it to be contracted. For neutral, there is a clear mode at "neither contracted nor expanded" (2). These statistics show that the users perceived the VAs to have clear preferences of the different intensities of the pose affective features when expressing different emotions.
We also perform a k-sample Anderson-Darling test 3 for each gait and each of the four broad affective features (and k being the number of users) on the null hypothesis that all the user-provided values are from the same underlying distribution. We fail to reject the null hypothesis for all the four broad features in all the gaits, thus indicating strong statistical evidence that the observed intensities are consistent across different users.

Other Feedback
We asked the users to mark out of five how natural and smooth they felt the animations to be, with one indicating "not natural at all", three indicating "satisfactory", and five indicating "very natural". To establish a baseline, we asked the users to similarly marking the corresponding source motions as well. For our generated animations, 22% of the users marked five, 43% marked four, 24% marked three, 7% marked two, and 4% marked one. Thus 89% of the users marked at least three, i.e., found the naturalness in the generated gaits to be satisfactory. By contrast, for the source motions, 58% of the users marked five, 35% marked four, and 7% marked three.
In the videos we sent out to the users, we used a moving camera so that the user was always looking straight at the virtual agent as it walked on different trajectories. 30% of the users reported being distracted by this moving camera during the study. Therefore, we plan to use a fixed camera in our subsequent studies.

CONCLUSIONS, LIMITATIONS, AND FUTURE WORK
We present a novel, learning-based method to synthesize and transition between emotive gaits. Our emotion model is based on a linear combination of four widely-used categorical emotions and we present a network architecture that uses affective features and movement features. Our algorithm can generate emotive gaits that follow a given trajectory at interactive rates and develops a transition scheme to switch between gaits with different emotions. We have shown the results on gaits collected from open-source datasets and discussed our procedure for developing VAs with these gaits in an AR environment. We have also reported our observations from a web-based user study to conclude that our generated gaits looked natural, as well as had the desired emotional expressiveness. Lastly, we release an augmented dataset of emotive gaits.
Our work has some limitations. Our approach can generate gaits of various emotions for one person at a time; it would be useful to generate gaits for a group of pedestrians in a crowd. Our formulation only considers a linear space of four emotions and we would like to extend our emotion representation to encompass more emotions in the arousal space and in the broader VAD space [44]. The fidelity of our synthesized gaits is limited by the number of gaits and emotion labels available in the original database used by the network for training. To improve the performance and generate more natural-looking emotive gaits, we need larger datasets that account for individual, social, and cultural diversities. Moreover, our approach is only based on low-level affective and movement features, and it would be useful to model higher-level information corresponding to the environment and context. Furthermore, we would like to combine emotive gaits with other cues corresponding to facial expressions or gestures and use multiple modalities.