MADiff: Motion-Aware Mamba Diffusion Models for Hand Trajectory Prediction on Egocentric Videos
Junyi Ma Xieyuanli Chen Wentao Bao Jingyi Xu Hesheng Wang










§ ABSTRACT 
Understanding human intentions and actions through egocentric videos is important on the path to embodied artificial intelligence. As a branch of egocentric vision techniques, hand trajectory prediction plays a vital role in comprehending human motion patterns, benefiting downstream tasks in extended reality and robot manipulation. However, capturing high-level human intentions consistent with reasonable temporal causality is challenging when only egocentric videos are available. This difficulty is exacerbated under camera egomotion interference and the absence of affordance labels to explicitly guide the optimization of hand waypoint distribution.
In this work, we propose a novel hand trajectory prediction method dubbed MADiff, which forecasts future hand waypoints with diffusion models. The devised denoising operation in the latent space is achieved by our proposed motion-aware Mamba, where the camera wearer's egomotion is integrated to achieve motion-driven selective scan (MDSS). To discern the relationship between hands and scenarios without explicit affordance supervision, we leverage a foundation model that fuses visual and language features to capture high-level semantics from video clips. Comprehensive experiments conducted on five public datasets with the existing and our proposed new evaluation metrics demonstrate that MADiff predicts comparably reasonable hand trajectories compared to the state-of-the-art baselines, and achieves real-time performance. We will release our code and pretrained models of MADiff at the project page: <https://irmvlab.github.io/madiff.github.io>.




Hand Trajectory Prediction, Egocentric Vision, Mamba, Diffusion Models




MADiff: Motion-Aware Mamba Diffusion Models for Hand Trajectory Prediction on Egocentric Videos
    Junyi Ma^†, Xieyuanli Chen^†, Wentao Bao, Jingyi Xu, Hesheng Wang^*
  Junyi Ma and Hesheng Wang are with IRMV Lab, the Department of Automation, Shanghai Jiao Tong University, Shanghai 200240, China. 

Xieyuanli Chen is with the College of Intelligence Science and Technology, National University of Defense Technology, Changsha 410073, China. 

Wentao Bao is with ACTION Lab, the Department of Computer Science and Engineering, Michigan State University, MI 48824, U.S.A. 

Jingyi Xu is with the Department of Electronic Engineering, Shanghai Jiao Tong University, Shanghai 200240, China. 
  ^†Equal contribution
  ^*Corresponding author email: wanghesheng@sjtu.edu.cn

    September 9, 2024
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================






§ INTRODUCTION



Embodied artificial intelligence requires deep comprehension of human behaviors and flexible techniques, transferring general skills from daily human activities to robotics. Extracting reusable and transferable knowledge from internet-scale human videos is regarded as an efficient way to understand human intentions and actions. Many efforts have been made to achieve action recognition and anticipation <cit.>, temporal action localization <cit.>, gaze prediction <cit.>, hand trajectory prediction <cit.>, object affordance extraction <cit.>, and object interaction anticipation <cit.>. Among them, hand trajectory prediction (HTP) is a comparably challenging task that aims to anticipate how humans will behave in the near future, moving beyond just estimating action categories or gaze direction. This task is valuable for collecting offline data, predefining the action space for robot learning, and assisting human activities in extended reality applications <cit.>.





Considering that humans use egocentric vision to perceive the world and guide daily tasks, several notable convolution- and transformer-based HTP approaches <cit.> have been proposed in recent years to forecast incoming hand positions with only egocentric videos as inputs. 
Despite achieving acceptable prediction results, several challenging problems remain to be solved:

    
  * Camera egomotion guidance has not been seamlessly integrated into the state transition of the HTP process to narrow the motion-related gaps we discovered: 1) Predicting the 3D trajectories of future hand movements directly projected onto the 2D egocentric image plane, presents a challenging problem due to spatial ambiguities. There exists a noticeable disparity between the movements observed in 2D pixels and the corresponding 3D physical actions, which can be mitigated by camera egomotion. 2) With the past egocentric video as input, we predict future hand waypoints on a predefined “canvas” such as the image plane of the first observation. However, the past hand positions and scene information within the other frames are observed in different views with respect to the canvas view due to the existence of camera egomotion.
    
  * HTP models are often optimized along with ground-truth object affordances besides hand waypoints <cit.>. This respects the fact that hand trajectories typically interact with active objects based on human intentions as an oracle. Understanding hand movements involves being aware of both hand positions and environmental situations concurrently. However, annotating object affordances is labor-intensive <cit.> compared to labeling hand trajectories. There is no off-the-shelf detector that can automatically and accurately identify the active objects interacted with a hand trajectory, attaining the quality of producing ground-truth.
    The previous work <cit.> shows that the performance of the existing detectors varies significantly across the two tasks, next active object detection and hand detection. Therefore, ground-truth object affordances are not always available due to a lack of manual labeling and low-quality automatic annotation.
    In the absence of object affordance labels to aid optimization, the inner correlation between hand motion and semantics in observations is hard to extract in a manner that aligns with human intentions by HTP models. 
    
  * Causality and motion continuity constraints are often overlooked in the context of using trendy convolutions or transformers supervised by waypoint displacement. Temporal causality is inherent in both hand motion and its parallel camera wearer's egomotion changes, since the hand and body are simultaneously guided by high-level intentions and the movement patterns of the hand are closely linked to those of the body. However, convolution- and transformer-based models <cit.> suffer from modeling the state transition process by unexplainable attention mechanisms, and fail to selectively capture temporal causality considering the two entangled movement patterns. Moreover, the existing loss functions for constraining trajectory prediction are insufficient to adequately determine the optimization direction of the model in line with the potential physical model of human hand movements.

To address these existing gaps, we propose MADiff, a motion-aware Mamba diffusion model to predict future hand waypoints on egocentric videos. To overcome the challenge of observation semantics caused by a lack of object affordances, we first exploit a foundation model in MADiff to fuse visual and language features in a generalizable manner, thereby capturing high-level semantics from 2D input images without the need for affordance labels. We demonstrate that using a visual grounding model with text guidance as the backbone to generate task-related features from observations significantly enhances hand trajectory prediction, compared to models that are task-agnostic or trained from scratch. Subsequently, we convert both semantic features and past trajectory features to sequential latents. Inspired by the strong generative capability of diffusion models <cit.> in predictive tasks <cit.>, we implement denoising diffusion within the above-mentioned latent space, using the devised Mamba model with motion-driven selective scan (MDSS) to recover future latents conditioned on past sequential features as shown in Fig. <ref>. These reconstructed latents are then transformed into the final predicted hand waypoints. Here, we extend the selective state space models with scan computation (S6) <cit.> by incorporating the camera wearer's egomotion (camera homography) to achieve motion-driven state transition. This helps to fill the motion-related gaps caused by different prediction canvas and 2D-3D aliasing, and enhances the explainability in temporal causality of the entangled
movement patterns. We additionally design a continuous-discrete-continuous (CDC) operation for denoising diffusion combining the strengths of autoregressive (AR) models and iterative non-autoregressive (iter-NAR) models. Furthermore, we propose an effective angle/length supervision strategy for the training paradigm to improve the directionality and stability of predicted hand trajectories. This overcomes the challenge of optimizing HTP models with motion continuity constraints.






