跳转至

Xuyuan Ours:Articulation Observation 与 Reward 审计

Historical source audit。 下文 same-link 名称若基于手/link 边缘 net force + proximity,只是 development proxy,不是 collider-pair identity,也不是当前 paper metric contract。

  • 审计日期:2026-07-25
  • 只读源目录:/mnt/cvda_mnt/xuyuan/project/intermimic-phcx
  • 源仓库 HEAD:e26a96e
  • 定位:历史 frozen PHC-X + residual policy + ours observation/reward/training 原型,不是 InterMimic baseline,也不是当前主仓库的最终 ours 实现

1. 证据边界

本页记录审计时 Xuyuan worktree 的实际代码和最新 matched 配置,主要依据:

  • isaacgym/src/intermimic/env/tasks/intermimic.py
  • isaacgym/src/intermimic/env/tasks/articulated_target_ext.py
  • isaacgym/src/intermimic/env/tasks/articulated_handle.py
  • isaacgym/src/intermimic/data/cfg/arthoi4d_vlm_v14_run_bh_gap_fullbody.yaml
  • isaacgym/src/intermimic/data/cfg/arthoi4d_vlm_v14_run_bh_gap_matched_restricted.yaml

审计时三个 task 文件相对 HEAD 有未提交修改,合计约 +98/-52 行。因此下面语义属于 HEAD + local worktree 快照,不能只用 commit hash 声称可复现。Xuyuan 目录保持只读, 当前实现不得在运行时导入该目录,也不得直接复制其中的 VLM、manual-handle 或 case-specific 参数。

2. 方法结构

历史 ours 使用 frozen PHC-X 产生 base action,并训练一个 residual policy:

\[ a_t^{final}=a_t^{PHC\text{-}X}+M\Delta a_t. \]

fullbodymatched_restricted 使用相同 observation、reward、base checkpoint 和 训练设置,只改变 residual action mask:

Variant Observation Residual action
fullbody 全身 674 维 全身
matched_restricted 同一全身 674 维 VLM 指定交互侧的 thorax/arm/hand

因此 restricted/full-body 的科学问题应是 action projection,而不是 observation 或 reward 同时变化。

3. Articulation Observation

3.1 实际张量

Residual policy 的输入为:

\[ o_t^{res}= \left[ q_t^H,\, \dot q_t^H,\, q_t^O,\, a_t^{base},\, q_t^{H,ref},\, \Delta x_t^{finger\rightarrow region},\, q_t^{O,ref},\, F_t^{finger} \right]. \]

对应代码中的拼接顺序为:

字段 维度 来源 当前最新配置
arm_dof_pos \(K_H\) simulator human q active
arm_dof_vel \(K_H\) simulator human qvel active
hinge_q 1 simulator object joint q active
arm_hand_base \(K_H\) corrected PHC-X base action active
ref_arm_qpos \(K_H\) 当前 reference human q active
ft_to_obj 30 10 指尖到动态 handle-region 最近点的局部向量 active
ref_hinge 1 当前 reference object joint q active
ft_cf 30 10 指尖 simulator contact-force vector 关闭,填零

总维度为

\[ D=4K_H+62. \]

最新 fullbody/matched_restricted 使用 \(K_H=153\),所以 \(D=674\)。较早的 run_bh_gap 从 DOF 39 开始,使用 \(K_H=114\),所以 \(D=518\)

配置状态为:

residualUseFingertipDist: true
residualUseRefHinge: true
residualUseContactForce: false

VLM contact label 不直接拼入 observation;但 matched_restricted 用它选择 residual 作用手侧,reward 也用它作为接触 reference。因此该 variant 仍使用了 VLM 时序信息。

3.2 动态 region

ft_to_obj 不是指尖到 object root 的距离。配置 handle 时,region 点随当前 object joint q 和 object root pose 更新,再为每个指尖选择最近点。这一设计正确表达了 moving-link geometry,比静态 world-space target 更合理。

但历史实现依赖:

  • 单个 handle.joint_index
  • 单个 hinge_q/ref_hinge
  • 手写 handleJointOrigin/handleJointAxis
  • 固定 contact_regions_oven_101940.npzhandle_0

所以它是 oven 单铰链原型,不是任意 \(K\)-joint、任意 target-link 的通用 observation。当前实现应从 case reference 的 point_link_names 和 link-local region 自动构建等价字段。

3.3 Observation ablation 映射

迁移到当前框架时,建议按以下单因素顺序重建,而不是直接复制 674 维张量:

