首页 > 其他分享 >Can Pre-Trained Text-to-Image Models Generate Visual Goals for Reinforcement Learning

Can Pre-Trained Text-to-Image Models Generate Visual Goals for Reinforcement Learning

时间:2023-11-28 16:02:15浏览次数:32  
标签:Pre diffusion based Models text image Learning RL mathcal

概述

Learning form the Void (LfVoid) 根据给定的language instruction对observation进行appearance-based and structure-based修改得到goal images,为RL提供奖励信号。提升了example-based RL methods,无需reward function或者demonstration就可以解决一些robot control tasks

问题

provide guidance or goals to a robot

现有方法:

  • a set of expert demonstrations
  • goal images
  • natual language instructions

不足:

  • 收集数据比较费力甚至prohibitive
  • 多模态之间存在语义模糊

相似工作

  • 利用 DALL-E 2 生成 object rearrangement 的 goal images
    • portal
      • Dall-e-bot: Introducing web-scale diffusion models to robotics
    • drawback
      • 生成的图像太diverse,与真实世界场景不符合
      • 需要用segmentation masks进行物体对应
      • 需要用rule-based transformation planner来消除视觉差异
  • 对生成图像进行编辑,与language description对齐
    • portal
      • Prompt-to-prompt image editing with cross attention control
      • Imagic: Text-based real image editing with diffusion models
      • Directed diffusion: Direct control of object placement through attention guidance
    • advantage
      • 保留其他objects的visual appearance,背景几乎没有影响
    • drawback
      • 生成的图片examined by visual appearance而不是embodied tasks

相关领域

  • Image editing for diffusion models
    • 用 text-to-image diffusion models 生成图像,与给定的文本提示词在语义上是对齐的:Prompt-to-Prompt, Imagic[20], InstructPix2Pix[26], Textual-Inversion[27], DreamBooth[28], Directed Diffusion[21]
  • Example-based visual RL
    • 利用goal states的observation来引导RL学习过程:VICE[5], VICE-RAQ[6], [29], [30], RCE[7]
  • Large generative models for robot control
    • 在机器人控制中的大模型主要是用LLM进行planning或者学习一个language conditioned policy,图像生成模型没怎么用
    • 数据增广:CACTI[15], GenAug[16], ROSIE[17]
    • 生成plans:[36], [37], [38]
    • 训练一个text-to-video generation model,为planning和inverse modeling生成image序列:UniPi[39]
    • DALL-E-Bot[18](见相似工作)

方法

两步走:从observation生成goal image dataset;用example-based visual RL进行学习

Visual goal generation

Given: source prompt \(\mathcal P\), source image \(x_{src}\), editing instruction

Output: target image \(x_{tgt}\) (via Latent Diffusion Model: LDM)

  • 两种 Editing instruction
    • appearance-based: target prompt \(\mathcal{P}^*\),描述外观变化
    • structure-based: 边界框 \(\mathcal{B}\)(目标位置), tokens \(\mathcal{I}\) 对应object的描述

