Pose machines-estimate the 2D pose from a single image
Pose Machine:articulated pose estimation via inference machine
引言
一、人体姿态估计复杂性的两个来源:
- 底层关节骨骼的大量自由度(近20°),这导致需要搜索一个高维配置空间;
- 人体外观的差异性,每个部件的外观因配置、成像条件、人与人之间的不同而不同。
二、图模型的限制性:
-
简单的图模型无法捕捉部件位置之间重要的相关性,会导致特征误差,比如double counting(如图1):
double counting:当图像的相同区域用于解释多个部件时发生,是因为身体部位的对称外观(左臂和右臂通常具有相似的外观),并且是各部位相互遮挡的有效配置。用图模型对外观对称性和自遮挡进行建模需要额外的边缘并在图中引入循环。这种非树结构通常需要近似推断,例如循环信念传播,使得参数学习非常困难。

-
在指定交互类型时,需要仔细考虑potential functions的定义。这种选择通常由参数形式决定,例如简单的二次模型,使得推理更加容易。因此实践中使用简单的分类器,比如用于部分检测的混合线性模。
-
这些是由模型的可控性而非数据的复杂性所决定的选择,会导致限制性模型无法解决问题固有的复杂度。
三、本文的方法
-
思路:
通过直接训练推理过程避免复杂性和易处理性之间的权衡; -
灵感:
conditioning finer part detection on the detection of large composite parts can improve localization; we incorporate these multi-scale cues in our framework by also modeling a hierarchy of parts. -
方法:
基于inference machine的pose machine是一种序列预测算法,模拟信息传递机制,预测每个part的置信度,迭代地在每个阶段改进the location of each part。 -
推理机的优点:
(1)一次性包含多个变量之间丰富的交互信息,减少了图1所示的double counting问题;
(2)可以直接从数据中学习空间模型,不需要设定potential function的参数形式;
(3)模块化框架可以使用高容量预测器,可以很好的处理每个part高度多模态外观; -
贡献:
(1)提出一种使用推理机框架的articulated pose estimation的方法,可以解决上述提到的两个主要问题;
(2)易于实现,在测试时不需要专门的优化求解器;
相关工作
-
树结构图模型:
将人体表示为一个树结构图形,使用运动学先验知识连接四肢。这类方法在图片中人体四肢可见的情况下非常有用,但是容易产生特征误差比如double counting image evidence,这是由于树结构图形没有对变量之间的相关性进行建模。 -
非树结构图模型:
改进了树结构模型,能够捕捉未连接到树的parts之间的遮挡关系。在这类模型上执行推理很困难,学习和测试时通常需要使用相似的方法。 -
部分层次模型:
condition the detection of smaller parts that model regions around anatomical joints on the location of large composite parts or poselets that model limbs in canonical configurations and tend to be easier to detect. -
本文方法的优点:
(1)使用前一阶段的输出改进part localization,以非参数数据驱动的形式学习空间模型,不需要设计part-specific classifiers;
(2)与深度学习方法类似,广义上是一种多层模块化网络,与深度学习方法以全局形式训练而言(BP算法),以有监督方式对每个模块进行局部训练;
(3)将part localization转变为a sequence of predictions——将前一阶段预测器的输出作为下一阶段的输入;
(4)基于hierarchical inference machine architecture,将结构化预测任务转变为一系列简单的机器学习子问题 ;
(5)extend and analyze the inference machine framework for the task of articulated pose estimation
Pose Inference Machines
一、背景
将图片中每个anatomical landmark的pixel location记为:
Y_p\in Z \subset R^2
where Z=\{(u,v)|u,v \in image\}
our goal: \forall P\in P,Y=(Y_1,Y_2,...,Y_P)where \space P\space is\space the\space number\space of\space parts
\forall t \in \{1...T\},基于图像数据x_z\in R^d和在每个Y_P邻域内来自于前一分类器的语义信息,分类器g_t()预测令Y_P=Z,\forall z \in Z的置信度。
在每个阶段,置信度为变量提供一个逐渐精确的估计。\forall t \in \{1...T\},令Y_P=Z的置信度为:
b_t(Y_p=z)=g_t^p\left(x_z;\bigoplus^P_{i=1}\psi(z,b_{t-1}^i)\right)\tag 1
whereb_{t-1}^p=\{b_{t-1}^p(Y_p=z)\}_{z \in Z}\tag 2
表示对于p’th部位,在每个位置z处由前一个分类器评估的置信度集合。
特征函数\psi:Z\times R^{|Z|}\rightarrow R^{d_c}计算来源于前一个分类器置信度的语义信息,\bigoplus表示向量连接。
不同于传统图模型,比如图结构,推理机框架不需要显式地通过potential functions对变量之间的相关性进行建模,而是通过分类器将相关性随机组合,这使得变量之间的复杂交互成为可能。通过一系列简单的子问题直接训练推理过程,从而可以使用任何有监督学习算法解决子问题,因此,可以利用最先进的
有监督学习技算法,使用能够处理多模态变化的复杂预测器。我们的关节人体姿态估计采用分层均值场推理机形式,每个变量所使用的语义信息来自于图形空间和尺度上的相邻变量。
二、Incorporating a Hierarchy
设计一种分层推理机,能够在图像的不同尺度上编码部件之间的交互关系,定义了从小的原子部件到大的复杂部件的层次结构。层次结构中的每个level都有不同种类的部件。在最粗糙的level,层次由单个可以捕捉整个人体的部件组成;在接下来的level,由可以建模完整肢体的复合部分组成;在最高级别的level中,由可以对anatomical landmark周围的区域建模的小部件组成。
P_1,...,P_L表示层次结构中每个level的the\space number\space of\space parts
^lg_t^p()——作为t^{th}\space stage和l^{th} \space level的分类器,对p^{th} 部件预测分数,可以简化为^lg_t( )
虽然可以在每一个level l中对每个部件p单独训练预测器,实际上,采用单个多分类器为特定层给定的特征向量中的所有部件产生一组置信度。
为了获得the location of each part的初步估计:
t=1,对于l^{th}\space level中的部件,^lg_1()将在图像位置z处提出到的patch上计算的特征作为输入,将patch分为P_l类中的某类或者background class
x_z^l——l^{th}\space level中,以图像位置z为中心的image\space patch的特征向量
t=1 stage,l^{th}\space level分类器产生的置信度如下:
^lg_1(x_z^l) \rightarrow \{^lb_1^p(Y_p=z)\}_{p \in 0...P_l}\tag3
where
^lb_1^p(Y_p=z)——在第一个阶段l^{th}\space level,将p^{th}部位放置在图片位置z处,由分类器^lg_1预测的分数
^lb_t^p \in R^{w\times h}——在图片每个位置z=(u,v)^T,l level中部位p的所有置信度的集合,w,h——图片的宽高,即:
^lb_t^p[u,v]=^lb_t^p(Y_p=(u,v)^T)\tag 4
^lb_t \in R^{w\times h\times P_l}——l level中所有part的confidence maps的集合(图2.a)
为了利用层次结构中scales/levels的语义信息,预测被定义为:
^lg_t\left(x_z^l,\bigoplus_{l\in 1...L}\psi(z,^lb_{t-1})\right)\rightarrow{^lb_t^p(Y_p=z)}_{p\in 0...P_l}\tag 5
如图2.b所示,在第二阶段,分类器^lg_2将特征x_z^l和通过特征函数\psi在前一阶段所有part的置信度上计算的特征作为输入。Note that the predictions for a part use features computed on outputs of all parts and in all levels of the hierarchy
(\{ ^lb_{t-1}\}_{l \in 1...L})。
推理机架构可以使用前一阶段输出的特征学习变量之间复杂的交互关系(不同于图模型中要设定potential function),通过选择最有预测性的特征使得分类器可以自由结合语义信息。所有相邻变量输出的使用类似于变分均值场推理中信息传递机制。