In summary, the main contributions of this paper are fourfold:


  * We propose MADiff, the pioneering diffusion-based method for predicting hand trajectories, featuring a devised motion-aware Mamba as the denoising model. A novel motion-driven selective scan pattern is tailored to facilitate a suitable state transition in Mamba-based denoising, comprehensively considering both hand motion and camera egomotion patterns to capture temporal causality. Moreover, MADiff bridges autoregressive models and iterative non-autoregressive models, building a novel generative paradigm for hand trajectory prediction.

  * We first propose using the fusion of visual and language prompts for semantics extraction on 2D video clips in the realm of hand trajectory prediction. This addresses the challenge of high-level scene understanding due to the absence of affordance labels. Besides, the consistency inherent in deep semantic features also naturally aligns with human intention consistency. By seamlessly integrating the multimodal cues, we lay the foundation for a new scheme of semantic richness in hand trajectory prediction.

  * We first emphasize the importance of directionality and stability in the field of hand trajectory prediction. We accordingly design new loss functions for optimization implicitly constrained by physical models of hand motion, leading to more plausible prediction results. 

  * We conduct comprehensive experiments based on the existing and our proposed new evaluation metrics to demonstrate that MADiff predicts comparably reasonable hand trajectories compared to the state-of-the-art baselines. We also experimentally demonstrate that MADiff has the potential to provide flexible HTP solutions tailored to specific action verbs.

This paper is organized as follows. Sec. <ref> reviews the related works in egocentric vision and some cutting-edge techniques in diffusion models and Mamba. Sec. <ref> introduces the preliminaries of our work. Sec. <ref> details the design of our proposed MADiff. Sec. <ref> showcases the experimental results quantitatively and qualitatively. Finally, Sec. <ref> concludes the paper and provides our insights.







§ RELATED WORK





 §.§ Understanding Hand-Object Interaction


Hand-object interaction (HOI) comprehension helps guide the downstream tasks in computer vision and robot systems.
In the early stage, Calway <cit.> establish connections between specific human tasks and corresponding objects, which highlights an object-centric comprehension across diverse interaction modes. In contrast, Liu <cit.> emphasize capturing the dynamic attributes of objects, underscoring the relationship between object-centric interactions and goal-directed human activities. After that, more and more works contribute to HOI understanding by pixel-wise semantic segmentation <cit.>, bounding-box-wise detection <cit.>, fine-grained hand/object pose estimation <cit.>, and contact field estimation <cit.>. Ego4D <cit.> further conducts a standard benchmark that evaluates understanding of hand-object interaction based on several predefined subtasks. However, only comprehending what has happened to humans and environments (objects) is not enough in many applications, where future possible hand positions or object states are required to plan downstream tasks.



 §.§ Predicting Future Hand Trajectories



Given sequential egocentric observations, accurately forecasting future hand positions is a valid approach extended in time horizons to understanding human actions and intentions in AR/VR applications and robot manipulation. Although it is technically possible to predict fine-grained hand keypoints by extending the existing hand keypoint estimation methods <cit.>, directly forecasting 2D hand waypoints in the near future focuses more on understanding high-level human intentions, which avoids large error accumulation and benefits running efficiency compared to predicting multiple complicated keypoints.
FHOI <cit.> samples future hand waypoints through motor attention following a 3D convolutional network, using stochastic units to model the uncertainty. Following its task definition, the object-centric transformer (OCT) <cit.> is further proposed combined with conditional variational autoencoders <cit.>. VRB <cit.> designs an affordance model to simultaneously predict contact point heatmap and post-contact hand trajectories. To additionally capture the uncertainty of predicted trajectories, an uncertainty-aware state space transformer (USST) <cit.> is proposed to model the state transition in the unrolling process. More recently, Diff-IP2D <cit.> builds a new diffusion-based paradigm for hand-object interaction. 
Although Diff-IP2D <cit.> attempts to mitigate the negative effect of camera motion, its denoising process with integration of motion features does not follow the specific hand state transition process, leading to a weak awareness of causality in hand trajectory prediction. In contrast, in this work, we propose a motion-aware Mamba with a motion-driven selective scan to achieve a more reasonable denoising process. Moreover, most existing HTP approaches <cit.> need affordance labels such as object contact points to guide the optimization of hand waypoint distribution. We avoid the redundancy requirement by utilizing a foundation model to semantically comprehend the relationships between hands and scenarios. 



 §.§ Generative Paradigm in Egocentric Vision

Generative models have been demonstrated to perform well across multiple subfields of egocentric vision. EgoGAN proposed by Jia <cit.> utilizes a Generative Adversarial Network (GAN) to forecast future hand masks conditioned on encoded video representation and predicted future head motion. Zhang <cit.> also use GAN-based model to generate future frames and predict their temporal saliency maps which reveal the probability of gaze locations.
With the advent of diffusion models <cit.>, diffusion-based generative modeling generally beats discriminative and GAN-based modeling in the field of egocentric vision, including egocentric video prediction <cit.>, human mesh recovery <cit.>, 3D HOI reconstruction <cit.>, and 3D HOI synthesizing <cit.>. Zhong <cit.> propose a diffusion-based method namely DiffAnt for long-term action anticipation. It follows the query-based scheme <cit.> for decoding future embeddings to action labels. Li <cit.> utilize a diffusion model conditioned on the estimated head pose to infer the full-body pose with only egocentric videos as inputs.
In this work, we also propose a diffusion-based generative paradigm for hand trajectory prediction on egocentric videos, combined with the devised Mamba as the denoising model. 



 §.§ Mamba in Time Series Forecasting

As a trendy state space model (SSM), Mamba <cit.> exhibits competitive ability in modeling long-range dependency as well as improving computational efficiency compared to transformer <cit.>. It is built upon a selection mechanism and thus has a context-aware ability to compress and propagate effective information in the state transition process. Moreover, Mamba also uses a hardware-aware algorithm for the parallel associative scan. Recently, some Mamba-based methods for time series forecasting have been proposed. For example, SiMBA by Patro <cit.> uses EinFFT for channel modeling and Mamba for token mixing, presenting solid performance on multivariate long-term forecasting tasks. TimeMachine <cit.> combines an inner Mamba and an outer Mamba to address channel-mixing and channel-independence problems simultaneously while selecting global and local contexts at multiple scales.
S-Mamba <cit.> and Bi-Mamba+ <cit.> both consider the bidirectional scan pattern implemented on sequential tokens, breaking the limitation of incorporating antecedent variates. 

Compared to these time series forecasting methods designed task-agnostically, in this work, we focus on the specific realm of hand trajectory prediction and develop a novel motion-aware Mamba regarding the characteristics of the hand movements and the camera wearer's egomotion. Moreover, we integrate the devised Mamba blocks into a diffusion process, which builds a novel paradigm bridging autoregressive and iterative
non-autoregressive models, and provides a basic framework for time series forecasting.
Our experiments show that our proposed motion-driven selective scan (MDSS) performs better than the recent bidirectional scan pattern <cit.> for hand trajectory prediction due to the unreasonable inversion of causality and human motion pattern inherent in the bidirectional mechanism (see Sec. <ref>).






§ PRELIMINARIES





 §.§ Task Definition