ID Residual observation 问题
OURS-O0 human proprioception + base action frozen tracker residual 本身能做什么?
OURS-O1 O0 + normalized q/qdot + reference q articulation state/target 是否必要?
OURS-O2 O1 + per-link contact-region vectors 动态 region geometry 是否提高 Reach/Establish?
OURS-O3 O2 + hand/target-link force features contact-force observation 是否提高 Sustain/Actuate?
OURS-O4 O3 + future q targets 短期 reference preview 是否改善时序?

所有 \(K=0\) case 的 articulation 列必须为空或严格零初始化,并通过 zero-residual equivalence;不能保留一个虚构的单 hinge 标量。

4. Articulation 与 Contact Reward

4.1 总公式

历史实现保留 InterMimic 的乘积 reward,再加入 articulation、handle 和 additive regularization:

\[ \begin{aligned} r_t={}& r_b r_o r_{ig} r_{cg} r_q r_{\dot q} r_{handle}^{coarse} r_{handle}^{fine} r_{handle}^{normal}\\ &+ r_{progress} r_{feet\_slide} r_{dof\_limit} r_{action\_rate}. \end{aligned} \]

最新 matched 配置中的非零权重为:

Group Weight 当前语义
human position/rotation p=30, r=1.5 hand position 被 handPosRewardWeight=0 mask
human velocity pv=0, rv=0 关闭
object root op=5, or=0.1, opv=0.1, orv=0 保留 rigid-root tracking
interaction graph ig=0 reward 关闭
contact cg_hand=5, cg_other=5, cg_all=3, cg_finger=5 VLM hand reference + part filter
articulation q part=6 active-joint q MSE
articulation qvel part_vel=0.25 active-joint qvel MSE
phase progress progress=2 additive
handle geometry coarse=4, fine=6 multiplicative
handle normal absent 关闭,恒为 1
regularization feet_slide=0.25, dof_limit=-1, action_rate=-0.005 additive penalties

ig=0\(r_{ig}=1\),并且 baseline 不计算、记录或用 interaction-graph 作为 reset/termination 条件。任何启用 IG 的实验都必须使用独立、命名的 ours YAML,并完整冻结 reward 与 termination 语义。

4.2 Joint-state tracking

q reward 支持 \(K\) 个 active joints:

\[ r_q= \exp\left[ -6\operatorname{mean}_{j\in active} (q_{t,j}^{ref}-q_{t,j}^{sim})^2 \right], \]
\[ r_{\dot q}= \exp\left[ -0.25\operatorname{mean}_{j\in active} (\dot q_{t,j}^{ref}-\dot q_{t,j}^{sim})^2 \right]. \]

reference qvel 使用相邻 reference q 的 forward difference。该项没有按 joint range 或物理单位归一化;对当前单 revolute joint 可用,但直接混合 revolute/prismatic 或 不同量程 joints 不够稳健。

4.3 Handle geometry

在 VLM 标注交互帧中:

  • coarse 使用整只手所有 body 到动态 handle 点集的最小距离;
  • fine 使用 VLM 激活手指到动态 handle 点集的平均最近距离;
  • 二者均采用 \(0.5(1+\exp(-kd))\) 形式,避免乘积 reward 归零;
  • 接近 region 可以拿到高分,但不要求发生物理接触。

handle_normal 定义了“VLM 激活 + 靠近 handle + 有手指接触力”条件下的内向法向力 对齐,但最新配置没有 handle_normal 权重,因此它当前不参与训练。

4.4 Part contact

usePartContactReward=true 时,历史实现把 rcg_allrcg_finger 换成:

\[ \text{part contact} = \text{human body has contact} \land d(\text{body center},R_{handle})<0.02\text{ m}. \]

匹配 VLM 接触标签时得 1,缺失时得 0.5。这个设计比纯 any-contact 多了 handle 几何过滤,但仍有三个身份缺口:

  1. human_contact 只表示该人体刚体碰到了某物,不知道碰撞对象;
  2. 不要求 handle 所属 target link 自身有 contact force;
  3. 原始 rcg_handcontact_reset 仍保留“该手任意刚体有接触”的旧判断。

所以历史 usePartContactReward 不能证明 hand-target-link contact。若最终 primary 使用 contact-qualified wrapper,当前实现必须记录精确的 hand/body collider × target-link collider pair impulse/force;边缘 force/proximity contract 只能作 proxy diagnostic。

4.5 Phase progress

默认模式奖励当前 phase 内已经完成的关节进度:

\[ r_{progress} = 2\cdot \operatorname{clip} \left( \frac{q_t^{sim}-q_{init}^{ref}} {q_{phase\_end}^{ref}-q_{init}^{ref}}, 0,1 \right) \cdot g_t, \]
\[ g_t=\alpha+(1-\alpha)\,\text{grip-completeness}_t. \]

最新配置没有设置 progressGateAlpha,实际代码默认 \(\alpha=0.5\)。因此完全没有 正确 grip 时仍保留一半 progress reward,最高可获得 1.0 的 additive reward。 这会允许身体碰撞或错误接触推动关节后获得明显奖励,不符合严格 contact-driven actuation 目标。

另外存在两个实现限制:

  • q_init 取 episode start,而不是当前 phase start;完整 opening-closing 序列中, closing target 若等于 episode 初始 q,分母会退化为零;
  • 可选 velocity mode 使用 sim_vel.clamp(min=0),写死正方向,不能正确处理 closing 或任意 joint sign。当前最新配置未启用该模式。

历史 progress 的正确思想是“奖励实际关节位移,而不是代理力信号”;迁移时应改为 per-joint、per-phase signed progress,并由有效 same-link contact/grip 严格 gate。

5. 与 HDMI 和当前 InterMimic 的差异

设计 HDMI official Xuyuan historical ours 当前 InterMimic adaptation
q reward absolute/L1 exponential unnormalized squared/L2 exponential range-normalized squared/L2 exponential
qvel reward object qvel 未启用
progress 无显式项 phase progress,加法
power 单边 opposing-contact-power
region geometry 单个 body-local target offset manual dynamic handle point set point_link_names 自动 per-link region
force identity EEF-object-body pair-filtered human marginal contact + near-handle hand/link marginal same-link
multi-joint object_joint_name q reward 支持 K,obs/handle 仍单 hinge observation/reward 支持 K

Xuyuan ours 解决 0 W 平坦区的方式不是增加 power reward,而是直接加入 q、qvel 和 实际 phase progress。这个方向值得保留;其 contact identity 和单-hinge/manual-region 实现不应迁移。

6. 当前重写建议

建议的 current ours 最小 reward 为:

\[ r^{ours} = r^{PHC\text{-}X\ tracking} +w_q r_q +w_{\dot q}r_{\dot q} +w_c r_{same\text{-}link} +w_{\Delta q}r_{signed\ progress} +r_{regularization}. \]

其中:

  • q kernel 单独比较 HDMI-style normalized L1 与当前 normalized L2;
  • signed progress 使用当前 phase start/end,支持 opening、closing 和任意 joint sign;
  • progress 只在 same-link contact 连续成立时激活,不保留无接触 0.5 floor;
  • contact region 来自 point_link_names,不读取 manual handle origin/axis;
  • target-link force 必须达标;pair-filtered force 可用时替换 marginal same-link;
  • opposing-contact-power 先降为 telemetry/辅助 ablation,不作为完成 actuation 的主要 credit;
  • q/qvel/progress 对每个 joint 使用明确的量程或物理尺度。

6.1 Reward ablation

ID Reward delta over frozen PHC-X tracking 问题
OURS-R0 none residual policy 是否只靠 tracking signal 学习?
OURS-R1 +q 直接 articulation-state tracking 的贡献
OURS-R2 +q+qvel 方向/时序监督的额外贡献
OURS-R3 +q+qvel+same-link contact 正确接触身份的贡献
OURS-R4 R3 + signed phase progress 实际净位移 credit 是否解决 Actuate
OURS-R5 R4 + opposing-power power 是否提供 progress 之外的增益

每个 row 必须从同一个 frozen PHC-X checkpoint 独立训练,固定 observation、action projection、PPO budget、seeds、asset、reference 和 evaluator。fullbody/restricted 是单独的 action-mask ablation,不能与 reward row 同时变化。

7. 必报 telemetry

  • q/qvel reference、simulation 和逐 phase error;
  • signed phase endpoint delta、全序列 excursion;
  • same-link valid frames、最长连续段和 contact identity;
  • grip completeness 与 progress-gate activation;
  • q、qvel、contact、progress、regularization 各 reward 分量;
  • hand/target-link force、pair force(若可用)和 conservative power;
  • Reach/Establish/Sustain/Actuate/Complete、first failure stage;
  • human tracking、fall/drift、feet slide、DOF-limit 和 residual magnitude。

历史 checkpoint 或曲线只有在配置、dirty source snapshot、base checkpoint、seed 和 rollout 能完整追溯时才可作为 diagnostic;不能直接进入当前 matched main table。