-
摘要:
近年来,大模型推动自然语言处理、机器视觉等众多领域取得前所未有进展. 混合专家(mixture of experts,MoE)凭借在模型参数扩展、计算成本控制和复杂任务处理等方面的独特优势成为大模型的主流架构之一. 然而,随着参数规模的持续增长,系统的执行效率和可扩展能力愈发难以满足需求,亟待解决. 系统优化方法是解决这一挑战的有效途径,日益成为研究热点. 故综述大模型时代MoE系统优化技术的研究现状,首先介绍MoE大模型的发展现状,并分析其在系统端面临的性能瓶颈;然后从内存占用、通信延迟、计算效率和并行扩展4个系统核心维度对最新的研究进展进行全面梳理和深入分析,并对其中涉及的关键技术、适用场景和待优化方向进行详细对比阐述;最后总结MoE系统优化的研究现状,并展望未来研究方向.
Abstract:In recent years, large models have made unprecedented progresses in variety of domains, such as natural language processing and machine vision. Mixture of Experts (MoE) has emerged as one of the most popular architectures for large models due to its distinct advantages in model parameter scalability, computational cost control and complex task processing. However, with the continuous increase of the parameter scale, the execution efficiency and scalability of the system are becoming increasingly challenging to meet the demand, and must be addressed urgently. The system optimization approach is an effective solution to solve this problem, which has become a hot research area. In light of this, we review the present research status of MoE system optimization techniques in the era of large model in this paper. To begin, we describe the present development state of work for MoE large model, and analyze the performance bottlenecks it faced on the system side. Then, we comprehensively sort out and deeply analyze the most recent research progress from four system core dimensions, ranging from memory occupation, communication latency, computational efficiency to parallel scaling, and compare and elaborate on the key technologies, application scenarios and optimization directions; Finally, we summarize the current research state of MoE system optimization and outline some future research directions as well.
-
行人重识别(person re-identification,ReID)任务旨在从互不重叠的摄像头收集的图库中匹配与给定查询图像身份相同的行人图像[1-2]. 近些年以来,随着强大的深度卷积神经网络(convolutional neural network,CNN)的成功应用,全监督场景下的行人重识别任务取得了快速的发展[3-5]. 但随之而来的是,现有基于模型层面改进的方法在效果上基本达到瓶颈[6-7]. 为了进一步提升模型性能以及考虑到收集有标记的虚拟数据不需要耗费人力和物力成本,本文提出将大规模虚拟数据集与真实世界数据集结合来训练行人重识别模型的方法,从而克服因真实世界数据匮乏造成的模型过拟合于训练集,而在测试集上表现不佳的问题. 然而,虚拟数据集和真实世界数据集往往存在着较大的领域差异,即这2个数据分布之间差异较大,如图1所示. 直接将虚拟数据和真实数据混合往往会给模型的学习带来困惑并减慢收敛速度,从而无法在真实世界的数据集上取得很好的性能,甚至可能对模型的性能带来损害.
除此之外,如图2所示,行人重识别任务的另一大挑战是,在不同摄像头下拍摄出的行人图像通常包含由背景、视角、光照、分辨率、人体姿势等一系列变化引起的显著的类内差异(intra-class variation),这些类内差异往往会对度量不同摄像头下同一身份的相似性带来不利影响,从而给现有的研究工作带来了巨大的挑战. 因此,如何更好地利用大规模的有标记的虚拟数据,使其帮助模型从更丰富多样的数据中学习得到摄像头差异无关的特征表示(camera-invariant feature representations),并提高模型在真实数据上的泛化性能也是本文研究的重点.
针对上述问题,本文提出了基于摄像头感知的对抗迁移学习方法,通过同时建模领域差异和多摄像头间类内差异,使模型从更丰富多样的数据中学习得到更鲁棒的摄像头差异无关的特征表示. 具体地说,受域对抗迁移网络[8](domain-adversarial migration network,DANN)将“对抗机制”引入神经网络训练方法的启发(DANN通过将特征提取器与领域判别器进行对抗训练,使得特征提取器学习到领域无关(domain-invariant)的特征),为了使虚拟数据集的分布尽可能向真实世界数据集靠拢从而消除领域差异,本文将对抗迁移学习引入行人重识别方法. 考虑到同一身份一般是由具有不同参数和环境的多个摄像头记录,从而具有显著不同的外观表现. 由此造成的摄像头之间的分布差异,也会使得识别同一身份的样本以及优化类内特征的相似性变得更加困难. 所以在DANN迷惑领域判别器的基础上,本文进一步提出使判别器无法分辨特征提取器处理后的数据(图像的特征表示)来自哪个真实领域的摄像头,从而获得摄像头差异无关的特征表示.
此外,为了缓解虚拟数据集夹带的误导信息所带来的不利影响和对抗训练中真实世界数据集的数据分布向虚拟数据集的数据分布发生偏移的问题,从而提高模型在真实数据集上的测试效果,本文引入一个只由真实数据集训练的辅助网络去约束混合数据训练的主网络对真实数据的预测概率. 本文的主要贡献包括4个方面:
1)引入少代价的标记虚拟数据集进行辅助训练的虚实结合的行人重识别框架,以此缓解由于数据匮乏导致的全监督行人重识别任务达到瓶颈的问题;
2)提出一种基于摄像头感知的非对称领域对抗模块,可以同时建模虚拟数据集和真实数据集的领域差异和由不同摄像头拍摄带来的类内差异,使模型从更丰富多样的数据中迁移有效的知识到真实场景中和学到摄像头差异无关的特征表示;
3)引入辅助网络进行训练,将知识蒸馏应用到学习框架中,实现参照真实数据分布空间的目标,以缓解虚拟数据集夹带的误导信息带来的不利影响和真实数据集的分布偏移问题;
4)在2个公开的行人重识别数据集上进行了实验验证和分析,实验结果表明我们提出的基于知识迁移的虚实行人重识别方法可以有效地从丰富的数据中学到摄像头差异无关的特征表示,以提升模型在真实场景下的泛化性能.
1. 相关工作
在监控系统中,受背景、视角、光照、分辨率、人体姿势等一系列变化的影响,同一身份的行人图像通常具有显著的类内差异,这些类内差异往往会对度量不同摄像头下同一身份的相似性带来不利影响,从而给现有的研究工作带来了巨大的挑战. 任务发展的初期,研究人员使用人工设计的特征进行行人重识别[9-12]. 近年来,随着深度学习技术的快速发展,基于深度学习的方法在行人重识别任务中占据主导地位,进而得到了广泛的应用和研究[3-7,13]. 本文从3个方面介绍本文任务的相关工作.
1.1 全监督的行人重识别方法
由于人体特征呈高度结构化,区分相应的身体部位可以有效地确定身份. 许多最近的工作[6,14-16]聚合来自不同身体部位和全局线索的显著特征用于人物重新识别. 其中,基于局部特征的方法[5-6,16]实现了最先进的性能,该方法将输入图像水平分成固定数量的条带,并从这些条带中聚合特征. 但从多个分支聚合特征向量网络结构较为复杂.
此外,区分行人图像的有效特征表示也是行人重识别任务中的一项重要挑战. 为了处理不完美的边界框检测和身体部位错位,许多工作[11,17-19]利用注意力机制来捕捉和聚焦于显示信息性特征(例如,空间位置和人体姿态)并抑制噪声部分(例如,背景和照明). 显著性加权[20-21]是解决这个问题的一种有效方法. 受到注意力模型的启发,Zhao等人[20]提出了针对行人重识别的部分对齐表示. 在类似的思想下,一些工作[21-22]也表现出了优越的泛化性能,它们将区域注意力选择子网络融合到行人重识别模型中. 为了学习对姿态变化具有鲁棒性的特征表示,姿态引导的注意力方法[23-24]借助姿态估计和人体分割网络将不同的身体部位特征融合在一起,以利于提升模型的性能.
由于摄像头标记信息在行人重识别任务中较为容易获得,且不同摄像头下同一身份的行人图像通常受类内差异的影响难以进行相似度度量. 近年来,一些研究[25-26]通过摄像头标记信息学习摄像头风格的变化,来解决跨摄像头检索任务中的图像风格变化产生类内差异的问题. 例如,Zhong等人[25]提出了一种平滑相机风格差异的方法. 利用CycleGAN将训练图像的风格样式转换到每个摄像头的风格上,生成后的数据样本与原始训练样本一起形成增强的训练集. 此外,Zhuang等人[26]提出了一种基于摄像头的批量归一化方法,用于解决行人重识别中的分布差异问题. 在训练中通过对每个摄像头进行归一化,实现映射所有摄像头下的数据到共享空间,从而使模型更好地适应新的摄像头.
为了进一步提高检索精度,一些研究工作还采用了重新排序策略[27-28]和使用特定人物属性进行推断[29]. 一些常用的数据增强方法,如随机擦除[30]和Cutout[31]也被广泛使用. 值得注意的是,数据增强方法可以与我们的方法结合使用.
1.2 对抗迁移学习的相关研究
对抗迁移学习中一类很重要的算法就是基于生成对抗的. 随着生成对抗网络(generative adversarial networks,GAN)的发展,已经提出了许多基于生成对抗的方法[32-38]被应用到有监督和无监督行人重识别任务上.Liu等人[32]考虑了由人体姿态变化引起的重新识别鲁棒性挑战,并提出了一种姿态可转移框架,利用姿态转移样本增强姿态鲁棒性. Qian等人[33]引入人体姿态用于合成具有不同姿态的人物图像,通过合成姿态规范化的图像,使模型所学到的特征表示不受姿态变化的影响.Wei等人[34]通过尽可能保持前景不变的条件下对不同数据集的背景进行转换,利用GAN将源域的图像风格转移到目标域中.
文献[32-34]方法都是在图像层级生成图像,这些方法无法进行端到端实现,在生成的过程中也很难保证生成图像中有关行人身份的内容特征不被破坏或丢失. 为此,Zheng等人[35]设计了一个融合特征学习和数据生成端到端的联合学习框架,使身份判别模块和图像生成模块相互促进从而生成更可靠的数据. 由于该方法仍然需要生成新的图像,其相对于特征学习需要增加GAN,因此在训练过程中需要耗费更多的资源.
另一类方法是基于数据分布自适应的对抗迁移算法,其在特征层级执行对抗训练,我们的方法属于这一类. 区别于生成对抗的迁移学习方法,基于数据分布自适应的对抗迁移算法通常为端到端的训练,通过特征提取器和领域判别器的相互对抗训练,以此学到领域不变的特征. Yu等人[36]在此基础上将动态分布自适应融入了对抗学习中,提出了一个动态对抗自适应网络,通过动态调整边界和条件分布关系使模型预测更加稳健准确. Qi等人[37]受文献[8]的启发,提出了一种基于摄像头感知的域适应方法,以此获取摄像头无关的特征表示. 不同于存在的对称对抗方法,我们引入了虚拟数据,Wang等人[39]针对标记数据匮乏导致模型泛化能力差的问题,使用了虚拟数据集得到多样化数据,提出了包含动态训练数据集生成和域不变特征学习部分的算法. 而我们提出了基于摄像头感知的非对称领域对抗模块来实现从虚拟数据中迁移信息到真实场景中,解决了虚拟数据集和真实数据集存在领域差异的问题.
1.3 知识蒸馏的行人重识别方法
知识蒸馏是模型压缩的一种常用的方法,知识蒸馏是通过构建一个轻量化的学生模型,利用性能更好的教师模型的监督信息来训练这个学生模型,以达到更好的性能和精度. 目前,一些行人重识别方法也用到了知识蒸馏[3,40]. Zhang等人[40]提出了深度相互学习策略,使学生在整个训练过程中协作学习并相互教学. Zhang等人[3]提出利用局部特征学习影响全局特征学习,并指出局部特征的学习方法是通过计算局部特征间的最短距离. 为了缓解我们方法的对抗过程中,真实世界数据集的数据分布向虚拟数据集的数据分布偏移的现象,我们引入了知识蒸馏的方法,将只由真实世界数据集训练的辅助网络作为教师网络,约束主模型中目标域身份分类的分支概率,保证真实数据空间不发生偏移,以实现在原始空间基础上更好地利用虚拟数据提升模型在真实数据上的泛化性能.
2. 形式化定义
在引入虚拟数据集的行人重识别研究中,我们将给定2个数据集Xs和Xt混合进行训练,Xs为虚拟数据集,其定义为 {X}_{\mathrm{s}}={\left\{\left({\boldsymbol{x}}_{i}^{\mathrm{s}},{\boldsymbol{y}}_{i}^{\mathrm{s}}\right)\right\}}_{i=1}^{{N}_{\mathrm{s}}} ,其中 {\boldsymbol{x}}_{i}^{\mathrm{s}} 和 {\boldsymbol{y}}_{i}^{\mathrm{s}} 分别为虚拟数据集中第 i 个训练样本和它对应的行人身份标记, {N}_{\mathrm{s}} 为虚拟数据集的样本数量. 给定一个真实世界数据集,我们将其分为训练集 {X}_{\mathrm{t}} 、查询集 {Q}_{\mathrm{t}} 和图库 {G}_{\mathrm{t}} . 同样地我们将具有 {N}_{\mathrm{t}} 个样本的真实世界数据集定义为 {X}_{\mathrm{t}}={\left\{\left({\boldsymbol{x}}_{i}^{\mathrm{t}},{\boldsymbol{y}}_{i}^{\mathrm{t}},{c}_{i}^{\mathrm{t}}\right)\right\}}_{i=1}^{{N}_{\mathrm{t}}} ,其中 {\boldsymbol{x}}_{i}^{\mathrm{t}} 和 {\boldsymbol{y}}_{i}^{\mathrm{t}} 分别为真实世界数据集中第 i 个训练样本和它对应的行人身份标记,而 {c}_{i}^{\mathrm{t}} 则是真实世界数据集中第 i 个训练样本对应的摄像头标记. 我们旨在将 {X}_{\mathrm{s}} 和 {X}_{\mathrm{t}} 混合并训练出一个行人重识别模型 F(\cdot |\boldsymbol{\theta }) ,对于任何一个查询人物的样本 \boldsymbol{q}\in {Q}_{\mathrm{t}} ,行人重识别模型应该生成一个特征向量 {\boldsymbol{f}}_{\boldsymbol{q}} 用于在图库 {G}_{\mathrm{t}} 中查询与 \boldsymbol{q} 有相同身份标记的样本 \boldsymbol{g} ,保证 \boldsymbol{q} 与样本 \boldsymbol{g} 的相似度要比图库中其他样本的相似度要高,如
\begin{array}{c}{\boldsymbol{g}}^{*}=\mathrm{arg}\,\underset{\boldsymbol{g}\in {G}_{\mathrm{t}}}{\mathrm{m}\mathrm{a}\mathrm{x}}sim\left({\boldsymbol{f}}_{\boldsymbol{g}},{\boldsymbol{f}}_{\boldsymbol{q}}\right),\end{array} (1) 其中 \boldsymbol{f}=F\left(\cdot|\boldsymbol{\theta }\right)\in {\mathbb{R}}^{d} 是由行人重识别模型提取的一个 d 维特征向量, sim\left(\cdot\right) 是特征之间的相似度.
3. 基于知识迁移的虚实结合行人重识别方法
3.1 整体结构
本文提出了一种新型的基于知识迁移的虚实结合行人重识别方法框架,同时缓解领域间差异和多摄像头带来类内差异的影响,使模型从更丰富多样的数据中学到摄像头差异无关的特征表示. 整体结构如图3(a)所示. 框架主要包括3个模块:
1)源域(虚拟数据)与目标域(真实数据)混合训练的通用全监督行人重识别模型,并增加了一路单独对目标域数据身份分类的分支;
2)在混合数据训练的行人重识别模型上添加了一个摄像头判别器,与主干网络组成基于摄像头感知的非对称领域对抗学习模块;
3)在每一次迭代中,使用混合数据中的目标域样本单独训练的通用全监督行人重识别模型,并使用其对模块1中的目标域分类分支进行约束对齐.
模块1和模块2组成了主模型,模块3为辅助模型. 模块2中主干网络作为特征提取器,与增加的摄像头判别器以对抗的方式迭代学习,其中摄像头判别器要不断地通过学习正确的摄像头标记信息来保证自己判别的准确性,而特征提取器需要生成可以迷惑摄像头判别器的特征向量以此实现消除领域差异与领域内由摄像头带来的类内差异的问题.
辅助模型则作为教师网络,将由目标域数据单独训练的行人重识别模型输出的身份类别概率作为软标记,以此约束主模型中目标域身份分类的分支概率,减少目标域数据在对抗中发生的数据分布偏移现象. 最后在训练完成后,仅采用主模型中的主干网络作为特征提取器进行推理,见图3(b).
3.2 通用的行人重识别模型
当前基于CNN的全监督行人重识别模型都遵循一个相似的网络结构,通过优化三元组损失[41]和软分类损失来进行模型训练,身份损失为:
\begin{array}{c}{\mathcal{L}}_{\mathrm{i}\mathrm{d}}={\mathcal{L}}_{\mathrm{s}\mathrm{c}\mathrm{l}\mathrm{s}}+{\mathcal{L}}_{\mathrm{t}\mathrm{r}\mathrm{i}}.\end{array} (2) 对于一个批次的样本,通用的行人重识别模型首先对训练数据集进行 P\times K 采样,即在一个小批次中随机对数据集采样 P 个不同身份的样本,每个身份采样不同的 K 张. 在本文中,针对混合数据的采样策略调整为均衡采样策略,即在每个小批次中虚拟数据和真实数据的样本数量是一致的,前一半批次为虚拟数据样本,后一半批次为真实数据样本. 若一个小批次包含 P\times K 个样本,那么虚拟数据集和真实世界数据集分别采样 (P/2)\times K 张样本.
采样后的数据进行简单的数据增强后输入到主干网络进行特征提取,该特征提取后会在小批次内计算难三元组损失,从而令小批次中每个样本拉近与它们最不相似的正样本的距离,同时推远与它们最相似的负样本的距离. 三元组损失定义为:
\begin{split} {\mathcal{L}}_{\mathrm{t}\mathrm{r}\mathrm{i}}=&\frac{1}{{N}_{\mathrm{b}}}\sum _{i=1}^{{N}_{\mathrm{b}}}\mathrm{m}\mathrm{a}\mathrm{x}\left(0,||F ({\boldsymbol{x}}_{i}\mid \boldsymbol{\theta } )-F ({\boldsymbol{x}}_{i,\mathrm{p}}\mid \boldsymbol{\theta } )||+a-\right.\\&\left.||F ({\boldsymbol{x}}_{i}\mid \boldsymbol{\theta } )-F ({\boldsymbol{x}}_{i,\mathrm{n}}\mid \boldsymbol{\theta } )||\right),\end{split} (3) 其中 {\boldsymbol{x}}_{i,\mathrm{p}} 表示在一个批次中与 {\boldsymbol{x}}_{i} 拥有相同身份标记的样本中最不相似的样本, {\boldsymbol{x}}_{i,\mathrm{n}} 则表示与 {\boldsymbol{x}}_{i} 拥有不同身份标记的样本中最相似的样本. a 是一个三元组距离阈值参数,其迫使模型学习,使锚点 {\boldsymbol{x}}_{i} 和负例 {\boldsymbol{x}}_{i,\mathrm{n}} 的距离更大,同时让锚点 {\boldsymbol{x}}_{i} 和正例 {\boldsymbol{x}}_{i,\mathrm{p}} 的距离更小. ||\cdot|| 代表L2范数距离.
最后将特征输入到身份分类器中,每一个样本都会得到它对应所有身份类别的概率,利用分类损失可以鼓励模型学习针对每个身份类别更具有判别性的特征向量. 分类损失定义为:
\begin{array}{c}{\mathcal{L}}_{\mathrm{c}\mathrm{l}\mathrm{s}}=-\dfrac{1}{{N}_{\mathrm{b}}}\displaystyle\sum _{i=1}^{{N}_{\mathrm{b}}} \mathrm{log}p\left({\boldsymbol{y}}_{i}\mid {\boldsymbol{x}}_{i}\right),\end{array} (4) 其中 {N}_{\mathrm{b}} , i 分别表示一个批次中样本的数量和样本的索引号, {\boldsymbol{x}}_{i} , {\boldsymbol{y}}_{i} 分别表示一个批次中第 i 个样本和它所属于的身份标记, p\left({\boldsymbol{y}}_{i}\mid {\boldsymbol{x}}_{i}\right) 表示样本 {\boldsymbol{x}}_{i} 属于身份标记 {\boldsymbol{y}}_{i} 的预测概率.
然而,测试集的行人身份类别从未出现在训练集中. 因此,防止行人重识别模型过度拟合训练的身份类别就显得非常重要. 文献[42]中提出的标记平滑(label smoothing,LS)是一种广泛使用的方法,可以被用于防止分类任务的过拟合现象. 标记平滑后的软分类损失计算更新为:
\begin{array}{c}{\mathcal{L}}_{\mathrm{s}\mathrm{c}\mathrm{l}\mathrm{s}}=-\dfrac{1}{{N}_{\mathrm{b}}}\displaystyle\sum _{i=1}^{{N}_{\mathrm{b}}}\displaystyle\sum _{j=1}^{{N}_{\mathrm{c}}} {q}_{j}\mathrm{log}p\left({\boldsymbol{y}}_{j}\mid {\boldsymbol{x}}_{i}\right),\end{array} (5) 其中
{q}_{j}=\left\{\begin{aligned}& 1-\dfrac{{N}_{\mathrm{c}}-1}{{N}_{\mathrm{c}}}\varepsilon ,\;\;\text{i}\text{f}\;\;{\boldsymbol{y}}_{j}={\boldsymbol{y}}_{i},\\& \varepsilon /{N}_{\mathrm{c}},\;\;\text{其他}\text{,}\end{aligned}\right. {N}_{\mathrm{c}} 为训练集的身份类别个数, j 为训练集中的某一身份类别索引, \varepsilon 为一个小的正常数迫使模型降低对训练集的信任,以此减少过拟合现象.
3.3 基于摄像头感知的非对称领域对抗模块
在行人重识别中,从属于不同摄像头的样本由于背景、视角、光照、人体姿势等一系列变化引起显著的类内差异,这同样也可以被映射在跨领域差异问题上. 若将训练集的样本按照从属的摄像头划分,每一个摄像头可以被视作一个子领域. 仅仅减少源域和目标域的整体差异并不能有效处理跨摄像头级的差异,这在一定程度上会对学习特征表示的质量产生不利影响. 为此,本文提出了一种基于摄像头感知领域适应模块,将从属于不同摄像头的样本映射到共享子空间中. 为实现这一目标,提出一种基于摄像头感知的非对称对抗学习(camera-aware asymmetric adversarial learning,CAAL),训练流程如图4所示.
传统的对抗性学习[8]通常只处理2个域,通过领域之间的对抗学到领域不变信息. 与其不同的是,本文提出的CAAL方法不仅将源域样本映射到目标域空间来降低领域差异,并且可以处理多个子域(即源域和目标域中的摄像头)进一步降低由摄像头引起的类内差异.
假定 {X}_{\mathrm{s}}={\left\{\left({\boldsymbol{x}}_{i}^{\mathrm{s}},{\boldsymbol{y}}_{i}^{\mathrm{s}}\right)\right\}}_{i=1}^{{N}_{\mathrm{s}}} 和 {X}_{\mathrm{t}}={\left\{\left({\boldsymbol{x}}_{i}^{\mathrm{t}},{\boldsymbol{y}}_{i}^{\mathrm{t}},{c}_{i}^{\mathrm{t}}\right)\right\}}_{i=1}^{{N}_{\mathrm{t}}} 为源域和目标域中的训练数据,混合训练数据 X= [{X}_{\mathrm{s}},{X}_{\mathrm{t}}] . 如图4所示,在本文任务中将源域看作一个摄像头,给定每个源域训练样本的摄像头标记都为“ 0 ”, {c}_{i}^{\mathrm{t}}\in \{0, 1,\cdots ,{C}_{\mathrm{t}}-1\} 是真实世界数据集中第 i 个训练样本对应的摄像头标记,混合训练中真实世界数据集的摄像头标记重标记为 {c}_{i}^{\mathrm{t}}+1\in \{\mathrm{1,2},\cdots ,{C}_{\mathrm{t}}\} , {C}_{\mathrm{t}} 为目标域中摄像头的总个数. 对抗学习框架中生成器和判别器以对抗的方式迭代学习,本文跟随DANN[8]的工作,将特征提取器 F\left(\cdot|{\boldsymbol{\theta }}_{1}\right) 视为生成器,另外本文构建了可学习的摄像头判别器 D:\boldsymbol{f}\to \left\{\mathrm{0,1},\cdots ,{C}_{\mathrm{t}}\right\} 通过在 {C}_{\mathrm{t}}+1 个摄像头类别上定义的交叉熵损失进行优化. 下面将介绍CAAL具体过程.
首先,为了获取更可信的摄像头判别器,固定特征提取器参数,利用交叉熵损失只更新摄像头判别器,损失函数为:
\begin{array}{c}{\mathcal{L}}_{\mathrm{c}\mathrm{a}\mathrm{m}}=\dfrac{1}{{N}_{\mathrm{b}}}\displaystyle\sum _{i=1}^{{N}_{\mathrm{b}}}{\mathcal{L}}_{\mathrm{c}\mathrm{e}}\left(D\left(F\left({\boldsymbol{x}}_{i}^{\mathrm{b}}|{\boldsymbol{\theta }}_{1}\right)\right),{c}_{i}\right),\end{array} (6) 其中
{c}_{i}=\left\{\begin{array}{l} 0,{\boldsymbol{x}}_{i}^{\mathrm{b}}\in {X}_{\mathrm{s}}{\text;} \\ {c}_{i}^{\mathrm{t}},{\boldsymbol{x}}_{i}^{\mathrm{b}}\in {X}_{\mathrm{t}}\text{. }\end{array}\right. 其次,为了将从属于不同摄像头的样本映射到共享子空间中构建软标记,此时将摄像头判别器的参数固定,特征提取器的参数受身份损失与迷惑标记损失共同优化,迷惑损失为:
\begin{array}{c}{\mathcal{L}}_{\mathrm{c}\mathrm{f}\mathrm{s}}=-\dfrac{1}{{N}_{\mathrm{b}}}\displaystyle\sum _{i=1}^{{N}_{\mathrm{b}}} {\mathcal{L}}_{\mathrm{c}\mathrm{e}}\left(D\left(F\left({\boldsymbol{x}}_{i}^{\mathrm{b}}|{\boldsymbol{\theta }}_{1}\right)\right),{\boldsymbol{y}}_{\mathrm{c}\mathrm{f}\mathrm{s}}\right),\end{array} (7) 其中 {\boldsymbol{y}}_{\mathrm{c}\mathrm{f}\mathrm{s}} 为迷惑标记, {\boldsymbol{y}}_{\mathrm{c}\mathrm{f}\mathrm{s}}=\left(0,\dfrac{1}{{C}_{\mathrm{t}}},\dfrac{1}{{C}_{\mathrm{t}}},\cdots ,\dfrac{1}{{C}_{\mathrm{t}}}\right)\in {\mathbb{R}}^{{C}_{\mathrm{t}}+1} .
特征提取器和摄像头判别器以对抗的方式迭代学习,摄像头判别器要不断地通过优化 {\mathcal{L}}_{\mathrm{c}\mathrm{a}\mathrm{m}} 学习正确的摄像头标记信息来保证自己判别的准确性,而特征提取器需要生成可以迷惑摄像头判别器的特征向量以此达到消除领域差异与领域内由摄像头带来的类内差异的问题,总优化损失为:
\begin{array}{c}{\mathcal{L}}_{\mathrm{F}}={\lambda }_{\mathrm{c}\mathrm{a}\mathrm{m}}{\mathcal{L}}_{\mathrm{c}\mathrm{f}\mathrm{s}}+{\mathcal{L}}_{\mathrm{i}\mathrm{d}}^{\mathrm{m}\mathrm{i}\mathrm{x}},\end{array} (8) 其中 {\lambda }_{\mathrm{c}\mathrm{a}\mathrm{m}} 为迷惑损失权重, {\mathcal{L}}_{\mathrm{i}\mathrm{d}}^{\mathrm{m}\mathrm{i}\mathrm{x}} 为由混合数据训练的通用行人重识别模型的身份损失. 通过控制合适的迷惑损失权重,可以平衡混合数据样本映射到共享子空时身份判别性的损失和在对抗中目标域数据分布发生被迫偏移的问题. 在对抗训练期间,特征提取器和摄像头判别器依次迭代学习,重复此操作直到收敛. 传统的双域对抗学习[8]只是这种基于摄像头感知的方案的一个特例,即当源域和目标域中只有1个摄像头类时.
3.4 辅助模型
已经有很多研究表明[42-43],使用软标记作为分类交叉熵损失的推广是有效的. 同时受文献[44]的启发,我们认为在没有蒸馏的情况下,神经网络的训练会陷入部分特征的陷阱,因此需要引入知识蒸馏来缓解这个问题. 在实验中发现,对抗过程中,真实世界数据集的数据分布不可避免地会向虚拟数据集的数据分布偏移,这是我们不希望发生的. 为了避免这种偏移,本文将只由真实世界数据集训练的辅助模型作为教师网络,由辅助模型预测的身份类别概率作为软标记,代替目标域样本的独热标记,用于训练主模型中目标域数据身份分类分支,缓解由虚拟数据集夹带的误导信息带来的不利影响.
如3.1节中介绍,辅助模型为由目标域数据训练的通用全监督行人重识别模型,然而在文献[10]中提到,虽然在教师网络中增加标记平滑的优化可以提高教师网络的模型性能,但是在用平滑过的教师网络进行知识蒸馏时,会降低学生网络的模型性能. 因为错误类别的预测概率正是我们在知识蒸馏时想要学习的潜在信息,而标记平滑则会抹去这些信息,所以为保证辅助模型预测的身份类别概率的可靠性,以及更好地进行知识蒸馏,辅助模型身份损失中的软分类损失由传统交叉熵损失代替进行更新优化,如式(9)所示:
\begin{array}{c}{\mathcal{L}}_{\mathrm{i}\mathrm{d}}^{\mathrm{t}}={\mathcal{L}}_{\mathrm{c}\mathrm{l}\mathrm{s}}^{\mathrm{t}}+{\mathcal{L}}_{\mathrm{t}\mathrm{r}\mathrm{i}}^{\mathrm{t}}.\end{array} (9) 此外,为了防止辅助模型预测样本身份类别错误导致主模型学习到错误信息. 本文构建了选择掩码矩阵 {\boldsymbol{M}}_{\mathrm{r}\mathrm{i}\mathrm{g}\mathrm{h}\mathrm{t}}\in {\mathbb{R}}^{{1\times (N}_{\mathrm{b}}/2)} ,在每个小批次中,只对在辅助模型中身份类别预测正确的样本计算对齐损失,选择掩码矩阵 {\boldsymbol{M}}_{\mathrm{r}\mathrm{i}\mathrm{g}\mathrm{h}\mathrm{t}} 和目标域对齐损失定义为:
\begin{split}{\mathcal{L}}_{\mathrm{a}\mathrm{l}\mathrm{i}\mathrm{g}\mathrm{n}\mathrm{m}\mathrm{e}\mathrm{n}\mathrm{t}}= & -\dfrac{1}{m}\displaystyle\sum _{i=1}^{m}{m}_{\mathrm{r}}\big({I}_{\mathrm{m}\mathrm{a}\mathrm{i}\mathrm{n}}\big(F\big({\boldsymbol{x}}_{i}^{\mathrm{t}}\big|{\boldsymbol{\theta }}_{1}\big)\big)\times \\ &\text{l}\text{o}\text{g}\big({I}_{\mathrm{a}\mathrm{u}\mathrm{x}}\big(F\big({\boldsymbol{x}}_{i}^{\mathrm{t}}\big|{\boldsymbol{\theta }}_{2}\big)\big)\big)\big),\end{split} (10) 其中
{m}_{\mathrm{r}}=\left\{\begin{aligned}& 1,Index\left(\mathrm{arg}\,\mathrm{m}\mathrm{a}\mathrm{x}{I}_{\mathrm{a}\mathrm{u}\mathrm{x}}\left(F\left({\boldsymbol{x}}_{i}^{\mathrm{t}}|{\boldsymbol{\theta }}_{2}\right)\right)\right)=i.\\ &0,Index\left(\mathrm{arg}\,\mathrm{m}\mathrm{a}\mathrm{x}{I}_{\mathrm{a}\mathrm{u}\mathrm{x}}\left(F\left({\boldsymbol{x}}_{i}^{\mathrm{t}}|{\boldsymbol{\theta }}_{2}\right)\right)\right)\ne i\text{. }\end{aligned}\right. 辅助模型中身份分类器 {I}_{\mathrm{a}\mathrm{u}\mathrm{x}} 和主模型中身份分类器 {I}_{\mathrm{m}\mathrm{a}\mathrm{i}\mathrm{n}} 均输出 {N}_{\mathrm{t}} 维概率向量来预测目标域训练样本的身份. 对于一个样本 {\boldsymbol{x}}_{i}^{\mathrm{t}} ,当 {I}_{\mathrm{a}\mathrm{u}\mathrm{x}} 输出的 {N}_{\mathrm{t}} 维向量中具有最大概率的索引值与它对应的身份标记的索引值 i 相同时, {m}_{\mathrm{r}}= 1.m 为每个批次中选择掩码 {\boldsymbol{M}}_{\mathrm{r}\mathrm{i}\mathrm{g}\mathrm{h}\mathrm{t}} 中包含1的个数.
3.5 总训练流程
本文提出的基于知识迁移的虚实结合行人重识别方法框架包含由混合数据训练的主模型和由目标域数据单独训练的辅助模型. 在一个批次中首先由 {\mathcal{L}}_{\mathrm{c}\mathrm{a}\mathrm{m}} 训练主模型中的摄像头判别器,随后总损失 \mathcal{L}\left({\boldsymbol{\theta }}_{1},{\boldsymbol{\theta }}_{2}\right) 通过式(11)同时更新除摄像头判别器以外的主模型和辅助模型参数:
\begin{split} \mathcal{L}\left({\boldsymbol{\theta }}_{1},{\boldsymbol{\theta }}_{2}\right)=&{\mathcal{L}}_{\mathrm{i}\mathrm{d}}^{\mathrm{m}\mathrm{i}\mathrm{x}}\left({\boldsymbol{\theta }}_{1}\right)+{\lambda }_{\mathrm{c}\mathrm{a}\mathrm{m}}{\mathcal{L}}_{\mathrm{c}\mathrm{f}\mathrm{s}}\left({\boldsymbol{\theta }}_{1}\right)+{\mathcal{L}}_{\mathrm{i}\mathrm{d}}^{\mathrm{t}}\left({\boldsymbol{\theta }}_{2}\right)+\\&{\lambda }_{\mathrm{a}\mathrm{u}\mathrm{x}}{\mathcal{L}}_{\mathrm{a}\mathrm{l}\mathrm{i}\mathrm{g}\mathrm{n}\mathrm{m}\mathrm{e}\mathrm{n}\mathrm{t}}\left({\boldsymbol{\theta }}_{1},{\boldsymbol{\theta }}_{2}\right),\end{split} (11) 其中 {\lambda }_{\mathrm{c}\mathrm{a}\mathrm{m}} , {\lambda }_{\mathrm{a}\mathrm{u}\mathrm{x}} 为权重参数. 主模型中特征提取器与摄像头判别器以对抗的方式迭代学习,将混合数据样本映射到共享子空间,辅助模型通过简单的知识蒸馏去平衡对抗中带来的分布偏移. 主模型与辅助模型共同优化,同时建模域间、域内差异,使模型从更丰富多样的数据中学到更一般化的类内差异特征表示. 本文提出的基于知识迁移的虚实结合行人重识别的具体算法如算法1所示.
算法1. 基于知识迁移的虚实结合行人重识别算法.
输入:虚拟数据集 {X}_{\mathrm{s}}={\left\{\left({\boldsymbol{x}}_{i}^{\mathrm{s}},{\boldsymbol{y}}_{i}^{\mathrm{s}}\right)\right\}}_{i=1}^{{N}_{\mathrm{s}}} ,真实数据集 {X}_{\mathrm{t}}={\left\{\left({\boldsymbol{x}}_{i}^{\mathrm{t}},{\boldsymbol{y}}_{i}^{\mathrm{t}},{c}_{i}^{\mathrm{t}}\right)\right\}}_{i=1}^{{N}_{\mathrm{t}}} ,ImageNet上预训练模型 F\left(\cdot|\boldsymbol{\theta }\right) ,批样本数量 {N}_{\mathrm{b}} ,身份采样参数 P,K ,权重参数 {\lambda }_{\mathrm{c}\mathrm{a}\mathrm{m}},{\lambda }_{\mathrm{a}\mathrm{u}\mathrm{x}} , 标记平滑参数 \varepsilon , 三元组阈值 a ;
输出:经过优化的特征提取器 F(\cdot|{\boldsymbol{\theta }}_{1}) .
① for n in [1, num_epochs] do
② repeat
③ {B}_{\mathrm{s}},{B}_{\mathrm{t}} 分别为每个小批次从 {X}_{\mathrm{s}},{X}_{\mathrm{t}} 中按照 P\times K 采样 {N}_{\mathrm{b}}/2 个图像;
④ {B}_{\mathrm{m}\mathrm{i}\mathrm{x}}=\left[{B}_{\mathrm{s}},{B}_{\mathrm{t}}\right] ,将 {B}_{\mathrm{m}\mathrm{i}\mathrm{x}} 经过数据增强后输入 到 F\left({\boldsymbol{x}}_{i}^{\mathrm{m}\mathrm{i}\mathrm{x}}\right|{\boldsymbol{\theta }}_{1}) 中, {B}_{\mathrm{t}} 经过数据增强后输入 到 F\left({\boldsymbol{x}}_{i}^{\mathrm{t}}\right|{\boldsymbol{\theta }}_{2}) 中;
⑤ 根据式(6)单独更新摄像头判别器参数, 其 他参数固定不参与更新;
⑥ 根据式(11)更新除摄像头判别器以外的参数;
⑦ 直到 {B}_{\mathrm{t}} 被枚举完;
⑧ end for
4. 实 验
4.1 数据集与评价指标
本文引入了虚拟数据集RandPerson[45]分别与2个广泛使用的真实域行人重识别数据集CUHK03[46]和MSMT[34]相结合进行训练. 并且在这2个数据集上评估了所提出的方法.
RandPerson由19个摄像头捕获的
8000 个身份的132145 张图像组成. 因为此数据集仅作为辅助训练引入,本文的目的并不在意模型在此数据集上的表现,所以并未划分查询集与图库集,此数据集也不会参加模型验证与测试.CUHK03包含
28193 张图像,由2个摄像头拍摄的1467 个身份组成. 本文遵循与Market1501类似的新协议,将CUHK03数据集分为767个身份的训练集和700个身份的测试集. 从每个相机中,选择一个图像作为每个身份标记的查询,其余图像用于构建图库集. 其中767个身份的7368 张图像用于训练. 查询集和图库集分别具有其余700个身份的1400 个图像和5328 个图像.MSMT由15个摄像头捕获的
4101 个身份的126441 张图像组成. 训练集包含1041 个身份的32621 张图像. 并将3060 个身份的其余图像分配给查询集(11659 个图像)和图库集(82161 个图像).在训练过程中,我们仅使用每个数据集训练集中的图像和相机标签,不使用任何其他注释信息. 模型评价指标由累积匹配性能(cumulative match characteristic,CMC)rank-1和平均精度均值(mean average precision,mAP)评估.
4.2 实验设置
本文在主干模型和辅助模型上均采用ResNet-50[47]作为主干网络去提取特征,并使用在ImageNet[48]上预先训练的参数对其进行初始化. 在训练过程中,输入图像被统一调整为256×128,并采取了行人重识别领域大多数工作采取的传统图像增强方式,即通过随机翻转、随机填充和随机擦除[30]进行.
对于训练中的每个小批次,每个身份的图像都遵循 P\times K 采样. 为了确保与其他方法更公平地比较,本文采取了同其他行人重识别方法[6,16,26]的实验设置. 本文设定小批量大小为128,即对于混合数据来说,采用均衡采样策略,分别在虚拟数据集和真实世界数据集使用 P=16 个随机选择的身份,每个身份选择 K=4 张图像进行采样,主模型输入混合数据,辅助模型输入与混合数据中相同的真实数据样本.
采用Adam方法对模型进行优化. 训练中采取预热策略来引导网络以获得更好的性能,本文将初始学习率设置为 3.5\times {10}^{-5} . 前10个epoch线性地将学习率从 3.5\times {10}^{-5} 增加到 3.5\times {10}^{-4} ,在第40个轮次和第70个轮次,学习率分别衰减到 3.5\times {10}^{-5} 和 3.5\times {10}^{-6} ,总共有120个训练轮次. 设定三元组损失的间距阈值 a= 0.3. 本文在主干网络中引入了标签平滑技术,并参考了基于标签平滑的知识蒸馏方法[42]的实验设置,将设定标签平滑参数 \varepsilon =0.1.
4.3 对比实验结果
本节中将本文提出的基于对抗迁移学习的行人重识别方法与近几年行人重识别领域提出的主流全监督方法在CUHK03和MSMT这2个数据集上进行了比较,这里需要注意的是,本文没有做任何的后处理,例如,重新排名[27-28]或多查询融合[1],因此所有的比较是公平的.
在CUHK03数据集上的验证说明了通常有2种拆分方法可以将CUHK03数据集划分训练集和测试集. 本文采取了767/700的拆分设置(训练集包含767个身份标记、测试集包含700个身份标记)而非
1367 /100(训练集包含1367 个身份标记、测试集包含100个身份标记)的设置. 因为前者比后者具有更少的训练图像和更多的测试图像,设置上更难,具有更大的挑战性也更接近现实的行人重识别任务. 同时在这种设置下也会给模型带来更大的困难. 在这种情况下,引入无需手工标注的虚拟数据集可以很好地帮助模型进行训练. 由表1可以看出,本文方法在CUHK03数据集上无论采取哪种评价指标,与目前主流的方法对比均可以取得更卓越的性能.表 1 CUHK03数据集上与主流方法的对比Table 1. Compared with SOTA Methods on CUHK03 Dataset方法 主干网络 尺寸 mAP/% rank-1/% PCB[4] ResNet50 256×128 53.2 59.7 FD[49] ResNet50 256×128 65.2 67.7 Pyramid[16] ResNet101 384×128 76.9 78.9 MGN[6] ResNet50 384×128 67.4 68.0 BAT-net[17] GoogLeNet 256×128 76.1 78.6 DANN*[8] ResNet50 256×128 75.5 77.6 AutoLoss-GMS-A[50] ResNet50 256×128 68.3 70.4 本文方法 ResNet50 256×128 77.8 81.1 注:*表示在本文相同设置下重新实现. Pyramid方法连接了21个不同尺度的局部特征,并且使用了更多参数的ResNet101作为主干网络.MGN方法受益于更庞大且复杂的网络,它具有8个分支,生成8个特征向量,共需要11个损失函数进行监督约束,其模型大小(参数数量)是本文方法的3倍. 然而在CUHK03数据集上进行对比时,本文方法在2个评价指标上的值均高于以上2个方法. 这证明了在面对更困难、更具有挑战的行人重识别任务时引入虚拟数据集进行辅助训练的重要性,可以在更小的开销下提升更多的模型性能. 在与本文具有相同的数据集和采样策略的设置下重新实现了DANN方法. 重现的模型在rank-1上比本文方法降低约3.4个百分点,在mAP上降低约2.3个百分点,这也证明了本文方法在消除领域差异上的优越性.
在MSMT数据集上的验证说明了MSMT数据集是3个数据集中拥有图像数量最多、行人身份数目最多、摄像头数量最多的数据集. 该数据集具有更复杂的场景和背景,并且在采集图片时涵盖了多个天气、多个时段具有的更复杂的光照变化. 因此MSMT数据集是更接近真实场景的大型数据集. 然而如表2所示,在面对如此庞大且复杂的数据集时,本文方法比对比方法的rank-1值高出至少1.7个百分点、mAP值高出至少1.3个百分点.
表 2 MSMT数据集上与主流方法的对比Table 2. Compared with SOTA Methods on MSMT Dataset方法 主干网络 尺寸 mAP/% rank-1/% PCB[4] ResNet50 256×128 40.4 68.2 BAT-net[17] GoogLeNet 256×128 56.8 79.5 CE-FAT[51] ResNet50 256×128 39.2 69.4 CBN[26] ResNet50 256×128 42.9 72.8 DG-Net[35] ResNet50 256×128 52.3 77.2 DANN*[8] ResNet50 256×128 57.6 79.9 CDNet[7] CDNet 256×128 54.7 78.9 AutoLoss-GMS-A[50] ResNet50 256×128 55.1 79.5 本文方法 ResNet50 256×128 58.8 82.1 注:*表示在本文相同设置下重新实现. CBN方法中也利用到了摄像头标记信息,但是仍低于本文方法的mAP值 15.9个百分点和rank-1值 9.3个百分点,证明本文方法可以更好地利用摄像头标记信息.DG-Net生成了10倍的数据增广,在mAP 和rank-1这2个指标上分别低了6.5个百分点和4.9个百分点,证明了引入虚拟数据集进行辅助训练的有效性. 与CUHK03数据集相同,在MSMT数据集上同样复现了与本文方法框架具有相同的数据集和采样策略设置的DANN方法. 在此设置下复现的DANN方法依然在mAP上略高于表现最好的BAT-net方法,这也证明了即使是面对数据量更多、行人身份更多样、场景更复杂的大型数据集时,引入虚拟数据集进行辅助训练仍然对模型表现具有卓越的提升. 同时,将本文方法与复现的DANN方法对比时,mAP值提高了1.2个百分点,rank-1值提高了2.2个百分点,证明了本文消除领域差异的方法更适用于行人重识别任务.
综上所述,本文方法在2个数据集上与当前主流行人重识别方法对比,无论使用哪种评估指标均表现优异. 通过对2个数据集的比较实验,我们也可以发现本文方法在更具有挑战性的新协议CUHK03数据集和数据量更大更复杂的MSMT数据集上进行验证时,始终优于所有其他方法. 因此,我们可以得出本文方法更擅长处理复杂且具有挑战性的问题,即更接近真实场景的情况.
4.4 消融实验分析
本节中我们在CUHK03和MSMT数据集上进行了消融实验,以充分分析和验证每个组件的有效性. 设置ResNet50为基准网络,其中“RP+CUHK03/MSMT”表示引入RandPerson数据集进行辅助训练,“w/o 辅助网络”表示仅使用本文方法进行训练,“w/o CAAL”表示仅使用本文方法进行训练.
由于虚拟数据集RandPerson具有
132145 张训练图像,是CUHK03数据集图像数量的20倍,即使是大型数据集MSMT也有将近4倍的训练数据. 如果单纯将虚拟数据集和真实数据集(CUHK03和MSMT中任意一个)混合起来,每个小批次时随机从混合数据集中采样,不仅会造成训练时间的增长(由于训练数据的大幅度增加),而且在实验中我们发现,在2个真实数据集上的性能有不同程度的下降,具体数据见表3和表4. 通过分析,造成这种现象的原因有2点:一是因为虚拟数据集与真实数据集具有较大的领域差异,强行混合训练只会令模型迷惑;二是虚拟数据集具有更多的数据量,从而使模型在学习的时候更偏向于虚拟数据集的数据分布.表 3 CUHK03数据集上消融实验结果Table 3. Ablation Experiment Results on CUHK03 Dataset% 方法 训练集 mAP rank-1 基准模型 CUHK03 63.6 65.7 基准模型 RP+ CUHK03 63.8 65.6 基准模型* RP+ CUHK03 72.7 75.1 本文(w/o 辅助网络) RP+ CUHK03 77.1 80.5 本文(w/o CAAL) RP+ CUHK03 75.9 78.2 本文(完整方法) RP+ CUHK03 77.8 81.1 注:*表示采用均衡采样策略. 表 4 MSMT数据集上消融实验结果Table 4. Ablation Experiment Results on MSMT Dataset% 方法 训练集 mAP rank-1 基准模型 MSMT 49.8 75.1 基准模型 RP+ MSMT 47.8 71.9 基准模型* RP+ MSMT 56.3 78.9 本文(w/o 辅助网络) RP+ MSMT 57.3 81.0 本文(w/o CAAL) RP+ MSMT 57.8 80.3 本文(完整方法) RP+ MSMT 58.8 82.1 注:*表示采用均衡采样策略. 为了缓减第2个问题,我们采用均衡采样策略生成每一个批训练数据,即一个批中的数据有一半真实数据和一半虚拟数据. 然而传统的方法,直接随机从每个数据集中进行采样训练. 从表3和表4中可以看出,均衡采样策略能够显著提升模型的性能.
为了证明基于摄像头感知的非对称领域对抗学习模块的有效性,表3、表4展示了不使用该模块和使用该模块的实验结果,可以看出当使用CAAL模块时在CUHK03数据集上的mAP值提升了4.4个百分点、rank-1值提升了5.4个百分点,在MSMT数据集上mAP值和rank-1值分别提升1.0个百分点和2.1个百分点. 考虑到CUHK03更具复杂性,从这也可以看出CAAL模块在更困难(更逼近真实场景)的任务上作用更明显.
为了证明辅助网络的有效性,表3、表4同样展示了不使用CAAL模块和使用CAAL模块的实验结果,当仅使用辅助网络时,2个数据集在mAP和rank-1指标上均有提升,证明引入知识蒸馏的确可以在一定程度上缓解虚拟数据集夹带的误导信息带来的不利影响. 当我们在加入CAAL的方法上再加入辅助网络时,实验结果表明在2个数据集上的性能均有显著的提升,证明了模型效果的提升来自于CAAL 模块和辅助网络的共同作用.
为了进一步证明CAAL模块可以同时降低领域差异和多摄像头间的类内差异,本节采用的t-SNE[52]可视化技术分别绘制了在引入RandPerson数据集辅助MSMT数据集时领域层级和摄像头层级的数据分布示意图. 其中,图5(a)(b)分别是领域层级下不使用CAAL和使用CAAL时的数据分布,图5(c)(d)分别是摄像头层级下不使用CAAL和使用CAAL时的数据分布.
图5(a)(b)中,所有的点代表了数据集RandPerson和MSMT的样本. 可以看出在不使用CAAL时这2个数据集具有较大的领域差异,而在使用CAAL后2个数据集的样本混合在了一起,即领域差异被消除了.
而在图5(c)(d)中,将虚拟数据集看作从属于一个摄像头下,所有的点代表了RandPerson和MSMT 在15个摄像头下每个摄像头的样本. 可以看出在没有使用CAAL时,MSMT中的摄像头样本更倾向于聚集在左上部分,RandPerson的摄像头样本更倾向于聚集在右下部分,这体现了不同摄像头通常具有不同的数据分布,当同一身份样本出现在不同摄像头下就会出现类内差异. 而使用了CAAL后不仅虚拟数据集与真实世界数据集的领域差异消失了,原本由于不同摄像头都具有特有的数据分布而聚集在一起的样本已经均匀分散开了. 这表明了CAAL模块消除领域差异的同时也弱化了摄像头间的类内差异.
4.5 参数的实验分析
图6展示了本文在2个数据集上针对损失权重 {\lambda }_{\mathrm{c}\mathrm{a}\mathrm{m}} 进行的参数实验,可以看出当损失权重 {\lambda }_{\mathrm{c}\mathrm{a}\mathrm{m}}\ge 0.5 的时,2个数据集的评价指标都出现了不同程度的下降,这也证实了我们之前的想法,即使我们的目标是让虚拟数据集的分布尽可能地靠近真实世界数据集分布,但是在对抗中真实世界数据集分布仍然会向虚拟数据集偏移,实验证明,当权重参数 {\lambda }_{\mathrm{c}\mathrm{a}\mathrm{m}}=0.1 时,可以平衡混合数据样本映射到共享子空间时身份判别性的损失和在对抗中目标域数据分布发生被迫偏移的问题.
本文也对辅助网络中的权重参数 {\lambda }_{\mathrm{a}\mathrm{u}\mathrm{x}} 进行了实验,实验结果见图7. 我们发现对虚拟数据集依赖性弱的数据集(例如,MSMT数据集在直接混合虚拟数据集训练时,相比于仅依靠自身数据训练时2个指标都有不同程度的下降),此时由虚拟数据集夹带的误导信息带来的不利影响越多,辅助网络所带来的知识蒸馏效果越好,所带来的提升也越高,所以将权重参数 {\lambda }_{\mathrm{a}\mathrm{u}\mathrm{x}} 设置为 1.0 . 而数据集是复杂数据集时(例如,CUHK03数据集在直接混合虚拟数据集训练时与仅依靠自身数据训练时相比mAP指标略有上升),此时辅助网络作为教师网络的可信度下降,当模型过于依赖辅助网络时反而会对任务造成负迁移效果. 此时,我们将权重参数 {\lambda }_{\mathrm{a}\mathrm{u}\mathrm{x}} 设置为 0.1 ,这样模型在应对数据量较少且更接近现实场景的行人重识别任务时就不会过度依赖辅助网络,但是同时又可以从辅助网络蒸馏的知识中学到原有的数据分布,以此缓解虚拟数据集带来的知识偏移.
5. 结 论
本文根据现有全监督行人重识别任务受限于数据匮乏的问题,提出引用虚拟数据集进行辅助训练. 同时提出了一种基于知识迁移的虚实结合行人重识别方法框架,采用基于摄像头感知的非对称领域对抗学习方法同时缓解域间、域内差异,以解决虚拟数据集与真实世界数据集领域差异过大和由不同摄像头带来的类内差异问题. 实验证明了该方法在逼近真实场景的行人重识别任务上的有效性.
作者贡献声明:祁磊提出了算法思路和实验方案;任子豪负责论文修订、补充和实验分析;刘俊汐执行实验和撰写论文;耿新提出指导意见并修改论文.
-
表 1 MoE与集成学习对比
Table 1 Comparison of MoE and Ensemble Learning
类别 MoE 集成学习 模型集成 都涉及整合多个模型结果以提高预测精度,都利用不同模型的优势来解决复杂问题 应用目的 不仅提高模型预测精度和泛化能力,还提高模型收敛速度和执行效率 提高模型预测精度和泛化能力 模型结构 由多个专家和门控网络组成,每个专家负责处理模型的一部分子任务,门控网络决定专家和子任务的映射关系 通常由多个独立训练的相同或不同算法模型构成 任务分解 将复杂任务分解为相对简单的子任务,专家网络专注于处理特定子任务 通常不涉及任务分解,多个学习器同时处理整个任务,通过投票、加权或平均等方法整合结果 训练方法 门控网络学习将任务分配给相应专家网络,专家网络专注于特定任务学习 各学习器独立训练,可使用不同的数据或算法,不涉及可学习的任务分配网络 应用场景 适用于复杂且任务可以分解为不同子任务的场景 适用于提升模型泛化能力和鲁棒性,尤其在数据或者特征有限的情况 稀疏性 只有少量专家在给定的时间被激活,提高计算效率 通常不具有稀疏性,所有模型都参与最终的预测 动态性 根据输入数据动态激活最适合的专家网络 通常不具有动态性,模型的集成是静态的,且在训练过程就已确定 表 2 符号及其描述
Table 2 Description of Symbols
符号 描述 G 每个节点内GPU的数量 N 节点总数 P GPU设备总数P=GN 表 3 MoE系统优化的代表工作总结
Table 3 Summary of Representative Works on MoE System Optimization
类型 子类 适用场景 文献 [69] [56] [57] [58] [63] [78] [109] [96] [126] [94] [95] [101] 内存占用 内存卸载 设备内存有限,模型参数规模大,模型推理 √ √ √ 参数压缩 √ √ 通信延迟 分层通信 通用,特别适合小批量数据通信 √ √ √ √ √ 冗余消除 模型推理或通过张量并行训练、推理 √ √ 其他* 通用,Janus除外 √ √ √ √ 拓扑敏感路由 模型训练,特别是网络拓扑复杂的集群 √ 计算效率 动态容量 通用,特别是专家数量多且偏好差异大的模型 √ √ 专家负载 负载均衡损失用于训练,路由均衡门控均可 设备负载 专家负载差异明显、变化显著,设备数量多 √ √ √ √ 激活预测 模型推理,但通常需要训练过程的统计数据 √ √ √ 静态流水 非极致性能需求 √ √ 自适应流水 模型规模大,执行开销大,极致性能需求 √ √ 内核计算 通用 √ √ √ √ 并行扩展 静态并行 同一模型频繁使用,训练、推理开销不大 √ √ √ 自适应并行 极致性能需求,模型频繁变化,大规模训练推理 √ √ -
[1] Kaplan J, McCandlish S, Henighan T, et al. Scaling laws for neural language models[J]. arXiv preprint, arXiv: 2001.08361, 2020
[2] Raffel C, Shazeer N, Roberts A, et al. Exploring the limits of transfer learning with a unified text-to-text transformer[J]. Journal of Machine Learning Research, 2020, 21(140): 1−67
[3] Brown T, Mann B, Ryder N, et al. Language models are few-shot learners[C] //Proc of the 34th Int Conf on Neural Information Processing Systems. New York: Curran Associates, 2020: 1877−1901
[4] Rae J W, Borgeaud S, Cai T, et al. Scaling language models: Methods, analysis & insights from training Gopher[J]. arXiv preprint, arXiv: 2112.11446, 2022
[5] Chowdhery A, Narang S, Devlin J, et al. PaLM: Scaling language modeling with Pathways[J]. Journal of Machine Learning Research, 2023, 24(240): 1−113
[6] Jacobs R A, Jordan M I, Nowlan S J, et al. Adaptive mixtures of local experts[J]. Neural Computation, 1991, 3(1): 79−87 doi: 10.1162/neco.1991.3.1.79
[7] Riquelme C, Puigcerver J, Mustafa B, et al. Scaling vision with sparse mixture of experts[C] //Proc of the 35th Int Conf on Neural Information Processing Systems. New York: Curran Associates, 2021: 8583−8595
[8] Fan Zhiwen, Sarkar R, Jiang Ziyu, et al. M3ViT: Mixture-of-experts vision transformer for efficient multi-task learning with model-accelerator co-design[C] //Proc of the 36th Int Conf on Neural Information Processing Systems. New York: Curran Associates, 2022: 28441−28457
[9] Li Bo, Shen Yifei, Yang Jingkang, et al. Sparse mixture-of-experts are domain generalizable learners[J]. arXiv preprint, arXiv: 2206.04046, 2023
[10] Xue Fuzhao, Shi Ziji, Wei Futao, et al. Go wider instead of deeper[C] //Proc of the 36th AAAI Conf on Artificial Intelligence. Palo Alto, CA: AAAI, 2022: 8779−8787
[11] Shen Sheng, Yao Zhewei, Li Chunyuan, et al. Scaling vision-language models with sparse mixture of experts[J]. arXiv preprint, arXiv: 2303.07226, 2023
[12] Dai Yong, Tang Duyu, Liu Liangxin, et al. One model, multiple modalities: A sparsely activated approach for text, sound, image, video and code[J]. arXiv preprint, arXiv: 2205.06126, 2022
[13] Mustafa B, Riquelme C, Puigcerver J, et al. Multimodal contrastive learning with LIMoE: The language-image mixture of experts[C] //Proc of the 36th Int Conf on Neural Information Processing Systems. New York: Curran Associates, 2022: 9564−9576
[14] Kumatani K, Gmyr R, Salinas F C, et al. Building a great multi-lingual teacher with sparsely-gated mixture of experts for speech recognition[J]. arXiv preprint, arXiv: 2112.05820, 2022
[15] You Zhao, Feng Shulin, Su Dan, et al. SpeechMoE: Scaling to large acoustic models with dynamic routing mixture of experts[J]. arXiv preprint, arXiv: 2105.03036, 2021
[16] You Z, Feng S, Su D, et al. Speechmoe2: Mixture-of-experts model with improved routing[C] //Proc of the 2022 IEEE Int Conf on Acoustics, Speech and Signal Processing. Piscataway, NJ: IEEE, 2022: 7217−7221
[17] Li Dingcheng, Li Xu, Wang Jun, et al. Video recommendation with multi-gate mixture of experts soft actor critic[C] //Proc of the 43rd Int ACM SIGIR Conf on Research and Development in Information Retrieval. New York: ACM, 2020: 1553−1556
[18] 曹泽麟,徐君,董振华,等. 基于多任务学习的位置倾向性得分预测算法[J]. 计算机研究与 发展,2023,60(1):85−94 Cao Zelin, Xu Jun, Dong Zhenhua, et al. Prediction of the positional propensity scores based on multi task learning[J]. Journal of Computer Research and Development, 2023, 60(1): 85−94 (in Chinese)
[19] Fedus W, Zoph B, Shazeer N. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity[J]. Journal of Machine Learning Research, 2022, 23(120): 1−39
[20] Shazeer N, Mirhoseini A, Maziarz K, et al. Outrageously large neural networks: The sparsely-gated mixture-of-experts Layer[J]. arXiv preprint, arXiv: 1701.06538, 2017
[21] Zoph B, Bello I, Kumar S, et al. ST-MoE: Designing stable and transferable sparse expert models[J]. arXiv preprint, arXiv: 2202.08906, 2022
[22] Lee-Thorp J, Ainslie J. Sparse mixers: Combining MoE and mixing to build a more efficient bert[J]. arXiv preprint, arXiv: 2205.12399, 2022
[23] Kudugunta S, Huang Y, Bapna A, et al. Beyond distillation: Task-level mixture-of-experts for efficient inference[J]. arXiv preprint, arXiv: 2110.03742, 2021
[24] Du Nan, Huang Yanping, Dai A M, et al. GLaM: Efficient scaling of language models with mixture-of-experts[C] //Proc of the 39th Int Conf on Machine Learning. New York: PMLR, 2022: 5547−5569
[25] Lou Yuxuan, Xue Fuzhao, Zheng Zangwei, et al. Cross-token modeling with conditional computation[J]. arXiv preprint, arXiv: 2109.02008, 2022
[26] Lin Junyang, Men Rui, Yang An, et al. M6: A chinese multimodal pretrainer[J]. arXiv preprint, arXiv: 2103.00823, 2021
[27] Lin Junyang, Yang An, Bai Jinze, et al. M6−10T: A sharing-delinking paradigm for efficient multi-trillion parameter pretraining[J]. arXiv preprint, arXiv: 2110.03888, 2021
[28] Ren Xiaozhe, Zhou Pingyi, Meng Xinfan, et al. Pangu-Σ: Towards trillion parameter language model with sparse heterogeneous computing[J]. arXiv preprint, arXiv: 2303.10845, 2023
[29] Jiang A Q, Sablayrolles A, Roux A, et al. Mixtral of experts[J]. arXiv preprint, arXiv: 2401.04088, 2024
[30] Nguyen H D, Chamroukhi F. Practical and theoretical aspects of mixture‐of‐experts modeling: An overview[J]. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 2018, 8(4): e1246 doi: 10.1002/widm.1246
[31] Masoudnia S, Ebrahimpour R. Mixture of experts: A literature survey[J]. Artificial Intelligence Review, 2014, 42(2): 275−293 doi: 10.1007/s10462-012-9338-y
[32] Yuksel S E, Wilson J N, Gader P D. Twenty years of mixture of experts[J]. IEEE Transactions on Neural Networks and Learning Systems, 2012, 23(8): 1177−1193 doi: 10.1109/TNNLS.2012.2200299
[33] Fedus W, Dean J, Zoph B. A review of sparse expert models in deep learning[J]. arXiv preprint, arXiv: 2209.01667, 2022
[34] Liu Tianlin, Blondel M, Riquelme C, et al. Routers in vision mixture of experts: An empirical study[J]. arXiv preprint, arXiv: 2401.15969, 2024
[35] Cai Weilin, Jiang Juyong, Wang Fan, et al. A survey on mixture of experts[J]. arXiv preprint, arXiv: 2407.06204, 2024
[36] Lepikhin D, Lee H, Xu Yuandong, et al. GShard: Scaling giant models with conditional computation and automatic sharding [J]. arXiv preprint, arXiv: 2006.16668, 2020
[37] Zhang Zhengyan, Lin Yankai, Liu Zhiyuan, et al. MoEfication: Transformer feed-forward layers are mixtures of experts[J]. arXiv preprint, arXiv: 2110.01786, 2021
[38] Zuo Simiao, Zhang Qingru, Liang Chen, et al. MoEBERT: from bert to mixture-of-experts via importance-guided adaptation[J]. arXiv preprint, arXiv: 2204.07675, 2022
[39] Zhu Tong, Qu Xiaoye, Dong Daize, et al. LLaMA-MoE: Building mixture-of-experts from LLaMA with continual pre-training[J]. arXiv preprint, arXiv: 2406.16554, 2024
[40] Dai Damai, Deng Chenqi, Zhao Chenggang, et al. DeepSeekMoE: Towards ultimate expert specialization in mixture-of-experts language models[J]. arXiv preprint, arXiv: 2401.06066, 2024
[41] Xue Fuzhao, Zheng Zian, Fu Yao, et al. OpenMoE: An early effort on open mixture-of-experts language models[J]. arXiv preprint, arXiv: 2402.01739, 2024
[42] xAI. Open release of Grok−1[EB/OL]. [2024-08-02]. https://x.ai/blog/ grok-os
[43] Reid M, Savinov N, Teplyashin D, et al. Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context[J]. arXiv preprint, arXiv: 2403.05530, 2024
[44] Snowflake AI Research Team. Snowflake Arctic: The best LLM for enterprise AI — Efficiently intelligent, truly open[EB/OL]. [2024-08-02]. https://www.snowflake.com/en/blog/arctic-open-efficient-foundati-on-language-models-snowflake/
[45] The Mosaic Research Team. Introducin DBRX: A new state-of-the-art open LLM[EB/OL]. 2024 [2024-08-02]. https://www.databricks.com/blog/introducing-dbrx-new-state-art-open-llm
[46] Choquette J, Gandhi W, Giroux O, et al. Nvidia A100 tensor core GPU: Performance and innovation[J]. IEEE Micro, 2021, 41(2): 29−35 doi: 10.1109/MM.2021.3061394
[47] Choquette J. Nvidia Hopper H100 GPU: Scaling performance[J]. IEEE Micro, 2023, 43(3): 9−17 doi: 10.1109/MM.2023.3256796
[48] Ren Jie, Rajbhandari S, Aminabadi R Y, et al. ZeRO-Offload: Democratizing billion-scale model training[C] //Proc of the 2021 USENIX Annual Technical Conf. Berkeley, CA: USENIX Association, 2021: 551−564
[49] Chen Xioaming, Chen D Z, Hu X S. MoDNN: Memory optimal DNN training on GPUs[C] //Proc of the 21st conf & Exhibition on Design, Automation & Test in Europe. Piscataway, NJ: IEEE, 2018: 13−18
[50] Shriram S B, Garg A, Kulkarni P. Dynamic memory management for GPU-based training of deep neural networks[C] //Proc of the 33rd IEEE Int Parallel and Distributed Processing Symp. Piscataway, NJ: IEEE, 2019: 200−209
[51] Ren Jie, Luo Jiaolin, Wu Kai, et al. Sentinel: Efficient tensor migration and allocation on heterogeneous memory systems for deep learning[C] //Proc of the 27th IEEE Transactions Symp on High Performance Computer Architecture. Piscataway, NJ: IEEE, 2021: 598−611
[52] Huang C C, Jin Gu, Li Jinyang. SwapAdvisor: Pushing deep learning beyond the GPU memory limit via smart swapping[C] //Proc of the 25th Int Conf on Architectural Support for Programming Languages and Operating Systems. New York: ACM, 2020: 1341−1355
[53] Huang Haiyang, Ardalani N, Sun Anna, et al. Towards MoE deployment: Mitigating inefficiencies in mixture-of-expert (MoE) inference[J]. arXiv preprint, arXiv: 2303.06182, 2023
[54] Eliseev A, Mazur D. Fast inference of mixture-of-experts language models with offloading[J]. arXiv preprint, arXiv: 2312.17238, 2023
[55] Kong Rui, Li Yuanchun, Feng Qingtian, et al. Serving MoE models on resource-constrained edge devices via dynamic expert swapping[J]. arXiv preprint, arXiv: 2308.15030, 2023
[56] Hwang R, Wei Jianyu, Cao Shijie, et al. Pre-gated MoE: An algorithm-system co-design for fast and scalable mixture-of-expert inference[J]. arXiv preprint, arXiv: 2308.12066, 2023
[57] Shen Liang, Wu Zhihua, Gong Weibao, et al. SE-MoE: A scalable and efficient mixture-of-experts distributed training and inference system[J]. arXiv preprint, arXiv: 2205.10034, 2023
[58] Liu Juncai, Wang J H, Jiang Yimin. Janus: A unified distributed training framework for sparse mixture-of-experts models[C] //Proc of the 37th ACM SIGCOMM 2023 Conf. New York: ACM, 2023: 486−498
[59] Kim Y, Lim H, Han D. Scaling beyond the GPU memory limit for large mixture-of-experts model training[C] //Proc of the 41st Int Conf on Machine Learning. New York: PMLR, 2024: 24342−24353
[60] Yi Rongjie, Guo Liwei, Wei Shiyun, et al. EdgeMoE: Fast on-device inference of MoE-based large language models[J]. arXiv preprint, arXiv: 2308.14352, 2023
[61] Xue Leyang, Fu Yao, Lu Zhan, et al. MoE-Infinity: Activation-aware expert offloading for efficient MoE serving[J]. arXiv preprint, arXiv: 2401.14361, 2024
[62] Kamahori K, Gu Yile, Zhu Kan, et al. Fiddler: CPU-GPU orchestration for fast inference of mixture-of-experts models[J]. arXiv preprint, arXiv: 2402.07033, 2024
[63] Zhang Zheng, Xia Yaqi, Wang Hulin, et al. MPipeMoE: Memory efficient MoE for pre-trained models with adaptive pipeline parallelism[C] //Proc of the 37th IEEE Parallel and Distributed Processing Symp. Piscataway, NJ: IEEE, 2023: 167−177
[64] Jain P, Jain A, Nrusimha A, et al. Checkmate: Breaking the memory wall with optimal tensor rematerialization[C/OL] //Proc of the 3rd Machine Learning and Systems. 2020 [2024-08-02]. https://proceedings.mlsys.org/paper_files/paper/2020/file/0b816ae8f06f8dd3543dc3d9ef196cab-Paper.pdf
[65] Chen Tianqi, Xu Bing, Zhang Chiyuan, et al. Training deep nets with sublinear memory cost[J]. arXiv preprint, arXiv: 1604.06174. 2016
[66] Peng Xuan, Shi Xuanhua, Dai Hulin, et al. Capuchin: Tensor-based GPU memory management for deep learning[C] //Proc of the 25th Int Conf on Architectural Support for Programming Languages and Operating Systems. New York: ACM, 2020: 891−905
[67] Wang Linnan, Ye Jinmian, Zhao Yiyang, et al. SuperNeurons: Dynamic GPU memory management for training deep neural networks[J]. ACM SIGPLAN Notices, 2018, 53(1): 41−53 doi: 10.1145/3200691.3178491
[68] Kim Y J, Awan A A, Muzio A, et al. Scalable and efficient MoE training for multitask multilingual models[J]. arXiv preprint, arXiv: 2109.10465, 2021
[69] Singh S, Ruwase O, Awan A A, et al. A hybrid tensor-expert-data parallelism approach to optimize mixture-of-experts training[C] //Proc of the 37th Int Conf on Supercomputing. New York: ACM, 2023: 203−214
[70] Heo T, Rashidi S, Man C, et al. Exploring memory expansion designs for training mixture-of-experts models[C/OL] //Proc of the 1st Workshop on Hot Topics in System Infrastructure. 2024 [2024-08-02]. https:// hotinfra23.github.io/papers/hotinfra23-paper4.pdf
[71] Hinton G, Vinyals O, Dean J. Distilling the knowledge in a neural network[J]. arXiv preprint, arXiv: 1503.02531, 2015
[72] Molchanov P, Tyree S, Karras T, et al. Pruning convolutional neural networks for resource efficient inference[J]. arXiv preprint, arXiv: 1611.06440, 2016
[73] Han Song, Mao Huizi, Dally W J. Deep compression: Compressing deep neural networks with pruning, trained quantization and Huffman coding[J]. arXiv preprint, arXiv: 1510.00149, 2016
[74] Dong Zhen, Yao Zzhewei, Arfeen D, et al. HAWQ-V2: Hessian aware trace-weighted quantization of neural networks[C] //Proc of the 34th Int Conf on Neural Information Processing Systems. New York: Curran Associates, 2020: 18518−18529
[75] Micikevicius P, Narang S, Alben J, et al. Mixed precision training[J]. arXiv preprint, arXiv: 1710.03740, 2018
[76] Dabre R, Fujita A. Recurrent stacking of layers in neural networks: An application to neural machine translation[J]. arXiv preprint, arXiv: 2106.10002, 2021
[77] Lan Zhenzhong, Chen Mingda, Goodman S, et al. ALBERT: A lite BERT for self-supervised learning of language representations[J]. arXiv preprint, arXiv: 1909.11942, 2020
[78] Rajbhandari S, Li Conglong, Yao Zhewei, et al. DeepSpeed-MoE: Advancing mixture-of-experts inference and training to power next-generation ai scale[C] //Proc of the 39th Int Conf on Machine Learning. New York: PMLR, 2022: 18332−18346
[79] Koishekenov Y, Berard A, Nikoulina V. Memory-efficient NLLB−200: Language-specific expert pruning of a massively multilingual machine translation model[J]. arXiv preprint, arXiv: 2212.09811, 2022
[80] Lu Xudong, Liu Qi, Xu Yuhui, et al. Not all experts are equal: Efficient expert pruning and skipping for mixture-of-experts large language models[J]. arXiv preprint, arXiv: 2402.14800, 2024
[81] Muzio A, Sun A, He C. SEER-MoE: Sparse expert efficiency through regularization for mixture-of-experts[J]. arXiv preprint, arXiv: 2404.05089, 2024
[82] Chowdhury M N R, Wang Meng, Maghraoui K E, et al. A provably effective method for pruning experts in fine-tuned sparse mixture-of-experts[J]. arXiv preprint, arXiv: 2405.16646, 2024
[83] Liu Enshu, Zhu Junyi, Lin Zinan, et al. Efficient expert pruning for sparse mixture-of-experts language models: Enhancing performance and reducing inference costs[J]. arXiv preprint, arXiv: 2407.00945, 2024
[84] Kim Y J, Fahim R, Awadalla H H. Mixture of quantized experts (MoQE): Complementary effect of low-bit quantization and robustness[J]. arXiv preprint, arXiv: 2310.02410, 2023
[85] Frantar E, Alistarh D. QMoE: Practical sub−1-bit compression of trillion-parameter models[J]. arXiv preprint, arXiv: 2310.16795, 2023
[86] Kim Y J, Henry R, Fahim R, et al. Who says elephants can't run: Bringing large scale MoE models into cloud scale production[J]. arXiv preprint, arXiv: 2211.10017, 2022
[87] Kim Y J, Henry R, Fahim R, et al. FineQuant: Unlocking efficiency with fine-grained weight-only quantization for LLMs[J]. arXiv preprint, arXiv: 2308.09723, 2023
[88] Imani H R, Amirany A, El-Ghazawi T. Mixture of experts with mixture of precisions for tuning quality of service[J]. arXiv preprint, arXiv: 2407.14417, 2024
[89] Gao Zefeng, Liu Peiyu, Zhao Xin, et al. Parameter-efficient mixture-of-experts architecture for pre-trained language models[J]. arXiv preprint, arXiv: 2203.01104, 2022
[90] He S, Fan R Z, Ding Liang, et al. Merging experts into one: Improving computational efficiency of mixture of experts[J]. arXiv preprint, arXiv: 2310.09832, 2023
[91] Zhang Rongyu, Luo Yulin, Liu Jiaming, et al. Efficient deweahter mixture-of-experts with uncertainty-aware feature-wise linear modulation[C] //Proc of the 38th AAAI Conf on Artificial Intelligence. Palo Alto, CA: AAAI, 2024: 16812−16820
[92] Chen Tianyu, Huang Shaohan, Xie Yuan, et al. Task-specific expert pruning for sparse mixture-of-experts[J]. arXiv preprint, arXiv: 2206.00277, 2022
[93] Xue Fuzhao, He Xiaoxin, Ren Xiaozhe, et al. One student knows all experts know: From sparse to dense[J]. arXiv preprint, arXiv: 2201.10890, 2022
[94] Li Jiamin, Jiang Yimin, Zhu Yibo, et al. Accelerating distributed MoE training and inference with Lina[C] //Proc of the 2023 USENIX Annual Technical Conf. Berkeley, CA: USENIX Association, 2023: 945−959
[95] Nie Xiaonan, Zhao Pinxue, Miao Xupeng, et al. HetuMoE: An efficient trillion-scale mixture-of-expert distributed training system[J]. arXiv preprint, arXiv: 2203.14685, 2022
[96] Hwang C, Cui Wei, Xiong Yifan, et al. Tutel: Adaptive mixture-of-experts at scale[C/OL] //Proc of the 6th Machine Learning and Systems. 2023 [2024-08-02]. https://proceedings.mlsys.org/paper_files/paper/2023/file/5616d34cf8ff73942cfd5aa922842556-Paper-mlsys2023.pdf
[97] He Chaoyang, Zheng Suai, Zhang A, et al. SMILE: Scaling mixture-of-experts with efficient bi-level routing[J]. arXiv preprint, arXiv: 2212.05191, 2022
[98] Shoeybi M, Patwary M, Puri R, et al. Megatron-LM: Training multi-billion parameter language models using model parallelism[J]. arXiv preprint, arXiv: 1909.08053, 2020
[99] Yao Jinghan, Anthony Q, Shafi A, et al. Exploiting inter-layer expert affinity for accelerating mixture-of-experts model inference[C] //Proc of the 38th IEEE Int Parallel and Distributed Processing Symp. Piscataway, NJ: IEEE, 2024: 915−925
[100] Liu Rui, Kim Y J, Muzio A, et al. Gating dropout: Communication-efficient regularization for sparsely activated transformers[C] //Proc of the 39th Int Conf on Machine Learning. New York: PMLR, 2022: 13782−13792
[101] He Jiaao, Zhai Jidong, Antunes T, et al. FasterMoE: modeling and optimizing training of large-scale dynamic pre-trained models[C] //Proc of the 27th ACM SIGPLAN Symp on Principles and Practice of Parallel Programming. New York: ACM, 2022: 120−134
[102] Chen Chang, Li Min, Wu Zhihua, et al. TA-MoE: Topology-aware large scale mixture-of-expert training[C] //Proc of the 36th Int Conf on Neural Information Processing Systems. New York: Curran Associates, 2022: 22173−22186
[103] Zeng Zhiyuan, Xiong Deyi. SCoMoE: Efficient mixtures of experts with structured communication[C] //Proc of the 11th Int Conf on Learning Representations. Amherst, MA: OpenReview. net, 2023: 1−23
[104] Kossmann F, Jia Zhihao, Aiken A. Optimizing mixture of experts using dynamic recompilations[J]. arXiv preprint, arXiv: 2205.01848, 2022
[105] Zheng Bojian, Jiang Ziheng, Yu C H, et al. DietCode: Automatic optimization for dynamic tensor programs[C/OL] //Proc of the 5th Machine Learning and Systems. 2022 [2024-08-02]. https://proceedings.mlsys.org/paper_files/paper/2022/file/f89b79c9a28d4cae22ef9e557d9fa191-Paper.pdf
[106] Zheng Zhen, Pan Zaifeng, Wang Dalin, et al. BladeDISC: Optimizing dynamic shape machine learning workloads via compiler approach[J]. Proceedings of ACM on Management of Data, 2023, 1(3): 1−29
[107] Chen Simin, Wei Shiyi, Liu Cong, et al. DyCL: Dynamic neural network compilation via program rewriting and graph optimization[C] //Proc of the 32nd ACM SIGSOFT Int Symp on Software Testing and Analysis. New York: ACM, 2023: 614−626
[108] Yu Feng, Li Guanglin, Zhao Jiacheng, et al. Optimizing dynamic-shape neural networks on accelerators via on-the-fly micro-kernel polymerization[C] //Proc of the 29th ACM Int Conf on Architectural Support for Programming Languages and Operating Systems. New York: ACM, 2024: 797−812
[109] He Jiaao, Qiu Jiezhong, Zeng Aohan, et al. FastMoE: A fast mixture-of-expert training system[J]. arXiv preprint, arXiv: 2103.13262, 2021
[110] Gale T, Narayanan D, Young C, et al. MegaBlocks: Efficient sparse training with mixture-of-experts[C/OL] //Proc of the 6th Machine Learning and Systems. 2023 [2024-08-02]. https://proceedings.mlsys.org/paper_files/paper/2023/file/5a54f79333768effe7e8927bcccffe40-Paper-mlsys2023.pdf
[111] Zheng Ningxin, Jiang Huiqiang, Zhang Quanlu, et al. PIT: Optimization of dynamic sparse deep learning models via permutation invariant transformation[C] //Proc of the 29th Symp on Operating Systems Principles. New York: ACM, 2023: 331−347
[112] Tan S, Shen Yikang, Panda R, et al. Scattered mixture-of-experts implementation[J]. arXiv preprint, arXiv: 2403.08245, 2024
[113] Nie Xiaonan, Miao Xupeng, Cao Shijie, et al. EvoMoE: An evolutional mixture-of-experts training framework via dense-to-sparse gate[J]. arXiv preprint, arXiv: 2112.14397, 2022
[114] Zhou Yanqi, Lei Tao, Liu Hanxiao, et al. Mixture-of-experts with expert choice routing[C] //Proc of the 36th Int Conf on Neural Information Processing Systems. New York: Curran Associates, 2022: 7103−7114
[115] Zeng Zhiyuan, Guo Qipeng, Fei Zhaoye, et al. Turn waste into worth: Rectifying top-k router of MoE[J]. arXiv preprint, arXiv: 2402.12399, 2024
[116] Lewis M, Bhosale S, Dettmers T, et al. Base layers: Simplifying training of large, sparse models[C] //Proc of the 38th Int Conf on Machine Learning. New York: PMLR, 2021: 6265−6274
[117] Clark A, Casas D D L, Guy A, et al. Unified scaling laws for routed language models[C] //Proc of the 39th Int Conf on Machine Learning. New York: PMLR, 2022: 4057−4086
[118] Liu Tianlin, Puigcerver J, Blondel M. Sparsity-constrained optimal transport[J]. arXiv preprint, arXiv: 2209.15466, 2023
[119] Roller S, Sukhbaatar S, szlam arthur, et al. Hash layers for large sparse models[C] //Proc of the 35th Int Conf on Neural Information Processing Systems. New York: Curran Associates, 2021: 17555−17566
[120] Zuo Simiao, Liu Xiaodong, Jiao Jian, et al. Taming sparsely activated transformer with stochastic experts[J]. arXiv preprint, arXiv: 2110.04260, 2022
[121] Puigcerver J, Riquelme C, Mustafa B, et al. From sparse to soft mixtures of experts[J]. arXiv preprint, arXiv: 2308.00951, 2023
[122] Yu Ping, Artetxe M, Ott M, et al. Efficient language modeling with sparse all-MLP[J]. arXiv preprint, arXiv: 2203.06850, 2022
[123] Muqeeth M, Liu Haokun, Raffel C. Soft merging of experts with adaptive routing[J]. arXiv preprint, arXiv: 2306.03745, 2023
[124] Hazimeh H, Zhao Zhe, Chowdhery A, et al. DSelect-k: Differentiable selection in the mixture of experts with applications to multi-task learning[C] //Proc of the 35th Int Conf on Neural Information Processing Systems. New York: Curran Associates, 2021: 29335−29347
[125] Ibrahim S, Chen W, Hazimeh H, et al. COMET: Learning cardinality constrained mixture of experts with trees and local search[C] //Proc of the 29th ACM SIGKDD Conf on Knowledge Discovery and Data Mining. New York: ACM, 2023: 832−844
[126] Zhai Mingshu, He Jiaao, Ma Zixuan, et al. SmartMoE: Efficiently training sparsely-activated models through combining offline and online parallelization[C] //Proc of the 2023 USENIX Annual Technical Conf. Berkeley, CA: USENIX Association, 2023: 961−975
[127] Nie Xiaonan, Miao Xupeng, Wang Zilong, et al. FlexMoE: scaling large-scale sparse pre-trained model training via dynamic device placement[J]. Proceedings of ACM on Management of Data, 2023, 1(1): 1−19
[128] Du Zhixu, Li Shiyu, Wu Yuhao, et al. SiDA: Sparsity-inspired data-aware serving for efficient and scalable large mixture-of-experts models[C/OL] //Proc of the 7th Machine Learning and Systems. 2024 [2024-08-02]. https://proceedings.mlsys.org/paper_files/paper/2024/file/698cfaf72a208aef2e78bcac55b74328-Paper-Conference.pdf
[129] Shazeer N, Cheng Youlong, Parmar N, et al. Mesh-Tensorflow: Deep learning for supercomputers[C] //Proc of the 32nd Int Conf on Neural Information Processing Systems. New York: Curran Associates, 2018: 10435−10444
[130] Samyam Rajbhandari, Rasley J, Ruwase O, et al. ZeRO: Memory optimizations toward training trillion parameter models[C/OL] //Proc of Int Conf for High Performance Computing, Networking, Storage and Analysis. Piscataway, NJ: IEEE, 2020 [2024-09-10]. https://dl.acm.org/ doi/abs/10.5555/3433701.3433727
[131] Kosson A, Chiley V, Venigalla A, et al. Pipelined backpropagation at scale: Training large models without batches[C/OL] //Proc of the 4th Machine Learning and Systems. 2021 [2024-08-02]. https://proceedings.mlsys.org/paper_files/paper/2021/file/0c8abcf158ed12d0dd94480681186fda-Paper.pdf
[132] Huang Yanping, Cheng Youlong, Bapna A, et al. GPipe: Efficient training of giant neural networks using pipeline parallelism[C] //Proc of the 33rd Int Conf on Neural Information Processing Systems. New York: Curran Associates, 2019: 103−112
[133] Narayanan D, Harlap A, Phanishayee A, et al. PipeDream: Generalized pipeline parallelism for dnn training[C/OL] //Proc of the 27th ACM Symp on Operating Systems Principles. New York: ACM, 2019 [2024-09-10]. https://dl.acm.org/doi/abs/10.1145/3341301.3359646
[134] Narayanan D, Phanishayee A, Shi Kaiyu, et al. Memory-efficient pipeline-parallel DNN training[C] //Proc of the 38th Int Conf on Machine Learning. New York: PMLR, 2021: 7937−7947
[135] Fu Yichao, Yuhao Qing, Zhao Shixiong, et al. AMPipe: Accelerating MoE model training with intra-block pipelining[EB/OL]. 2024 [2024-08-02]. https://openreview.net/pdf?id=yLgr02IsXY
[136] Jiang Chenyu, Tian Ye, Jia Zhen, et al. Lancet: Accelerating mixture-of-experts training via whole graph computation-communication overlapping[J]. arXiv preprint, arXiv: 2404.19429, 2024
[137] Shi Shaohuai, Pan Xinglin, Chu Xiaowen, et al. PipeMoE: Accelerating mixture-of-experts through adaptive pipelining[C/OL] //Proc of the 2023 IEEE Conf on Computer Communications. Piscataway, NJ: IEEE, 2023 [2024-09-10]. https://ieeexplore.ieee.org/abstract/document/10228874
[138] Aminabadi R Y, Rajbhandari S, Awan A A, et al. DeepSpeed-Inference: Enabling efficient inference of transformer models at unprecedented scale[C/OL] //Proc of Int Conf for High Performance Computing, Networking, Storage and Analysis. New York: ACM, 2022 [2024-09-10]. https://dl.acm.org/doi/abs/10.5555/3571885.3571946
[139] Valiant L G. A bridging model for parallel computation[J]. Communications of the ACM, 1990, 33(8): 103−111 doi: 10.1145/79173.79181
[140] Narayanan D, Shoeybi M, Casper J, et al. Efficient large-scale language model training on GPU clusters using Megatron-LM[C/OL] //Proc of Int Conf for High Performance Computing, Networking, Storage and Analysis. New York: ACM, 2021 [2024-09-10]. https://dl.acm.org/doi/ abs/10.1145/3458817.3476209
[141] Wang Guanhua, Qin Heyang, Jacobs S A, et al. ZeRO++: Extremely efficient collective communication for giant model training[J]. arXiv preprint, arXiv: 2306.10209, 2023
[142] Rajbhandari S, Ruwase O, Rasley J, et al. ZeRO-infinity: Breaking the GPU memory wall for extreme scale deep learning[C/OL] //Proc of Int Conf for High Performance Computing, Networking, Storage and Analysis. New York: ACM, 2021 [2024-09-10]. https://dl.acm.org/doi/ abs/10.1145/3458817.3476205
[143] Jia Zhihao, Lin S, Qi C R, et al. Exploring hidden dimensions in parallelizing convolutional neural networks[C] // Proc of the 35th Int Conf on Machine Learning. New York: PMLR, 2018: 2279−2288
[144] Zheng Lianmin, Li Zhuohan, Zhang Hao, et al. Alpa: Automating inter-and intra-operator parallelism for distributed deep learning[C] //Proc of the 16th USENIX Symp on Operating Systems Design and Implementation. Berkeley, CA: USENIX Association, 2022: 559−578
[145] Li Zhuohan, Zheng Lianmin, Zhong Yinmin, et al. AlpaServe: Statistical multiplexing with model parallelism for deep learning serving[C] //Proc of the 17th USENIX Symp on Operating Systems Design and Implementation. Berkeley, CA: USENIX Association, 2023: 663−679
[146] Jia Zhihao, Zaharia M, Aiken A. Beyond data and model parallelism for deep neural networks[C/OL] //Proc of the 2nd Machine Learning and Systems. 2019 [2024-08-02]. https://proceedings.mlsys.org/paper_files/paper/2019/file/b422680f3db0986ddd7f8f126baaf0fa-Paper.pdf
[147] Artetxe M, Bhosale S, Goyal N, et al. Efficient large scale language modeling with mixtures of experts[J]. arXiv preprint, arXiv: 2112.10684, 2022
[148] Zhao Yanli, Gu A, Varma R, et al. Pytorch FSDP: Experiences on scaling fully sharded data parallel[J]. arXiv preprint, arXiv: 2304.11277, 2023