Given the video clip of past egocentric observations ℐ={I_t}_t=-N_p+1^0 and sequential past 2D hand waypoints ℋ^p={H_t}_t=-N_p+1^0 (H_t ∈ℝ^2), our objective is to predict future hand trajectories ℋ^f={H_t}_t=1^N_f (H_t ∈ℝ^2), where N_p and N_f correspond to the number of frames in the past and future time horizons. It can be represented by modeling an unknown joint distribution of future hand waypoints p_Φ(ℋ^f|ℋ^p,Θ) where Φ denotes a predictive model and Θ encompasses additional conditions.
Following the previous works <cit.>, we predict the future positions of both hands on a fixed image plane of the input videos, e.g., the first observed image as the prediction canvas.
Here, we only focus on the 2D predictive task, since past 3D hand trajectories are not always available due to limited sensors. In contrast, 2D hand trajectories can be efficiently extracted using off-the-shelf hand detectors <cit.>. Besides, we argue that internet-scale 2D egocentric video data is more widely accessible than 3D data and is more likely to serve as a shortcut for achieving embodied intelligence.



 §.§ Diffusion Models



The diffusion models <cit.> can progressively corrupt the inputs into noisy features and subsequently recover them based on a devised denoising model. 
Here we use its generative capability for predicting future hand trajectories on 2D egocentric videos. We argue that diffusion models can well model highly dynamic patterns inherent in complex distributions of future hand motion. Besides, the HTP iteration limited in the time axis can be extended to a more flexible diffusion denoising process. 
Initially, we map the input images and past hand waypoints into a latent space, denoted as _0 ∼ q(_0). This latent representation is then corrupted into standard Gaussian noise, represented as _S ∼𝒩(0, 𝐈). During the forward process, the perturbation operation is described by q(_s|_s-1) = 𝒩(_s; √(1-β_s)_s-1, β_s𝐈), where β_s is the predefined variance scales. In the reverse process, we employ a denoising diffusion model to gradually reconstruct the latent representation _0 from the noisy _S. The denoised features are then transformed into the predicted future hand trajectories. In this work, we will elaborate on solving the problems of generating reasonable latents, building a novel task-related denoising model, integrating effective denoising guidance, and designing suitable training and inference schemes for diffusion models in the hand trajectory prediction task.



 §.§ State Space Models of Mamba



State space model (SSM) of Mamba <cit.>, built upon a selection mechanism, has a context-aware ability to compress and propagate effective information in the state transition process. It utilizes first-order differential equations to link the input and output sequences via hidden states.
Our approach utilizes the discrete version of the continuous-time SSM in Mamba:

    A̅   = e^Δ A, 
    B̅   = (e^Δ A - I) A^-1 B,  
    
    h_k    = A̅ h_k-1 + B̅ x_k, 
    
    y_k    = C h_k ,

where A serves as the evolution parameter, B and C act as projection parameters, and Δ is a timescale parameter for the discretization. The structured state space model (S4) <cit.> initializes A 
by HIPPO theory <cit.>. Mamba further extends S4 to S6 by forcing B, C, and Δ to be functions of the input. 
In this work, we propose naturally utilizing the camera wearer's egomotion information (m_t-1 m_t), i.e., homography egomotion features, to drive the state transition process (h_t-1 h_t) in Mamba, and seamlessly integrate the state space model into a denoising diffusion process, bridging autoregressive and iterative non-autoregressive schemes in the hand trajectory prediction task.




§ PROPOSED METHOD





 §.§ System Overview




The overall pipeline of our proposed MADiff is illustrated in Fig. <ref>. The inputs for MADiff encompass past sequential egocentric images and 2D hand waypoints within the given video clip, as well as the language description as the proposed text prompt. Tokenizer first generates visual-language features through a foundation model, encodes past hand waypoints to sequential intermediate features with the trajectory encoder, and then fuses them by the fusion module (Sec. <ref>). The output of the tokenizer is the tokenized latents utilized by our proposed motion-aware Mamba (Sec. <ref>) in the devised Mamba-based denoising diffusion model (Sec. <ref>), where we design a motion-driven selective scan to recover the future latents conditioned on the past latents. Ultimately, the trajectory decoder transforms the reconstructed latent features to predicted future hands waypoints. We design new training loss functions and inference operations for MADiff, which can be found in Sec. <ref>.



 §.§ Tokenizer



The devised tokenizer of our MADiff contains a foundation model, a trajectory encoder, and a fusion module. It exploits three types of input data: past egocentric video clips, language descriptions, and past 2D hand waypoints. We fuse multimodal cues to represent the observation at each timestamp by the tokenizer and enhance the prediction performance of MADiff, which can also serve as the foundation for a new scheme of semantic richness in the field of hand trajectory prediction.

Foundation Model: Our MADiff exploits a powerful foundation model, the widely-used GLIP <cit.> to generate visual-language fusion features from sequential past observations (as shown in Fig. <ref>). In contrast to existing works <cit.> only using visual inputs, we additionally consider the text prompt 𝚑𝚊𝚗𝚍 when MADiff captures past environment observations and predicts future hand states. The visual grounding ability of GLIP enables our MADiff to semi-implicitly capture hand poses and hand-scenario relationships within each 2D image frame. This guides the optimization of hand waypoint distribution, demonstrated in Sec. <ref>, without the need for affordance supervision required by previous works <cit.>. 
We also discovered that the deepest features averaged over the channel dimension at continuous timestamps exhibit potential consistency, shown in Fig. <ref>, which aligns with the consistency in human intention during the interaction process.
The joint application of the foundation model and language description enhances MADiff's generalization ability and deployment efficiency compared to those using backbones trained on specified HOI datasets from scratch <cit.>, and concurrently holds HTP task specificity in contrast to those using off-the-shelf pretrained backbones <cit.>. Specifically, we extract the outputs of the deepest cross-modality multi-head attention module (X-MHA) in GLIP, which are denoted as the semantic features 𝒳^sem={X^sem_t}_t=-N_p+1^L for hand trajectory prediction. L equals N_f during training and is set to 0 during inference since future observations are unavailable in real deployment and are replaced by sampled noise in the subsequent diffusion models.



Trajectory Encoder and Fusion Module: We use multilayer perceptrons (MLPs) as the trajectory encoder, which converts the sequential 2D hand waypoints ℋ={H_t}_t=-N_p+1^L to intermediate trajectory features 𝒳^traj={X^traj_t}_t=-N_p+1^L in parallel. The fusion module illustrated in Fig. <ref> first adopts 1× 1 convolution as well as a linear projection to adjust the spatial and channel dimensions of 𝒳^sem to match 𝒳^traj, and subsequently uses MLP to fuse adapted 𝒳^sem and 𝒳^traj to ℱ={F_t}_t=-N_p+1^L as tokens for all timestamps t, also as latents for the following devised diffusion process. 







 §.§ Motion-Aware Mamba