三个模块,diffusion 过程的图片序列\(\{x_t,t=T,T-1,\cdots,0\}\),其中\(x_T\)表示高斯噪声,\(x_0\)是生成图像

  • feature extracting module(参照DreamBooh[28])

    • 训练一个diffusion model和特殊token \(sks\),采用包含target object的target image
    • 最终model可以精准保留\(x_{src}\)的关键细节,例如:the color and texture of a cube to be positioned, the shape of a Franka robot arm for manipulation
  • inversion module

    • 采用DDIM对\(x_{src}\)进行invert,\(x_0\)是近似\(x'_{src}\)
    • 为了消除累计误差,采用了Null-text inversion[40]
  • editing module

    • appearance-based: 采用Latent Diffusion Model (LDM)来生成\(x_0\)

      • Prompt-to-Prompt表示\(x_0\)的空间设置很大程度取决于cross-attention maps中的cross-attention maps \(M_t\),尤其是在前几步扩散中;故而可以通过更换attention map来实现p2p

      • \[P2PEdit(M,M^*,t)=\begin{cases} M_t,\text{if }t>T-N\\ M_t^*,\text{otherwise} \end{cases} \]

    • structure-based: 提出了P2P-DD,是结合了Directed Diffusion[21]的P2P,用来更改图片的空间设置

      • DD实现object replacement的方式是对边界框\(\mathcal B\)计算一个高斯增强掩膜(stregthening mask SM),对其他区域进行注意力退火,施加一个恒定衰弱掩膜(weakening mask WM)

      • 两个掩膜由一个标量\(c\)进行权衡:

      • \[\text{DDEdit}(M_t,\mathcal B,\mathcal I)=\begin{cases} M_t\odot\text{WM}(\bar{\mathcal B},\mathcal I)+c\cdot\text{SM}(\mathcal B,\mathcal I)& \text{if } t>T-N\\ M_t&\text{otherwise} \end{cases} \]

      • 提出的P2P-DD保留了更多的source image的内容,形式为:

      • \[\text{P2P-DDEdit}(M_t,M_t^*,\mathcal B, \mathcal I)=\text{DDEdit}(\text{P2PEdit}(M,M*,t),\mathcal B,\mathcal I) \]

      • 上式只用于前N步diffusion中,之后停止对attention map的控制,让diffusion过程以传统去噪方式进行

      image

      上图P2P表示的就是把\(M_t^*\)用\(M_t\)替换的过程,然后采用DD中对两个区域分别进行增强和衰弱。这两步分别对应了原有特征的保留和object位置的更改。

Example-based visual reinforcement learning

对VICE[5]进行了修改。流程:

  • 用随机初始化的环境的初始obs生成target image,每个task有1024个target image
  • 将target image作为正例,replay buffer中agent随机探索若干步之后的image作为负例
  • 用BCE loss对上面的数据训练一个鉴别器,用鉴别器的正输出作为agent的reward

细节:

  • 鉴别器和RL agent共享CNN encoder
  • 采用了label mixup method[6],对0-1标签和他们中间的向量进行随机线性插值,让labels变成0-1之间的连续值;此外作者发现限制重播缓冲区最近部分(最后5%)的负面实例可以提高鉴别器辨别目标和当前观察之间细微差异的能力
  • RL backbone采用了DrQ-v2[42],是对TD3进行图像表示增强的算法

实验

在Sim和Real-world做了三个task:LED-light, Push, Wipe

sim环境是Robosuite

实验图参见原文,这块儿比较直观。

标签:Pre,diffusion,based,Models,text,image,Learning,RL,mathcal
From: https://www.cnblogs.com/eirrac-rain/p/17862164.html

相关文章

  • Computer vision: models, learning and inference
    http://www.computervisionmodels.com/13.2.3SIFTdetectorSIFT尺度不变特征转换sasecondmethodforidentifyinginterestpoints一个尺度和对应兴趣点定位141516......
  • 界面控件DevExpress WPF流程图组件,完美复制Visio UI!(二)
    DevExpressWPFDiagram(流程图)控件帮助用户完美复制MicrosoftVisioUI,并将信息丰富且组织良好的图表、流程图和组织图轻松合并到您的下一个WPF项目中。在上文中(点击这里回顾>>),我们为大家介绍了DevExpressWPFDiagram(流程图)组件性能优异切信息丰富的流程图功能、轻松地从数据源......
  • NX二次开发UF_CAM_ask_cam_preferences 函数介绍
    文章作者:里海UF_CAM_ask_cam_preferencesDefinedin:uf_cam.hintUF_CAM_ask_cam_preferences(UF_CAM_preferences_p_tprefs)overview概述ThisfunctionprovidesthecurrentsettingsoftheCAMpreferences.此函数提供CAM首选项的当前设置。UFUN例子parameters参数UF_......
  • CF1901E Compressed Tree(树dp)
    Problem题目地址Solution来自fcy大佬的思路记\(f_u\)表示假定以\(u\)为根的子树,在压缩后,(子树内的某一个点(包括\(u\)))可以向外(除\(u\)为根的子树外所以点的集合)连一条边时的最大\(sum\)。换言之,我们把树拆成以\(u\)为根的子树(记作\(Tree_u\))和非\(Tree_u\)部分。而......
  • 大数据从入门到实战 - 第3章 MapReduce基础实战——信息挖掘 - 挖掘父子关系
    输出一直顺序不正确,把正确答案和我自己写的混了混,目前感觉是mapper的问题正确输出:grand_childgrand_parentMarkJesseMarkAlicePhilipJessePhilipAliceJoneJesseJoneAliceStevenJesseStevenAliceStevenFrankStevenMaryJo......
  • offline RL | BCQ:学习 offline dataset 的 π(a|s),直接使用 (s, π(s)) 作为 Q learni
    题目:Off-PolicyDeepReinforcementLearningwithoutExploration,ICLR2019pdf版本:https://arxiv.org/pdf/1812.02900.pdfhtml版本:https://ar5iv.labs.arxiv.org/html/1812.02900GitHub:https://github.com/sfujim/BCQ参考博客:https://zhuanlan.zhihu.com/p/493039753,......
  • 软件测试/人工智能|探究 LangChain 核心模块:PromptsModelsParsers
    简介LangChain是一种新兴的语言处理平台,其核心模块之一即PromptsModelsParsers。这一模块扮演着关键的角色,为LangChain的功能和性能提供了坚实的基础。在这篇文章中,我们将深入探讨PromptsModelsParsers模块的工作原理、功能和其对语言处理的重要性。什么是PromptsModels......
  • 记录一次生产环境因磁盘空间不足驱逐pod造成pod重建The node had condition: [DiskPre
       #记录一次生产报Thenodehadcondition:[DiskPressure]造成pod无限重启的监控不停的报警#进入k8s的管理机检查发现msg的pod重启重建pod多次[root@VM_248_6_centos~]#kubectlgetpod-ncms-v2-prodNAMEREADYSTA......
  • 随手写了个博客多平台发布脚本:Python自动发布文章到Wordpress
    引言作为一名技术博主,提高博客发布效率是我们始终追求的目标。在这篇文章中,我将分享一个基于Python的脚本,能够实现博客多平台发布,具体来说,是自动发布文章到WordPress。通过这个简单而高效的脚本,我们能够省去繁琐的手动发布步骤,提升工作效率。技术栈在编写这个自动发布脚本的过......
  • NX二次开发UF_CAM_PREF_set_logical_value 函数介绍
    文章作者:里海UF_CAM_PREF_set_logical_valueDefinedin:uf_cam_prefs.h intUF_CAM_PREF_set_logical_value(UF_CAM_PREF_tpref,logicalvalue)overview概述ThisfunctionsetsthelogicalsettingofthespecifiedCAMPreference.此函数设置指定CAM首选项的逻辑设置。U......