通用动作空间中的具身基础模型UniAct

UniAct在通用动作空间中构建具身基础模型,利用不同机器人共享的结构特征学习通用原子动作,从而消除异构性,提升跨域数据利用与跨具身泛化能力。

# [CVPR 2025] 增强健康基金会模式全球行动 [[项目页](https://2toinf.github.io/UniAct/)] [[纸张](https://arxiv.org/abs/2501.10105)] [郑晋良](https://2toinf.github.io/)\*, [李建松(俱闽县学. ) 林建松(俱闽县学. )](https://Facebear-ljx.github.io/)\*, [刘东旭](https://scholar.google.com/citations?hl=en&user=QbZB7QUAAAAJ)\*, [淮南郑](https://zhengyinan-air.github.io/), [王志豪(编).](https://zh1hao.wang/Robo_MUTUAL/)钟鸿欧 [刘余](https://liuyu.us/), [刘静静](https://air.tsinghua.edu.cn/en/info/1046/1194.htm), [亚秦张](https://air.tsinghua.edu.cn/en/info/1046/1188.htm), [X延赞](https://zhanzxy5.github.io/zhanxianyuan/), |||||| |--|--|--|--|--| | ![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/widowx/1.gif>)| ![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/widowx/7.gif>)|![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/widowx/6.gif>)|![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/widowx/11.gif>)| ![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/widowx/4.gif>)| | ![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/libero/1.gif>) 互联网档案馆的存檔,存档日期2013-03-02. | ![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/libero/2.gif>) 互联网档案馆的存檔,存档日期2013-03-02. |![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/libero/3.gif>) 互联网档案馆的存檔,存档日期2013-03-02.|![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/libero/4.gif>) 互联网档案馆的存檔,存档日期2013-03-02. | ![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/libero/5.gif>) 互联网档案馆的存檔,存档日期2013-03-02.| | ![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/airbot/1.gif>) 互联网档案馆的存檔,存档日期2014-03-02. | ![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/airbot/2.gif>) 互联网档案馆的存檔,存档日期2014-03-02. |![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/airbot/3.gif>) 互联网档案馆的存檔,存档日期2014-03-02.|![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/airbot/4.gif>) 互联网档案馆的存檔,存档日期2014-03-02. | ![查看原文配图](<https://raw.githubusercontent.com/2toinf/UniAct/HEAD/static/videos/airbot/5.gif>) 互联网档案馆的存檔,存档日期2014-03-02.| ## 导言 我们引入了UniAct,这是一个在环球行动空间运行的新的体现性基础模型框架。 我们所学的普世行动通过利用不同机器人的共同结构特征来捕捉它们之间的一般原子行为,并通过消除臭名昭著的异质性来增强跨域数据的利用和交叉化。此外,通过简单地增加具体体现的细节,可以有效地将普遍行动转化为多种多样的可操作命令,从这些细节中,快速适应新机器人变得简单和直截了当。我们的0.5B即兴表演UniAct超越了14X更大的SOTA,在对各种现实世界和线性机器人环境的广泛评价中体现了基础模型,展现了非凡的跨表现控制和适应能力,突出了采取普遍行动的重大好处. 1000 "src=" static/images/intro_final .jpg"]. ## 引用联系人( C) - 如果你觉得这回款有用,请引用我们的话: ``` @misc{zheng2025universalactionsenhancedembodied, title={Universal Actions for Enhanced Embodied Foundation Models}, author={Jinliang Zheng and Jianxiong Li and Dongxiu Liu and Yinan Zheng and Zhihao Wang and Zhonghong Ou and Yu Liu and Jingjing Liu and Ya-Qin Zhang and Xianyuan Zhan}, year={2025}, eprint={2501.10105}, archivePrefix={arXiv}, primaryClass={cs.RO}, url={https://arxiv.org/abs/2501.10105}, } ``` - 如果你对密码有任何疑问,请随意提出问题或直接与作者联系: [郑晋良](https://2toinf.github.io/), [李建松(俱闽县学. ) 林建松(俱闽县学. )](https://facebear-ljx.github.io/) ## 快速启动 请注意,以下指南仅针对模型部署,请参见: [火车](#training-guidance) ### 安装软件包和要求 ```bash git clone https://github.com/2toinf/UniAct.git cd UniAct pip install -r requirements.txt ``` ### 装入模式 首先下载预训的 UniAct 从 [模范动物园](#model-zoo) ```python import models.UniAct_V1 from timm.models import create_model uniact_model = create_model("UniAct_05B_CodeBook_256_V1") ### firstly load the pretrained universal action extractor / vision backbone / codebook uniact_model.load_state_dict(torch.load("model path here"), strict=False) ### Then load embodiment-specifc decoders uniact_model.load_state_dict(torch.load("decoder path here"), strict=False) ``` ### 准备输入 ```python from datasets.utils import LLAVAOV_PREPROCESSOR, R18_PREPROCESSOR from PIL import Image proprios = None # defaultly disable the proprios, use it for ACT decoder(Need to be normalized) language_instruction = "your language instruction here" image_list = ["image-view1 path here", "image-view2 path here"] img_np = [] img_tensor = [] for image in image_list: with Image.open(image) as img: img = img.convert('RGB') img_np.append(np.asarray(img)) img_tensor.append(R18_PREPROCESSOR(img)) img_np = np.stack(img_np), img_tensor = torch.stack(img_tensor), text = [LLAVAOV_PREPROCESSOR.apply_chat_template([ { "role": "user", "content": [ {"type": "video"}, {"type": "text", "text": language_instruction}, ] }], add_generation_prompt=True)] video = [np.expand_dims(img_np[0], axis=0)] # only use the primary view for extractor! inputs = LLAVAOV_PREPROCESSOR(videos=video, text=text, return_tensors="pt", padding=True) inputs = {'inputs': inputs.to('cuda', torch.bfloat16), 'images': img_tensor.unsqueeze(0).to('cuda', torch.bfloat16), } if proprios is not None: inputs['proprios'] = proprios.to('cuda', torch.bfloat16) ``` ### 推断出这个模型 ```python pred_action = uniact_model.infer( domain_name = "libero-1-rgb", # check the model_config.py for the domain_name **inputs ) ``` **说明:** 请记住将“ pred_action” 恢复正常化, 请检查动作静态 [阿尔达塔](<https://github.com/2toinf/UniAct/blob/main/data/AIRData/config.py>) 财务报告和财务报告 [OXE](<https://github.com/2toinf/UniAct/blob/main/data/OXE/action_statics.py>) ## 模范动物园 | 模型 | 说明 | 轻轻的 | 动作正常化方法| 观察类型 | Avg 苏克率 | | --------- | ------------------- | ------------------- | ---------|-------------------------|-------------------------------------------------------- | | 基础模型 | 通用行动参数节选 / Vision Backbone / 通用行动守则 | [hf_link](https://huggingface.co/2toINF/UniAct/blob/main/basemodel.pt) | - | 静态视图 | - | | 利伯罗-MLP-Decoder软件 | Libero 上的 MLP 解码器参数 | [hf_link](https://huggingface.co/2toINF/UniAct/blob/main/libero_mlp.pt) | mean-std | 静态视图 | 61.3% | | 桥- MLP- Decoder | 桥上的 MLP 解码器参数 | [hf_link](https://huggingface.co/2toINF/UniAct/blob/main/bridge_mlp.pt) | mean-std | 静态视图| 63.3% | **由于我们没有访问其他解码头的性能,我们不会释放它们。如果你有任何疑问,请随意与我们联系。** ## 对利贝罗的评价 ### 安装 请跟随指南 在官方Repo安装 [LIBERO 模拟](https://github.com/Lifelong-Robot-Learning/LIBERO). ### 重现结果 **LIBERO (MLP 头) (中文(简体) ).** 您可以通过替换直接运行以下命令 `YOUR_BASEMODEL_CKPT_PATH` 财务报告和财务报告 `YOUR_HEAD_CKPT_PATH` 作为你的基础模型和头部的ckpt路径,例如, `/data/UniAct/basemodel.pt` 财务报告和财务报告 `/data/UniAct/libero_mlp.pt`: ``` python eval/libero/run_uniact_libero_eval.py \ --base_path YOUR_BASEMODEL_CKPT_PATH \ --head_path YOUR_HEAD_CKPT_PATH \ --num_episodes 20 \ ``` ## 培训指导 首先安装培训所需的成套教材,请参见: [train/requirements.txt](<https://github.com/2toinf/UniAct/blob/main/train/requirements.txt>) #### 1. 准备数据 1. 首先从官方下载 OXE 数据集( tfds 文件) [还原](https://robotics-transformer-x.github.io/) 2. 填入文件路径 [数据集.py](<https://github.com/2toinf/UniAct/blob/main/datasets/OXE/dataset.py>) ```python # set this if you store the files in s3 ceph S3Path = '' # set this if you store the files in local machine LOCAL_OXE = '' ``` #### 2. 准备模型 **随着数据的完善,您自己的数据可能存在一些冲突。请小心填写 model_config :** 填充模型设置 [model_config .py (英语).](<https://github.com/2toinf/UniAct/blob/main/models/model_config.py>). 目前支持解码器 : - ACT 解码器(参见 [ACT_decoder .py (英语).](<https://github.com/2toinf/UniAct/blob/main/decoders/ACT_decoder.py>) 用于特定名称) - MLP 解码器(参见 [MLP_decoder .py (英语).](<https://github.com/2toinf/UniAct/blob/main/decoders/MLP_decoder.py>) 用于特定名称) #### 3. 运行以下脚本 ```bash srun -N8 \ python -u train/slurm_deepspeed_train.py \ --model UniAct_05B_CodeBook_256_V1_Pretrain \ --recipe oxe_magic_soup \ --iters 1000000 \ --start_iters 0 \ --initial_t 2.0 \ --final_t 0.5 \ --batch-size 32 \ --lr 1e-5 \ --grad_accumulation_steps 1 \ --output_dir exp/pretrain \ --save_interval 10000 \ --precision bf16 ``` ### 快速适应你的化身 我们建议您使用“ AIRData” 作为数据引擎, 在您自己的化身上培训 UniAct 。 这就是我们在 Libero 上培训 UniAct 时要做的事情 ! 它可能需要您自己的数据集进行一些数据重建 。 我们为 Libero 提供数据处理脚本作为示例 。 请参见 [Libero_hdf52jpg .py (英语).](<https://github.com/2toinf/UniAct/blob/main/datasets/AIRData/Preprocess/Libero_hdf52jpg.py>)。图像文件结构应如下: ``` |-- traj-1 | `-- frame-0.jpg | `-- frame-1.jpg | `-- frame-2.jpg | `-- ... | `-- frame-41.jpg |-- traj-2 | `-- frame-0.jpg | `-- frame-1.jpg | `-- frame-2.jpg | `-- ... | `-- frame-46.jpg ... ``` #### 数据重建 在将数据转换为jpg格式后,需要遵循以下指令以适应代码库: 1. 1. 构造一个元文件(.pkl)为以下结构: 。这里举一个例子: [Libero.pkl 互联网档案馆的存檔,存档日期2013-12-02.](https://huggingface.co/2toINF/UniAct/blob/main/libero_meta_file.pkl) ``` |-- | `-- path: 'traj-1' | `-- length: 41 | `-- instruction: 'pick up the red cup' | `-- action: np.ndarray with shape(41, dim_action) | `-- proprios: np.ndarray with shape(41, dim_proprio) |-- | `-- path: 'traj-2' | `-- length: 46 | `-- instruction: '...' | `-- action: np.ndarray with shape(46, dim_action) | `-- proprios: np.ndarray with shape(46, dim_proprio) |... ``` 2. 修改 [配置.py](<https://github.com/2toinf/UniAct/blob/main/datasets/AIRData/config.py>) 请按照文件中的数据结构添加您的数据元信息 3. 修改 [混合物。py](<https://github.com/2toinf/UniAct/blob/main/datasets/AIRData/mixture.py>) 4. 修改 [model_config .py (英语).](<https://github.com/2toinf/UniAct/blob/main/models/model_config.py>) 请为您的化身选择一个解码头并修改文件, 目前支持 : - [MLP 解码器](<https://github.com/2toinf/UniAct/blob/main/models/decoders/MLP_decoder.py>) - [ACT 解码器](<https://github.com/2toinf/UniAct/blob/main/models/decoders/ACT_decoder.py>) #### 运行以下脚本 ```bash srun -N8 \ python -u slurm_deepspeed_train.py \ --model UniAct_05B_CodeBook_256_V1_For_Fast_Adaptation \ --recipe ACT-Libero \ --iters 1000000 \ --start_iters 0 \ --batch-size 32 \ --lr 1e-4 \ --grad_accumulation_steps 1 \ --output_dir exp/Libero \ --save_interval 10000 \ --port 12345 \ --seed 178945 \ --precision bf16 \ --resume "path of pretrained basemodel" ``` ### 论文中关于数据检索的全轨UniAct 1. 遵循上述指示编写 OXE 数据集和 ARData 2. 设定 `UniAct-1.0` 作为脚本中的数据复制 3. 设定 `UniAct_05B_CodeBook_256_V1_Pretrain` 作为脚本中的模型 📆 TODO - [X] 释放训练代码库。 - [X] 解毒释放代码. - [X] 释放模范检查站. - [X] 发布培训指导. ## 致谢 这项工作是建立在以下基础之上的: [拥抱脸](https://github.com/huggingface/transformers.git) 财务报告和财务报告 [llava-one-vision](https://github.com/LLaVA-VL/LLaVA-NeXT.git).

查看原始来源