MLP, convolutional layers, and transformers may suffer from capturing temporal causality inherent in hand movements due to a lack of state transition with an explicit selective mechanism along the time axis. In MADiff, we instead integrate Mamba <cit.> into the continuous denoising steps to selectively capture the temporal causality. Due to the inherent motion interference/gaps related to prediction canvas and 2D-3D aliasing mentioned in Sec. <ref>, we further integrate egomotion features into the selective scan process of Mamba, leading to the proposed motion-driven selective scan (MDSS):

    h_t    = A̅ h_t-1 + B̅ [x_t^T, 0]^T + B̅ [0,m_t^T]^T, 
     
    y_t    = C h_t ,

where x_t denotes the t th fusion tokens in the sequential latents. m_t is the t th egomotion feature transformed from the homography matrix between t th frame and the canvas frame by the homography encoder in Fig. <ref>. To calculate the homography matrix, we first extract SIFT descriptors <cit.> to determine pixel correspondences between two consecutive images from previous observations. Subsequently, we compute the homography matrix using RANSAC <cit.> which seeks a transformation that maximizes the number of inliers among the keypoint pairs.
As can be seen in Eq. (<ref>), we introduce an additional term related to the homography feature m_t to achieve a shift to the original state transition in Eq. (<ref>). This operation corresponds to the intuition that the position of each hand waypoint projected to the fixed image plane (e.g., the one of the last observation) used as prediction canvas equals the position in its original image plane shifted by an additional displacement of egomotion homography, as shown in Fig. <ref>. Besides, it also implicitly transforms hand movement-related features into a more easily predictable latent space through egomotion features, analogous to predicting on the canvas image plane. We therefore concurrently consider the two entangled motion patterns, the hand motion pattern implicit in h_t and the camera egomotion pattern implicit in m_t during state transition following the fact that the hands and body move in a physically coordinated manner.
Eq. (<ref>) can be further rewritten as:

    h_t    = A̅ h_t-1 + B̅ [x_t, m_t],

where we denote the concatenation of x_t and m_t along the channel dimension as [x_t, m_t] for brevity. Note that we do not use the sum of x_t and m_t here because B̅ can adaptively reweight the two features. Besides, B and C in Eq. (<ref>) and Eq. (<ref>) are also projection functions of the input [x_t, m_t], and thus are also referred to as motion-aware projection matrices. The additional motion-related term in Eq. (<ref>) and matrices B and C being functions of egomotion jointly determine the motion-driven property in our proposed selective scan pattern. Here, we do not let matrix A be a function of egomotion, because it stably encapsulates historical information, solving long-range dependency inherent in sequential past egomotion and other fusion features following the HIPPO theory <cit.>.
Ultimately, the output signals can be computed in parallel by the discrete convolution of the input sequence:

    K̅   = (CB̅, CAB, …, CA^N_p+N_f-1B̅), 
    
    y    = [x, m]*K̅,

where N_p+N_f corresponds to the length of the holistic hand trajectory. Compared to the previous works <cit.>, our proposed motion-aware Mamba with MDSS maintains temporal causality (scanning along the time direction unidirectionally) and simultaneously exhibits reasonable explainability in the state transition process of hand movements while narrowing the inherent gaps caused by egomotion.








 §.§ Mamba in Denoising Diffusion



We seamlessly integrate our devised motion-aware Mamba block into the continuous denoising diffusion process.
In each denoising step of MADiff, we utilize multiple stacked motion-aware Mamba blocks to recover future latents for better HTP performance. The forward process is only implemented during training and the reverse process is required for both the training and test pipeline, which will be extensively analyzed in Sec. <ref>.

Forward Process: We implement partial noising <cit.> in the forward process during training.
The output of the fusion module is first extended by a Markov transition q(_0|F_t)= 𝒩(F_t,β_0I), where F_t ∈ℝ^(N_p+N_f)× a. In each following forward step of the diffusion model, we implement q(_s|_s-1) by adding noise to the future part of _s-1, i.e., _s-1[N_p+1:N_p+N_f]. 

Reverse Process: After _S is derived after the forward process, our proposed motion-aware Mamba is exploited to denoise _S to _0. Considering the guidance of egomotion features m, the reverse process can be modeled as p_Mamba(_0:S):=p(_S)∏_s=1^Sp_Mamba(_s-1|_s,m). Our ℓ stacked Mamba blocks f_Mamba(_s,s,m) predicts the injected noise for each forward step with p_Mamba(_s-1|_s,m)=𝒩(_s-1;μ_Mamba(_s,s,m),σ_Mamba(_s,s,m)). Specifically, for the step s in the denosing process, the first Mamba block receives [_s, m] to calculate y_0,s by Eq. (<ref>). Then the feature values of y_0,s at the corresponding positions of the concatenated m are recovered to m, which is fed to the following Mamba blocks to get y_0:ℓ-1,s iteratively. The final denoised result _s-1 corresponds to the feature values of y_ℓ-1,s at the corresponding positions of _s. We further design a continuous-discrete-continuous (CDC) operation (Fig. <ref>) to achieve explicit interaction on predicted hand waypoints in the reverse process of inference, rather than being limited in the latent space that ignores the discrete nature of pixels in 2D image plane (see Sec. <ref>). Ultimately, the denoised feature ℱ̂=f_Mamba(_1,1,m)={F̂}_t=1^N_f is fed to the trajectory decoder, which uses MLP to generate the predicted hand trajectories in parallel.

Note that we anchor m in Eq. (<ref>) for the inputs of all consecutive motion-aware Mamba blocks for two reasons: 1) we respect the fact that egomotion is deterministic during the hand movement and should not be reconstructed as hand state features in the diffusion process (demonstrated in Sec. <ref>), and 2) anchoring deterministic conditional information while denoising features enhances the stability of the optimization process <cit.> and reduces the computation <cit.>. In addition, following the previous works <cit.>, we also anchor the past part of the latent features for each diffusion step to achieve conditional sequence modeling and apply both learnable positional embedding and temporal embedding before each denoising operation.



 §.§ MADiff Training and Inference



Training with New Losses: We first use the same diffusion-related losses ℒ_VLB, trajectory displacement loss ℒ_dis, and regularization term ℒ_reg as the previous work <cit.>, which are also listed here:

    ℒ_VLB   = ∑_s=2^S||_0-f_Mamba(_s,s,m)||^2 + ||ℱ-ℱ̂||^2, 
    ℒ_dis   =1/N_f∑_t=1^N_fD_dis(H_t,H_t^gt), 
    ℒ_reg   =1/N_f∑_t=1^N_fD_dis(H̃_t,H_t^gt),

where D_dis(·) represents the Euclidean distance between predicted hand waypoints and ground-truth ones, and H̃_t denotes the output of the trajectory decoder with ℱ as input. Moreover, we design two new loss functions, angle loss and length loss, to supervise our MADiff during the training process. As depicted in Fig. <ref>, the two predicted hand trajectories have the same displacement error, while the right case seems to be worse than the left one since it has ambiguous directionality with large angle errors, and unreasonable stability with large length errors. We argue that directionality and stability jointly reveal the causality and underlying human intention in the hand trajectory prediction task. Besides, they implicitly correspond to the potential physical model of hand motion and continuity constraints, closely associated with human habits. To promote the model capturing directionality and stability better, we propose the trajectory angle loss and length loss as follows:

    ℒ_angle   =1/N_f∑_t=0^N_f-1D_cos(H_t+1-H_t,H_t+1^gt-H_t^gt),
    ℒ_len   =1/N_f∑_t=0^N_f-1D_L2(H_t+1-H_t,H_t+1^gt-H_t^gt),