三、Context Features
为了捕获每个part相对于其邻域内part的置信度之间的空间相关性,描述了两种与“context”feature maps相关的银子:\psi_1 and \psi_2。
-
Context Patch Features
位置z处的feature maps\psi_1使用l level中每个part的location的confidence maps作为输入,并产生一个特征,这个特征是在confidence map^lb_t^p的位置z处提取的预定义宽度的向量化patch,如图3a。我们将在位置z处,从level l中的parts的beliefs上提取并向量化的一组patches记为c_1(z,^lb_{t-1}^p),则feature map\psi_1定义为:
\psi_1(z,^lb_{t-1})=\bigoplus_{p \in 0...P_l}c_1(z,^lb_{t-1}^p)\tag6
总之,context feature是在位置z处,从每一级所有parts的confidence maps上提取的分数的级联。context patch能够编码位置z的邻域信息,像信息一样在factor graph中传递由于对来源于所有parts的context进行编码,类似于完整图结构的图模型,因此很难优化。

-
Context Offset Features:
\psi_2——编码parts之间非均匀的、相对偏移的长范围交互作用
(1)对于l^th level的所有parts,采用非最大抑制从每个P_lconfidence maps^lb_{t-1}^p得到K个峰值的有序列表;
(2)在p^th和l^th的confidence map上,以极坐标的形式计算从位置z到每个k^th峰值的offset vector,记为:
^lo_k^p \in R^+ \times R(如图3b)
从某个part的confidence map计算的context offset features定义为:
c_2(z,^lb_{t-1}^p)=[^lo_1^p;...;^lo_K^p]\tag 7
(3)通过连接层级中每个part的context offset featuresc_2(z,^lb_{t-1}^p)组成context offset feature map \psi_2:
\psi_2(z,^lb_{t-1})=\bigoplus_{p\in 1...P_l}c_2(z,^lb_{t-1}^p)\tag 8
context patch features\psi_1捕捉关于相邻parts置信度的粗略信息;offset features\psi_2捕捉精确的相对位置信息。
最终的context feature\psi定义为:
\psi()=[\psi_1();\psi_2()]
四、训练
训练推理过程即直接训练每个预测器\{^lg_t\},\forall l \in \{1,...,L\},\forall t\in\{1,...,T\}。训练以阶段形式进行,算法如下:
1:Initialize:\{^lb_0=\empty\}_{l\in1,...,L}
2:for t=1…T do
3: for i=1…N do
4: Create\{^lb_{t-1}\}_{l=1}^L for each image i using predictor ^lg_{t-1}using Eqn.5
5: Apppend features extracted from each training image i, and from corresponding \{^lb_{t-1}\}_{l=1}^L(Eqns.6&8),to training datast D_t, for each image i.
6: end for
7: Train ^lg_t using D_t
8:end for
9:Return: Learned predictors\{^lg_t\}
第一组预测器\{^lg_1\},基于在annotated landmarks从图像数据集中提取的patches,使用包含图像特征在内的数据集D_0训练;对于更深的stages,在annotated locations,通过提取级联来自每张图片的confidence maps\{^lb_{t-1}\}_{l=1}^L的context features,构造D_t数据集。
五、Stacking
原因:
训练这种推理过程的预测器很容易过拟合,在后续阶段使用相同的训练集会使预测器依赖于前一阶段过于乐观的语义信息,或者过度依赖特定数据集的特征(泛化性差)。
动机:
理想情况下,希望使用前一阶段的输出训练后续阶段,模拟测试时遇到的问题
措施:
stacked training
过程:
Stacked training防止基于第一阶段输出训练的预测器在相同的训练集上再次被训练。Stacked training类似于交叉验证:对训练集D进行M划分,分为训练集和验证集\{D^m,D/D^m\}_{m=1...M}。For each predictor we aim to train in the first stage, we make M copies, each trained on one of the M splits of the training data. To create the training data for the next stage, for each training sample, we use the copy of the predictor that has not seen the sample(i.e.,the sample is in the held-out data for that predictor).Processding in this way creates a dataset to train the next stage on the outputs of the previous stage, ensuring that the outputs minic test-time behavior. We repeat the stacking procedure for each subsequent stage. The stacking for subsequent satges. At test time, we use a predictor in each stage that is trained using all of the data.
六、Inference
测试阶段的推理过程如图2b所示。过程如下:
1.在图片中每个位置,从不同尺度(对应于每一个L层级)提取到的特征输入第一阶段分类器\{^lg_1\}_{l=1}^L,输出confidence maps\{^lb_1\}_{l=1}^L;
2.在前一阶段的置信度^lb_1上,通过feature maps\psi_1、\psi_2计算context features;
3.由分类器^lg_2计算updated confidences\{^lb_2\}_{l=1}^L;
4.在每个阶段重复该过程;
5.计算出的置信度逐渐得到更加精确的每个部位的位置估计,如图4所示。
每个部位的位置计算如下:
\forall l, \forall p, ^ly_p^*=argmax_z \space {^l b_T}^p(z)\tag 9
经过最后阶段,通过选择每个部位最大的confidence map直接计算final pose
七、Implementation
- Choice of Predictor:
(1) 推理机框架模块化的本质是可以使用有监督学习分类器作为多类预测器g;
(2)由于数据分布是高度多模态的,因此需要大容量非线性预测器;
we use a boosted classifer with random forests for the weak learners, learn by optimizing the non-smooth hinge loss, 25 iterations, each classifer consists of 10 trees with a maximum depth of 15 and with a split performed only if a node contained greater than 10 training samples.
-
Training:
To create positive samples for training, we extract patches around the annotated anatomical landmarks in each training sample. For the background class, we use patches sampled from a negative training corpus. In addition, in subsequent stages, we sample negative patches from false positive regions in the positive images. -
Image Features:
We extract a set of image features from a patch at each location in the images. We use a standard set of simple features to provide a direct comparison and to control for effect of features on performance. We use Histogram of Gradients(HOG) features, Lab color features, and gradient magnituude. The Hog features are defined based on the structure of the human poses labeled in the respective datasets. -
Context Features:
1、context patch features:
使用21\times 21的context patch,在每个2\times 2的邻域上进行最大池化,从而为每个confidence map产生一组121个数字;
2、context offset features:
K=3 peaks
八、the study for future
1、correctly handle occluded poses
2、rare poses