where D_cos(·) and D_L2(·) represent the cosine similarity and L2 norm of the two input vectors respectively. The total loss function supervising the training process of MADiff is the weighted sum of all the above-mentioned losses, which is depicted in Sec. <ref> of the supplementary material. The significant effectiveness of our proposed new losses is experimentally demonstrated in Sec. <ref>.



Inference with CDC Operation: In the reference stage, we first sample noise ℱ_noise={F_t,noise}_t=1^N_f from a standard Gaussian distribution, and concatenate it with the past tokens ℱ={F_t}_t=-N_p+1^0 along the time dimension to generate _S. Subsequently, the combination of motion-aware Mamba and our proposed CDC operation is adopted to predict future latent features by denoising _S to _0. 
Specifically, prior to proceeding with the next denoising step s-1, the output of the stacked motion-aware Mamba blocks y_ℓ-1,s, lying in the continuous latent space, is first converted to discrete hand waypoints ℋ̌_s by the trajectory decoder in Fig. <ref>. We round the intermediate predictions ℋ̌_s following the fact that the coordinates of hand waypoints on the 2D image grids are discrete. Since the denoising diffusion is implemented on the continuous latents, we subsequently project the discrete waypoints back to trajectory features 𝒳̌^traj_s by the trajectory encoder in Fig. <ref>. They are further fused with the vanilla semantic features 𝒳^sem by the fusion module in Fig. <ref> to derive ℱ̌_s, which is ultimately transformed to _s-1 for the following denoising steps. The overall pipeline of our proposed CDC operation for diffusion-based HTP and intermediate discrete HTP results after rounding are shown in Fig. <ref>. 

Here we further show how our proposed approach bridges the autoregressive (AR) models <cit.> and the iterative non-autoregressive (iter-NAR) models <cit.>, which builds a novel generative paradigm for the hand trajectory prediction task. It captures the temporal causality along the time direction and maintains sufficient iteration in the denoising direction. We denote 𝐟_* as {𝐟_S,…,𝐟_0} where 𝐟 is the future part of , and ℋ^f_* as {ℋ^f_S,…,ℋ^f_1} for brevity. Considering egomotion guidance m, the diffusion-based inference process of MADiff along with CDC operation can be formulated as follows:



    p_MADiff(ℋ^f|ℋ^p,m)  
    
    =   ∑_ℋ^f_*∫_𝐟_*p(ℋ^f|𝐟_0,ℋ^p,m)∏_s=S,…,1p(𝐟_s-1|ℋ^f_s)p(ℋ^f_s|𝐟_s,ℋ^p,m)
     
    =   ∑_ℋ^f_*∫_𝐟_*p(ℋ^f_S|𝐟_S,ℋ^p,m)∏_s=S-1,…,0p(ℋ^f_s|𝐟_s,ℋ^p,m)p(𝐟_s|ℋ^f_s+1)
     
    =   ∑_ℋ^f_*p(ℋ^f_S|𝐟_S,ℋ^p,m)∏_s=S-1,…,0∫_𝐟_sp(ℋ^f_s|𝐟_s,ℋ^p,m)p(𝐟_s|ℋ^f_s+1).



Then we marginalize over 𝐟, and align the step s with the general iteration number k reversely, obtaining the iter-NAR form of MADiff:



    p_MADiff(ℋ^f|ℋ^p,m) 
     
    =   ∑_ℋ^f_*p(ℋ^f_S|𝐟_S,ℋ^p,m)∏_t=S-1,…,0p(ℋ^f_s|ℋ^f_s+1,ℋ^p,m)
    ≡   ∑_ℋ^f_1,…,ℋ^f_K-1p(ℋ^f_1|ℋ^p,m)∏_k=1,…,K-1p(ℋ^f_k+1|ℋ^f_k,ℋ^p,m),



where p(ℋ^f_1|ℋ^p,m) and p(ℋ^f_k+1|ℋ^f_k,ℋ^p,m) correspond to the initial prediction and progressive full-context prediction of the general form of iter-NAR models respectively.
Note that we predict hand waypoints ℋ^f_k by the devised CDC operation in each step of the diffusion process rather than only denoised latents <cit.>, and thus Eq. (<ref>) holds explicitly. Subsequently, we consider Mamba-based state transition of MADiff in Eq. (<ref>), which can be an extension of the autoregressive scheme over y:



    p_MADiff(ℋ^f|ℋ^p,m) 
    ≡   ∑_ℋ^f_1,…,ℋ^f_K-1p(ℋ^f_1|ℋ^p,m)∏_k=1,…,K-1p(ℋ^f_k+1|ℋ^f_k,ℋ^p,m)
     
    =   ∑_ℋ^f_1,…,ℋ^f_K-1p(ℋ^f_1|ℋ^p,m)∏_k=1,…,K-1p(ℋ^f_k+1|y_k^1:N_p+N_f)  
          p(y_k^1|ℋ^f_k,ℋ^p,m_1)∏_i=1,…,N_p+N_f-1p(y_k^i+1|y_k^1:i,ℋ^f_k,ℋ^p,m_i+1),



where i represents the time horizon where MDSS has been progressively implemented, and p(y_k^1|ℋ^f_k,ℋ^p,m_1) and p(y_k^i+1|y_k^1:i,ℋ^f_k,ℋ^p,m_i+1) represent the initial prediction and progressive left-context prediction of the general form of AR models respectively. Here we only consider one Mamba block with a single scan in Eq. (<ref>) for brevity. y_k^i+1 is generated conditioned on both ℋ^f_k and ℋ^p because the projection functions in Eq. (<ref>) take the holistic latent sequence denoised by the previous steps as input, maintaining potential global-context constraints in the forward-only scan pattern. As the overall inference pipeline illustrated in Fig. <ref>, MADiff adopts the diffusion-based iter-NAR framework to keep sufficient iteration, and integrates motion-driven AR progress into each denoising step to capture temporal dependency orthogonal to the diffusion direction, which can serve as a foundation scheme for hand trajectory prediction and other time series forecasting tasks. Since the future egomotion is unavailable during inference, we simply let m_t (t>0) be m_0 for Eq. (<ref>) assuming that the future egomotion is subtle. This inevitably introduces artifacts but still performs better than the baseline without egomotion guidance due to the powerful generation capability of our diffusion-based approach, which is demonstrated in Sec. <ref>.







§ EXPERIMENTAL RESULTS





 §.§ Datasets


We use five publicly available datasets to validate the superiority of our proposed MADiff, including Epic-Kitchens-55 (EK55) <cit.>, Epic-Kitchens-100 (EK100) <cit.>, EGTEA Gaze+ (EG) <cit.>, EgoPAT3D-DT <cit.>, and H2O-PT <cit.>. We use the EK55 and EK100 datasets following the setups of OCT <cit.> and Diff-IP2D <cit.>, where we sample past N_p= 10 frames (2.5 s) to forecast hand waypoints in future N_f= 4 frames (1.0 s), both at 4 FPS. As to the EG dataset, N_p= 9 frames (1.5 s) are used for N_f= 3 hand trajectory predictions (0.5 s) at 6 FPS. Following the setups of USST <cit.>, we use the fixed ratio 60% by default to split the past and future sequences for both EgoPAT3D-DT and H2O-PT at 30 FPS. Sec. <ref> in the supplementary material further presents the effects of different observation ratios in the two datasets. EgoPAT3D-DT contains both seen and unseen scenes, where the unseen scenes are only used for testing. The numbers of video clips in the training, validation, and testing splits for different datasets used in the following experiments are shown in Tab. <ref>. According to the specific annotations in different datasets, we use the image plane of the last observation as the prediction canvas on EK55, EK100, and EG datasets, and instead use the image plane of the first observation as the canvas on EgoPAT3D-DT and H2O-PT datasets.





 §.§ MADiff Configurations



We use GLIP <cit.> as the foundation model to generate the semantic feature with a size of 256× 7× 12 for each frame, which is then transformed to a feature vector with a size of 512 in the fusion module. In this work, we use the GLIP version with a Swin-Large backbone <cit.> as well as BERT (base-uncased) <cit.> to encode the text prompt. The trajectory encoder embeds each 2D hand waypoint to a feature vector with a size of 512. The output token of the fusion module for each timestamp is a feature vector with a size of 512. The homography encoder converts each 3× 3 homography matrix to a feature vector with a size of 512. Although MADiff uses SIFT+RANSAC to calculate the homography matrix for the following experiments, we provide an additional study on its robustness to multiple homography estimation algorithms in Sec. <ref> of the
supplementary material. As to the diffusion process, the total number of steps is set to 1000. The square-root noise schedule in Diffusion-LM <cit.> is adopted here for the forward diffusion process. We use 6 stacked motion-aware Mamba blocks with convolutional kernel size d_conv=2, hidden state expansion expand=1, and hidden dimension d_state=16 as the denoising model. 
The numbers of diffusion steps and Mamba blocks are both selected according to the ablation study in Sec. <ref>.
We train MADiff using AdamW optimizer <cit.> with a learning rate of 2e-4 for 20 epochs on Epic-Kitchens, and with a learning rate of 1e-4 for 400 epochs on both EgoPAT3D-DT and H2O-PT datasets. Training and inference are both operated on 2 NVIDIA A100 GPUs.



 §.§ Baseline Selection


For the EK55, EK100, and EG datasets, we follow the previous work <cit.> and choose Constant Velocity Hand (CVH) <cit.>, Seq2Seq <cit.>, FHOI <cit.>, OCT <cit.>, USST <cit.>, and Diff-IP2D <cit.> as the baselines. For the EgoPAT3D-DT and H2O-PT datasets, we select the baselines including CVH <cit.>, DKF <cit.>, RVAE <cit.>, DSAE <cit.>, STORN <cit.>, VRNN <cit.>, SRNN <cit.>, EgoPAT3D <cit.>, AGF <cit.>, OCT <cit.>, ProTran <cit.>, USST <cit.>, and Diff-IP2D <cit.>, where we partially refer to the baselines of the previous work <cit.>. Note that we use the 2D version of USST since there is no available 3D information for the prediction task in this work. We borrow partial quantitative results for these baselines from the previous works <cit.> since we keep the same experimental configurations as them. 














 §.§ Evaluation on Hand Trajectory Prediction



We evaluate the weighted displacement error (WDE) and the final displacement error (FDE) of our MADiff and all the baselines on the EK55, EK100, and EG datasets following Diff-IP2D <cit.>, and post the averaged displacement error (ADE) and FDE on the EgoPAT3D-DT and H2O-PT datasets following USST <cit.>. 
Moreover, we further design a new metric to better evaluate the interaction between the hand and the next active objects, which is showcased in Fig. <ref>(a). For each video clip, we generate 10 possible hand trajectory predictions {ℋ^f}_n=1^10, and select the waypoint closest to the affordance center O^f of the next active object as the “interaction point” for each trajectory by

    H_n^ip=min_t D_dis(ℋ_n, O^f).

Then we calculate the mixture of Gaussians of the 10 interaction points {H_n^ip}_n=1^10 as affordance prediction. The similarity between affordance prediction and affordance ground-truth is ultimately evaluated by Similarity Metric (SIM) <cit.>, AUC-Judd (AUC-J) <cit.>, and Normalized Scanpath Saliency (NSS) <cit.>. Our proposed new metric can distinguish the quality of predictions with similar displacement errors shown in Fig. <ref>(b) based on the fact that the future hand movement always changes the state of an object by using or manipulating it <cit.>. Note that affordance similarity of predicted hand trajectories can only be evaluated on the datasets EK55, EK100, and EG which provide ground-truth affordance labels from annotated contact points <cit.>.





We present the comparison results on the EK55, EK100, and EG datasets in Tab. <ref> and Tab. <ref>. Tab. <ref> shows the comparison results on the EgoPAT3D-DT and H2O-PT datasets. Note that we implement zero-shot transfer from Epic-Kitchens to the EG dataset, from EgoPAT3D-DT (seen) to EgoPAT3D-DT (unseen), to validate the generalization ability on diverse scenes across different datasets and within the same dataset respectively. As can be seen, our proposed MADiff outperforms all the baselines on the EK55, EK100, and EG datasets, and generates comparable (top 2) prediction results on the EgoPAT3D-DT and H2O-PT datasets, which suggests good hand trajectory prediction performance of MADiff. The comparison results on the EG and EgoPAT3D-DT (unseen) datasets also demonstrate the strong generalization ability of our MADiff while facing new human activity environments. As to the evaluation on our new metrics in Tab. <ref>, our MADiff without affordance supervision still generates the most reasonable interaction distribution against other baselines supervised by object affordance annotations. This indicates that our MADiff is capable of capturing potential relationships between hands and active objects. We provide the visualization of predicted hand trajectories from state-of-the-art baselines and MADiff on EgoPAT3D-DT in Fig. <ref>. More illustrations of MADiff predictions can be found in Fig. <ref>, Fig. <ref> and Fig. <ref> of the supplementary material.










 §.§ Ablation Study on Motion-Driven Selective Scan



This experiment is conducted on the EgoPAT3D-DT and H2O-PT datasets to show the effectiveness of our proposed motion-driven selective scan. We directly remove the motion guidance m in Eq. (<ref>) to build the baseline MADiff agnostic to egomotion (version 1). MDSS in version 1 thus degrades to the vanilla selective scan in Mamba. Building upon version 1, we linearly merge the egomotion feature and the output of the fusion module in MADiff to replace motion guidance (version 2).
Moreover, we also provide a baseline that replaces the concatenation operation in Eq. (<ref>) of the vanilla MADiff with summation (version 3). To further validate the effectiveness of unidirectionally temporal causality for hand trajectory prediction, we additionally build a baseline with bidirectional Mamba <cit.> (version 4), which implements selective scan in two opposite directions for sequential latents. The experimental results are shown in Tab. <ref>. When comparing version 1 with our vanilla MADiff, it can be seen that motion guidance helps to reduce ADE and FDE on both datasets, which indicates that our proposed motion-driven selective scan narrows the motion-related gaps and concurrently considers the entangled hand motion and egomotion patterns. The enhancement from MDSS is more significant on FDE than ADE, which corresponds to the fact that there is an accumulated motion gap between a later observation and the canvas observation (i.e., the first observation for EgoPAT3D-DT and H2O-PT). Version 2 has the worst prediction performance among all the baselines, revealing that egomotion can only be used as auxiliary information within the diffusion process rather than brutally being fused with semantic and trajectory features that need to be optimally reconstructed by the denoising model, which has been claimed in Sec. <ref>.  

In addition, MADiff with concatenation for motion guidance outperforms version 3 with summation operation. This suggests that the feature update from egomotion homography should not be directly added to the original state transition process without reweighting by the input-dependent projection parameters in Eq. (<ref>). Version 4 has worse HTP performance than vanilla MADiff even though it applies bidirectional Mamba. The reason could be that traversing the latent sequence in the opposite direction with MDSS is analogous to strictly reversing the causal relationship and the human motion pattern, leading to unreasonable denoising during training and inference. Therefore, we advocate a forward-only scan with global-context constraints (Eq. (<ref>)) in our proposed motion-aware Mamba rather than the bidirectional one.





 §.§ Ablation Study on the Number of Mamba Blocks and Diffusion Steps



We conduct the ablation on the number of Mamba blocks with EgoPAT3D-DT. We evaluate {0, 2, 4, 6, 8, 10} Mamba blocks in Fig. <ref>. The errors at 0 (MLP) represent the HTP performance of the baseline removing the state transition of SSM in MADiff, which is equivalent to an MLP-based diffusion model. The counterpart at 0 (trans) corresponds to the baseline Diff-IP2D <cit.> that uses denoising transformer rather than Mamba. Our proposed Mamba diffusion models significantly outperform the MLP- and transformer-based baselines, and MADiff with 4 and 6 Mamba blocks have similar predictive capabilities. The prediction performance slightly drops when the number of Mamba blocks increases to 8. The reason could be that more Mamba blocks require more data for optimization, and the model with 8 Mamba blocks tends to overfit to our training set.

In addition, we report the effectiveness of different diffusion steps {500, 1000, 1500, 2000} in MADiff on EgoPAT3D-DT (EP) and H2O-PT (H2O). The experimental results illustrated in Fig. <ref> show that the setup of 1000 steps demonstrates relatively balanced performance in terms of ADE and FDE.



 §.§ Ablation Study on Angle Loss and Length Loss



Here we ablate our proposed new loss functions, angle loss and length loss. As shown in Tab. <ref>, our proposed angle and length supervisions help to improve prediction accuracy quantitatively and qualitatively. This suggests that the directionality and stability captured by the new losses lead to a better understanding of the temporal causality and human intentions for hand trajectory prediction. It is also notable in Tab. <ref> that the improvement by angle loss is more significant than length loss, which suggests that directionality is more in line with the potential physical model and continuity constraints of hand motion. Fig. <ref> also illustrates that angle supervision significantly reduces the occurrence of trajectory prediction divergence.








 §.§ Study on the Effect of Multiple Inputs


In this experiment, we present the contributions of different combinations of inputs for MADiff on the EgoPAT3D-DT (seen) and EK55. As shown in Tab. <ref>, only using past hand waypoints as input cannot semantically understand the hand movement in specific scenes, leading to the worst prediction performance of ADE/FDE on EgoPAT3D-DT and SIM on EK55. Once we exploit the visual prompt as an additional input, ADE, FDE of MADiff prediction drop by 11.4% and 17.6% respectively, and SIM increases by 15.6%. Moreover, after importing the text prompt 𝚑𝚊𝚗𝚍, ADE and FDE further decrease by 7.1% and 6.3% respectively on EgoPAT3D-DT. SIM of predicted interaction points is also improved by an additional 4.8% on EK55. The experimental results validate the effectiveness of semantic features generated by our text-guided grounding model for hand trajectory prediction. 
It is also notable in Tab. <ref> and Tab. <ref> that MADiff outperforms OCT <cit.> and Diff-IP2D <cit.> which require devised global/hand/object features as inputs and are both supervised by additional affordance labels.
We therefore argue that the foundation model can capture the relationships between hands and scenarios, avoiding the need for additional task-specific features and affordance labels in the hand trajectory prediction task.

We also present the effectiveness of two additional text prompts, 𝚊𝚛𝚖 and 𝚋𝚘𝚍𝚢 except for 𝚑𝚊𝚗𝚍. Fig. <ref> illustrates respective visual grounding patterns from these text prompts, which also lead to different semantic features. As shown in Tab. <ref>, the text prompt 𝚑𝚊𝚗𝚍 leads to better prediction than 𝚊𝚛𝚖 and 𝚋𝚘𝚍𝚢 on both two datasets, and the reason could be that a model that intentionally concentrates more on hands has a better understanding of hand movement pattern. Over-focusing on the arm part may cause interference in the model optimization since the closer the arm is to the body, the weaker the correlation between the arm’s swing and the hand trajectories becomes.















 §.§ GLIP vs. Other Backbones in MADiff



In this experiment, we build two other baselines with CLIP <cit.> and ResNet-18 <cit.> as image backbones. CLIP is pretrained on a variety of image-text pairs by He . It is task-agnostically transferred to our model here to embed each image to a feature vector, which is further fused with the trajectory feature by MLP as diffusion latents. In contrast, we integrate ResNet-18 into MADiff and train it from scratch. Note that both baselines lack a text prompt compared to GLIP of MADiff. The experiment is conducted on EgoPAT3D-DT and the results in Tab. <ref> show that the utilization of GLIP in MADiff presents the best prediction performance in both previously seen and unseen scenes. The pretrained CLIP cannot generate task-specific semantic features due to a lack of text guidance, and ResNet-18 trained from scratch suffers from overfitting to the previously visited scenarios. 












 §.§ Displacement Errors on Different Action Verb Categories



This is the first work to report the correlation between displacement errors and multiple action verb categories in the realm of hand trajectory prediction. The experimental justification is attributed to the fact that how a hand moves in a video clip can be concretely summarized by an action verb, and each verb category basically exhibits potential similarity in its corresponding set of hand trajectories.
As the comparison in Fig. <ref>, MADiff shows better prediction performance in most verb categories compared to the baseline Diff-IP2D <cit.>, exceptionally skilled at predicting fine-grained actions such as peel, cut, and shake. In addition, we also discover that actions that increase the uncertainty of object states (e.g., turn-on, take, open) tend to result in higher trajectory prediction errors compared to their opposite counterparts (e.g., turn-off, put, close). Our proposed MADiff generally outperforms the baseline even though there is high uncertainty in the ultimate state of the active object due to high-level scene understanding and temporal causality capture inherent in our paradigm.



Moreover, we also explore how to improve HTP performance for some specific action verbs on EK100. The utilized visual grounding model allows us to manually adapt verb prompts to generate specific semantic features. Tab. <ref> indicates that WDE and FDE of the specific verb both decrease significantly if given a more expressive text prompt 𝚑𝚊𝚗𝚍, 𝚠𝚑𝚒𝚌𝚑 𝚒𝚜 {𝚟𝚎𝚛𝚋-𝚒𝚗𝚐} for both training and testing MADiff. This demonstrates that injecting specific verbs into text prompts helps to generate action-related semantic features, remarkably improving the corresponding HTP accuracy. Fig. <ref> also implies that the verb-specific prompt encourages the model to focus more on the hand that matches it, according to the changes of confidence.
This experiment overall suggests that MADiff offers a reasonable picture of more flexible HTP solutions than the existing methods, tailored to specific functions in the applications of care robots or other assistive devices.














 §.§ Inference Time


We provide the inference time of our proposed MADiff on Epic-Kitchens datasets using the hardware mentioned in Sec. <ref>. Each prediction by our proposed MADiff costs an average of 0.15 s, with 0.13 s for tokenizer and 0.02 s for the Mamba diffusion process. Since we sample the keyframes in the EK55 and EK100 datasets both with the interval of 0.25 s, MADiff can predict all the future hand waypoints before the first future keyframe arrives, thus available for online operation. 



§ CONCLUSION



In this paper, we propose a novel hand trajectory prediction method namely MADiff. We first propose using a foundation model to extract high-level semantic features with no need for affordance supervision. Moreover, we design a diffusion model with a devised motion-aware Mamba for denoising. Specifically, the motion-driven selective scan pattern is proposed to fill the motion-related gaps and capture the temporal causality in the continuous denoising step.
We further integrate a continuous-discrete-continuous operation into the diffusion denoising process, combining explicit trajectory iteration with implicit feature iteration.
In addition, we introduce the angle loss and length loss into the training process to facilitate the model capturing directionality and stability better. The experimental results on five publicly available datasets show that our motion-aware Mamba diffusion model MADiff is highly competitive among all the state-of-the-art HTP baselines and the proposed components help improve prediction accuracy effectively. We also present a detailed analysis of MADiff revealing the relationship between prediction errors and action verb categories, providing a critical resource for future research in the field of hand trajectory prediction.


Insights and Limitations: Firstly, our generative paradigm seamlessly integrates Mamba into the denoising diffusion process and bridges autoregressive models and iterative non-autoregressive models, which can serve as a foundation framework for the hand trajectory prediction or other time series forecasting tasks. Secondly, the consideration of egomotion in temporal causality capture provides new insights for diffusion-based techniques in the field of egocentric vision. 
Moreover, our action-relevant analysis opens up a potential direction for future work in the realm of hand trajectory prediction, which is designing distinct prompts specifically for actions of interest.
Despite the encouraging HTP performance, our work still has the following limitations: 1) The specificity of the existing dataset annotations leads to different training and inference setups across different datasets. In the future, we will unify the training and test setups across multiple different datasets. 2) We demonstrate that MADiff can generate good interaction points according to our new evaluation metrics, but it currently cannot actively extract possible affordance maps. We will consider adding a new branch to MADiff, which can achieve affordance prediction for the next active object.


unsrt











    Supplementary Material





§ LOSS FUNCTIONS



The total loss function to supervise MADiff is the weighted sum of all the losses in Eq. (10)∼Eq. (14) of the main text, denoted as

    ℒ_total=λ_1ℒ_VLB+λ_2ℒ_dis+λ_3ℒ_reg+λ_4ℒ_angle+λ_5ℒ_len,

where the weights are initially set as λ_1=λ_2=1, λ_3=0.2, and λ_4=λ_5=0.01 in our experiments.  



§ ADDITIONAL VISUALIZATION OF HAND TRAJECTORIES AND INTERACTION POINTS


Fig. 10 and Fig. 11 of the main text visualize hand trajectory prediction (HTP) by our proposed MADiff. Here we present more visualization of predicted hand trajectories on Epic-Kitchens datasets in Fig. <ref>. As can be seen, our MADiff forecasts plausible hand waypoints in both one-hand and two-hands cases. Moreover, we further show the interaction points of MADiff extracted on Epic-Kitchens datasets according to our new evaluation metrics mentioned in Sec. 5.4 of the main text. We also illustrate the predicted affordance points of two HOI baselines Diff-IP2D <cit.> and OCT <cit.> since they both have an additional head to directly predict specific object affordance without the need for extracting the waypoints closest to the annotated affordance center. We only illustrate the center of each interaction distribution and put a fixed Gaussian on it for clarity. As can be seen in Fig. <ref>, the hand trajectories predicted by MADiff interact well with active objects, which indicates that our proposed method comprehends human observation and object-centric intention better than the baselines. This visualization also suggests that MADiff overcomes the challenge of lacking object affordance annotations since it generates more plausible hand waypoint distributions than the HOI baselines additionally supervised by object affordance labels.









§ ABLATION STUDY ON OBSERVATION TIME




We further ablate different observation times (ratios) on the performance of hand trajectory prediction with EgoPAT3D-DT and H2O-PT datasets. The experimental results are shown in Fig. <ref> and Fig. <ref>. As can be seen, larger time horizons of observation lead to smaller trajectory errors when we fix the observation ratio for both the training set and test set. This suggests that longer past sequences provide more enriched semantic information that helps MADiff comprehend human intention and motion patterns better after sufficient optimization. However, the prediction performance generally drops across these datasets once we randomly select observation ratios ranging from 0% to 100% for the test set. This indicates that the HTP capability heavily depends on the observation time used during the training process. It is also notable that the model trained with the observation ratio 80% exhibits the most severe performance degradation when comparing Fig. <ref> and Fig. <ref>. The reason could be that this model tends to use a large time horizon to capture long-range dependence within the past sequence, but most input observation sequences (randomly sampled ratios <80%) cannot meet this requirement. This experiment suggests that we need to utilize the training observation time in the reference stage for better HTP results in real-world applications. If inference with arbitrary observation times is mandatory, we should avoid using a large observation ratio during training to ensure the model has a good “imagination” without the need for long-range dependence within each sequence.










§ STUDY ON THE ROBUSTNESS TO HOMOGRAPHY ESTIMATION


In Sec. 5.5 of the main text, we validate that the camera egomotion homography estimated by SIFT+RANSAC indeed helps to improve the HTP performance significantly. Here we further conduct an experiment to demonstrate the robustness of MADiff to different homography estimation methods. We select three types of descriptors for feature matching, including SIFT <cit.>, ORB <cit.>, and BRISK <cit.>. Two estimation algorithms, RANSAC <cit.> and MAGSAC <cit.>, are adopted following the above feature matching to solve for the specific homography matrix. We train all the 6 baselines including SIFT descriptors with RANSAC (SIFT+RAN), SIFT descriptors with MAGSAC (SIFT+MAG), ORB descriptors with RANSAC (ORB+RAN), ORB descriptors with MAGSAC (ORB+MAG), BRISK descriptors with RANSAC (BRISK+RAN), and BRISK descriptors with MAGSAC (BRISK+MAG) for 400 epochs with a learning rate of 1e-4 on the EgoPAT3D-DT dataset (the same configuration as training the vanilla MADiff in the main text). We report their ADE and FDE on both seen and unseen scenarios of the EgoPAT3D-DT dataset. We also present HTP performance of the baseline of version 1 proposed in Sec. 5.5 of the main text, which is agnostic to camera egomotion. As can be seen in Tab. <ref>, all the baselines with egomotion guidance show better prediction performance than the counterpart agnostic to egomotion. This experiment demonstrates the robustness of MADiff to the utilization of different homography estimation methods. In future work, we will consider integrating learning-based homography estimation algorithms into MADiff.


