Research研究

UNICOM & MLCD

Cluster discrimination for visual representation learning用聚类判别学习视觉表征

Two papers, one idea: cluster LAION-400M once into a million pseudo-classes with CLIP features, then train the vision encoder to classify each image into its classes instead of matching it against its own caption. UNICOM (ICLR 2023) gives every image one class and samples 10% of the negative classes to cope with conflicting labels. MLCD (ECCV 2024) gives every image its eight nearest classes and splits the loss into a positive and a negative term. On the same LAION-400M data, MLCD’s ViT-L/14 beats OpenCLIP on 25 of 26 linear-probe datasets and UNICOM on 23.

两篇论文,同一个思路:先用 CLIP 特征把 LAION-400M 一次性聚成一百万个伪类,再训练视觉编码器把每张图分到它所属的类,而不是只和它自己的文本配对。UNICOM(ICLR 2023)给每张图一个类别,每步只采样 10% 的负类,以应对相互冲突的标签。MLCD(ECCV 2024)给每张图最近的 8 个类别,并把损失拆成正类项和负类项。在同样的 LAION-400M 数据上,MLCD 的 ViT-L/14 在 26 个线性探测数据集中有 25 个超过 OpenCLIP,23 个超过 UNICOM。

Why cluster discrimination为什么用聚类判别

CLIP learns by instance discrimination: an image is pulled towards its own caption and pushed away from every other image in the batch, even one that shows the same thing. Two wedding photos become a negative pair, and the semantic structure of the data never enters the encoder. UNICOM and MLCD use cluster discrimination instead. They cluster the training set once, offline, and then train the encoder to classify each image into its clusters, so images with the same content share a class and move together (Figure 1).

CLIP 用实例判别来学习:一张图被拉向它自己的文本,同时被推离同一批次里的其他所有图像,哪怕那张图画的是同样的内容。两张婚礼照片因此成了负样本对,数据中的语义结构进不了编码器。UNICOM 和 MLCD 改用聚类判别:先离线把训练集聚类一次,再训练编码器把每张图分到它所属的类,内容相同的图像落在同一类、一起靠近(图 1)。

CLIP: the only positive is the image’s own caption; every other image in the batch is a negative.CLIP:唯一的正样本是图像自己的文本,同一批次里的其他图像都是负样本。

Figure 1. One training image under the three objectives. CLIP contrasts it with its own caption and treats every other image as a negative, another wedding photo included. UNICOM assigns it the nearest of one million k-means classes, so both wedding photos share a class. MLCD keeps its eight nearest classes as positives and trains with separate positive and negative terms; sᵢ and sⱼ are cosine similarities to positive and negative class centres. The images and the caption are from Figure 2 of the MLCD paper; class names and positions are illustrative.图 1. 同一张训练图像在三种目标下的处理方式。CLIP 只把它和自己的文本配对,其他图像都算负样本,另一张婚礼照片也不例外。UNICOM 把它分到一百万个 k-means 类中最近的一类,两张婚礼照片于是同属一类。MLCD 把最近的 8 个类都当作正类,并用分开的正类项和负类项训练;sᵢ、sⱼ 是与正类、负类中心的余弦相似度。图像与文本取自 MLCD 论文图 2,类别名称与位置仅作示意。

UNICOM: one class per imageUNICOM:每张图一个类别

UNICOM averages the CLIP image and text features of each LAION-400M sample and runs k-means once. With feature quantization the whole dataset clusters in about ten minutes, into one million classes of roughly 400 images each. Classes found this way conflict: a pair of birds lands in a wedding-couple class, and close-ups of wedding flowers also turn up in a wedding-venue class, because one image carries several labels and the granularity of a class is arbitrary.

UNICOM 对每个 LAION-400M 样本取 CLIP 图像特征与文本特征的平均,只做一次 k-means。借助特征量化,整个数据集约十分钟即可聚完,得到一百万个类,每类约 400 张图。这样聚出的类别彼此冲突:一对鸟被分进“新人合影”类,婚礼鲜花的特写也出现在“婚礼场地”类中,原因是一张图常带有多个标签,类别的粒度也没有统一标准。

Two random selections let the classifier train on such labels (Figure 2). At each step the margin-based softmax (ArcFace, margin 0.3, scale 64) sees the positive class and a random 10% of the other class prototypes, so a conflicting class is ten times less likely to push the image away. A second selection keeps a random subset of the feature dimensions, the same subset for the whole mini-batch and for both the embeddings and the prototypes. Unlike Dropout, this trains each sub-space of the embedding on its own, which keeps short descriptors useful for retrieval: on CUB, after one extra epoch at r₂ = 0.5, UNICOM beats the unsupervised retrieval method STML at every length from 256 down to 32 dimensions, although STML trains on CUB and UNICOM does not.

两次随机选择让分类器能在这样的标签上训练(图 2)。每一步,带间隔的 softmax(ArcFace,间隔 0.3,尺度 64)只看到正类和随机 10% 的其他类原型,冲突类把图像推开的概率因此降为十分之一。第二次选择随机保留一部分特征维度,整个 mini-batch 共用同一组维度,嵌入和原型同时截取。与 Dropout 不同,这样嵌入的每个子空间都单独得到训练,短描述子依然适合检索:在 CUB 上,用 r₂ = 0.5 多训练一个 epoch 后,UNICOM 在 256 到 32 维的每个长度上都超过无监督检索方法 STML,尽管 STML 在 CUB 上训练过,UNICOM 没有。

UNICOM: CLIP image and text features clustered by k-means; the prototype matrix of k classes and d features, from which k′ classes and d′ features are randomly selected for a margin-based softmax loss
Figure 2. UNICOM, from the paper. Left: CLIP image and text features clustered offline by k-means. Right: the prototype matrix keeps all k classes and d feature dimensions, but each step builds the margin-based softmax from k′ randomly selected classes and d′ randomly selected dimensions.图 2. UNICOM(取自论文)。左:CLIP 图像与文本特征离线做 k-means 聚类。右:原型矩阵保留全部 k 个类和 d 维特征,但每一步只用随机选出的 k′ 个类和 d′ 维特征构造带间隔的 softmax。
Loss损失
L = −log exp((Γt⊙wy)T(Γt⊙e)) / Σj∈S exp((Γt⊙wj)T(Γt⊙e))
Classes类别
S: the positive class and random negatives, |S| = k·r₁, k = 1M, r₁ = 0.1S:正类加随机负类,|S| = k·r₁,k = 1M,r₁ = 0.1
Features特征
Γt ∈ {0,1}d with a fraction r₂ of ones, one mask per stepΓt ∈ {0,1}d,其中比例 r₂ 为 1,每步一个掩码
Ablations: clustering features, class count and random selection (Tables 1, 2)消融:聚类特征、类别数与随机选择(表 1、表 2)

Joint image–text features cluster better than either alone, and one million classes beat 100K and 10M. Sampling 10% of the negative classes adds 7.8 points of linear-probe accuracy over using all of them (85.7 vs 77.9). A feature ratio r₂ = 0.5 adds 0.4 to 256-d retrieval (61.8 vs 61.4), while Dropout lowers it.

图文联合特征的聚类效果好于单用图像或文本,一百万类好于十万类和一千万类。只采样 10% 的负类,比使用全部负类的线性探测高 7.8 分(85.7 对 77.9)。特征比例 r₂ = 0.5 让 256 维检索提高 0.4(61.8 对 61.4),Dropout 则让它下降。

Table 1Which features to cluster, and how many classes (ViT-B/32 on LAION-400M). Each cell averages the 13 linear-probe datasets of Table 6 or the 7 retrieval benchmarks of Table 5; blue marks the best in each row.表 1用什么特征聚类、聚成多少类(ViT-B/32,LAION-400M)。每格是表 6 中 13 个线性探测数据集或表 5 中 7 个检索基准的平均;蓝色为每行最佳。

Task任务Clustered with CLIP用 CLIP 聚类Clustered with OpenCLIP用 OpenCLIP 聚类Classes (CLIP, joint)类别数(CLIP 图文)
Image图像Text文本Joint图文Image图像Text文本Joint图文100K1M10M
Linear probe线性探测84.485.385.783.984.084.175.985.783.6
Unsupervised retrieval无监督检索61.862.362.858.960.161.153.262.860.7

Table 2Random class and feature selection against Dropout (ViT-B/32, averages as in Table 1). r₁ = 0.1 and r₂ = 1.0 are the same model; the last row retrieves with 256-d instead of the full 512-d descriptors. Blue marks the best in each row.表 2随机类别选择、随机特征选择与 Dropout 的对比(ViT-B/32,平均方式同表 1)。r₁ = 0.1 与 r₂ = 1.0 是同一个模型;最后一行用 256 维而不是完整的 512 维描述子检索。蓝色为每行最佳。

Task任务Class ratio r₁类别比例 r₁Feature ratio r₂特征比例 r₂Dropout r₃Dropout r₃
0.050.10.31.01.00.50.250.250.5
Linear probe线性探测85.185.784.977.985.785.584.285.485.1
Unsupervised retrieval无监督检索62.362.862.155.962.862.762.062.562.3
Unsupervised retrieval, 256-d无监督检索,256 维––––61.461.861.060.760.1

MLCD: several classes per imageMLCD:每张图多个类别

One pseudo-label rarely covers a web image. The wedding photo in Figure 3 shows a couple, white roses and a gown, while its caption names only the gowns. MLCD keeps UNICOM’s clustering, one million classes from CLIP ViT-L/14 features of LAION-400M, but ranks all class centres by similarity to each image and keeps the eight closest as positives. Every other class is a negative, and a random 10% of them enter each step.

一个伪标签很难概括一张网络图片。图 3 中的婚礼照片里有一对新人、白玫瑰和婚纱,而它的文本只提到婚纱。MLCD 沿用 UNICOM 的聚类,即用 CLIP ViT-L/14 特征把 LAION-400M 聚成一百万类,但会把所有类中心按与图像的相似度排序,取最近的 8 个作为正类。其余类都是负类,每一步随机取其中 10% 参与计算。

Three LAION-400M images with their captions and four examples from each of their three nearest classes: healthy food, a wedding and a strawberry cake
Figure 3. Images from the clustered LAION-400M with their captions and examples from each image’s three nearest classes, from the MLCD paper. One image holds several visual elements, so a single class cannot cover it.图 3. 聚类后的 LAION-400M 中的图像、其文本,以及每张图最近的三个类别中的样例(取自 MLCD 论文)。一张图包含多个视觉元素,单个类别无法概括。

The loss follows Circle loss. A plain multi-label loss (MLC) only shrinks every gap sⱼ − sᵢ between a negative and a positive similarity, which leaves the decision boundary ambiguous: the pairs {sⱼ, sᵢ} = {0.1, 0.4} and {0.5, 0.8} meet the same margin of 0.3, yet the second pair’s negative scores higher than the first pair’s positive. MLCD adds one term that raises every sᵢ and one that lowers every sⱼ, and the loss then splits into a positive part and a negative part. In the paper’s training curves, MLCD’s mean similarity to positive class centres rises well above MLC’s, while its mean similarity to negative centres stays near zero.

损失函数参照 Circle loss。普通的多标签损失(MLC)只缩小每一对负类与正类相似度之差 sⱼ − sᵢ,决策边界因此含糊:{sⱼ, sᵢ} = {0.1, 0.4} 与 {0.5, 0.8} 都满足 0.3 的间隔,但第二组的负类比第一组的正类得分还高。MLCD 再加两项,一项抬高每个 sᵢ,一项压低每个 sⱼ,损失于是分成正类和负类两部分。论文给出的训练曲线显示,MLCD 与正类中心的平均相似度明显高于 MLC,与负类中心的平均相似度则保持在 0 附近。

MLC
L = log(1 + Σj∈Ω′n esj · Σi∈Ωp e−si)
MLCD
L = log(1 + Σi∈Ωp e−si) + log(1 + Σj∈Ω′n esj)
Sets集合
Ωp: the 8 nearest class centres · Ω′n: a random 10% of the other centresΩp:最近的 8 个类中心 · Ω′n:其余类中心中随机取 10%
Ablations: classes, negative sampling, positives per image and the split loss (Tables 3, 4)消融:类别数、负类采样、每张图的正类数与拆分损失(表 3、表 4)

One million classes, a 10% negative sample and eight positives per image work best. More positives add noisy labels: 16 drops to 72.1 and 32 to 68.7. Choosing positives by a similarity threshold, so that each image gets a different number, peaks at 73.3, below the fixed eight (75.2). The split loss improves on MLC in all three ImageNet settings.

一百万类、10% 的负类采样、每张图 8 个正类效果最好。正类再多就会引入噪声标签:16 个降到 72.1,32 个降到 68.7。按相似度阈值选正类(每张图的正类数不同),最好只有 73.3,低于固定的 8 个(75.2)。拆分后的损失在 ImageNet 的三种设置下都优于 MLC。

Table 3MLCD ablations: ViT-B/32 trained on LAION-400M for 5 epochs, ImageNet linear-probe top-1 %. The last block picks positives by a similarity threshold instead of a fixed count. Blue marks the paper’s best setting.表 3MLCD 消融:ViT-B/32 在 LAION-400M 上训练 5 个 epoch,ImageNet 线性探测 top-1 %。最后一组按相似度阈值而不是固定数量选正类。蓝色为论文中的最佳设置。

Classes类别数100K200K500K1M2M5M
ImageNet linear probeImageNet 线性探测66.971.174.475.274.974.7
Negative ratio r负类比例 r0.010.050.10.20.51.0
ImageNet linear probeImageNet 线性探测73.475.175.274.968.363.2
Positives per image每张图的正类数12481632
ImageNet linear probeImageNet 线性探测71.472.973.275.272.168.7
Similarity threshold相似度阈值0.950.930.910.890.870.85
ImageNet linear probeImageNet 线性探测72.272.773.372.468.763.2

Table 4The plain multi-label loss (MLC) against MLCD’s split loss on ImageNet: ViT-B/32 trained on LAION-400M for 32 epochs, both with 10% negative sampling.表 4普通多标签损失(MLC)与 MLCD 拆分损失在 ImageNet 上的对比:ViT-B/32 在 LAION-400M 上训练 32 个 epoch,两者都采样 10% 的负类。

Loss损失Fine-tune微调Linear probe线性探测Zero-shot零样本
MLC80.976.963.9
MLCD81.278.164.5

Results结果

UNICOM: retrieval and linear probingUNICOM:检索与线性探测

UNICOM’s encoders are trained from scratch for 32 epochs on the clustered LAION-400M. Its ViT-L/14 averages 69.9 on seven unsupervised retrieval benchmarks, 7.5 points above OpenCLIP’s ViT-L/14 and 5.4 above OpenCLIP’s larger ViT-H/14 (Table 5). In linear probing on 13 datasets it is ahead of OpenCLIP, trained on the same data, by 3.6, 2.7 and 1.4 points on average for ViT-B/32, B/16 and L/14 (Table 6). Fine-tuned for retrieval, its largest model is above the best earlier result on all ten metrics of Table 7, results that come from various backbones. Fine-tuned on ImageNet-1K, its ViT-L/14 reaches 88.3, above ViT-L/16 pre-trained on JFT-300M (87.8) or IG-3.6B (88.1) (Table 8).

UNICOM 的编码器在聚类后的 LAION-400M 上从零训练 32 个 epoch。它的 ViT-L/14 在 7 个无监督检索基准上平均 69.9,比 OpenCLIP 的 ViT-L/14 高 7.5,比更大的 OpenCLIP ViT-H/14 还高 5.4(表 5)。在 13 个数据集的线性探测上,它平均领先使用相同数据的 OpenCLIP:ViT-B/32、B/16、L/14 分别高 3.6、2.7、1.4(表 6)。为检索微调后,它最大的模型在表 7 的十项指标上都超过此前最好的结果,这些结果来自各不相同的骨干网络。在 ImageNet-1K 上微调后,它的 ViT-L/14 达到 88.3,超过在 JFT-300M(87.8)或 IG-3.6B(88.1)上预训练的 ViT-L/16(表 8)。

Table 5Unsupervised image retrieval with the frozen pre-trained encoders: Recall@1, mAP@100 on GLDv2. UNICOM rows shaded; blue marks the best score in each column.表 5冻结预训练编码器的无监督图像检索:Recall@1,GLDv2 为 mAP@100。UNICOM 行加底色,蓝色为每列最佳。

Backbone骨干CUBCarsSOPIn-ShopiNaturalistVehicleIDGLDv2Avg.平均
Small小Medium中Large大Private私有Public公开
CLIP (WIT-400M)
ViT-B/3256.779.060.545.453.054.852.244.67.57.546.1
ViT-B/1666.185.263.256.163.155.150.943.88.410.650.3
ViT-L/1476.090.365.662.972.962.458.951.812.113.656.7
ViT-L/14-33677.390.967.866.376.864.160.353.817.015.659.0
OpenCLIP (LAION-400M)
ViT-B/3262.389.265.964.654.971.067.159.99.178.455.2
ViT-B/1671.492.968.774.264.173.370.163.712.111.060.2
ViT-L/1479.494.970.677.171.072.069.162.014.513.862.4
ViT-H/1483.195.772.778.877.072.769.761.917.715.364.5
UNICOM (LAION-400M)
ViT-B/3283.795.970.072.864.674.972.065.415.113.362.8
ViT-B/1686.596.870.474.673.674.570.658.718.717.264.2
ViT-L/1488.596.972.783.677.183.780.274.621.120.169.9
ViT-L/14-33689.297.374.586.781.084.181.475.623.222.071.5

Table 6Linear probe on 13 image classification datasets, top-1 %. -336: one extra epoch at 336 px. UNICOM rows shaded; blue marks the best score in each column.表 613 个图像分类数据集上的线性探测,top-1 %。-336 表示在 336 px 下多训练一个 epoch。UNICOM 行加底色,蓝色为每列最佳。

Backbone骨干CIFAR-10CIFAR-100Caltech-101CarsFlowersFood-101BirdsnapSUN397DTDAircraftPetsEuroSATImageNetAvg.平均
CLIP (WIT-400M)
ViT-B/3295.180.593.081.896.988.858.576.676.552.090.097.076.181.8
ViT-B/1696.283.194.786.798.192.867.878.479.259.593.197.180.285.1
ViT-L/1498.087.596.590.999.295.277.081.882.169.495.198.283.988.8
ViT-L/14-33697.987.496.091.599.295.979.982.283.071.695.198.185.489.5
CLIP-R: public CLIP re-tested in the UNICOM code baseCLIP-R:公开的 CLIP 模型在 UNICOM 代码中重测
ViT-B/3296.082.594.186.097.892.761.179.178.458.993.095.375.383.9
ViT-B/1696.082.594.186.097.892.769.579.178.458.993.095.379.684.8
ViT-L/1498.187.296.090.799.295.377.881.580.968.094.996.784.188.5
ViT-L/14-33697.887.196.391.499.295.980.982.282.471.295.196.884.989.3
OpenCLIP (LAION-400M)
ViT-B/3295.382.293.387.596.586.261.475.378.852.488.096.573.882.1
ViT-B/1696.484.094.191.898.190.771.278.781.659.390.096.278.585.4
ViT-L/1497.987.995.593.698.893.378.081.083.064.493.397.181.588.1
UNICOM (LAION-400M)
ViT-B/3296.886.694.693.398.585.870.274.678.070.793.196.875.085.7
ViT-B/1697.387.795.194.398.991.279.377.181.273.493.997.079.188.1
ViT-L/1498.590.895.794.699.393.482.480.082.274.594.296.781.889.5
ViT-L/14-33698.590.795.795.199.494.385.179.782.078.194.597.282.790.2

Table 7Supervised image retrieval after fine-tuning UNICOM on each benchmark (Recall@1; mAP@100 on GLDv2), against the best earlier result, which uses its own backbone. Blue marks the best score in each row.表 7在各基准上微调 UNICOM 后的有监督图像检索(Recall@1,GLDv2 为 mAP@100),对比此前最好的结果(各自使用不同骨干)。蓝色为每行最佳。

Benchmark基准ViT-B/32ViT-B/16ViT-L/14ViT-L/14-336Previous best此前最佳
CUB85.888.889.790.185.6ViT-S/16 · Ermolov et al. 2022
Cars97.397.797.998.294.8SE-ResNet-50 · Jun et al. 2019
SOP87.188.889.991.288.0ViT-B/16 · Patel et al. 2022
In-Shop94.895.596.096.792.7ViT-S/16 · Ermolov et al. 2022
iNaturalist72.882.585.488.983.9ViT-B/16 · Patel et al. 2022
VehicleID-Small95.496.496.597.096.2ViT-B/16 · Patel et al. 2022
VehicleID-Medium94.195.195.796.195.2ViT-B/16 · Patel et al. 2022
VehicleID-Large93.695.095.496.094.7ViT-B/16 · Patel et al. 2022
GLDv2-Private32.635.736.136.432.5ResNet101 · Lee et al. 2022
GLDv2-Public29.732.433.033.124.6ResNet50 · Tan et al. 2021

Table 8Fine-tuned on ImageNet-1K after pre-training on the listed data. UNICOM rows shaded.表 8在所列数据上预训练后,于 ImageNet-1K 微调的结果。UNICOM 行加底色。

Model模型Pre-training data预训练数据Pre-train res.预训练分辨率Fine-tune res.微调分辨率ImageNet-1K top-1ImageNet-1K top-1FLOPs (B)FLOPs (B)
Supervised pre-training有监督预训练
ViT-L/32Dosovitskiy et al. 2021ImageNet-21K22438481.354.4
ViT-B/16Dosovitskiy et al. 2021ImageNet-21K22438484.055.6
ViT-L/16Dosovitskiy et al. 2021ImageNet-21K22438485.2191.5
ViT-L/16Dosovitskiy et al. 2021JFT-300M22451287.8362.9
ViT-L/16Zhai et al. 2022JFT-3B22438488.5191.5
Weakly supervised pre-training弱监督预训练
ViT-B/16Singh et al. 2022IG-3.6B22438485.355.6
ViT-L/16Singh et al. 2022IG-3.6B22451288.1362.9
OpenCLIP ViT-B/32LAION-400M22438483.015.5
OpenCLIP ViT-B/16LAION-400M22438485.455.6
OpenCLIP ViT-L/14LAION-400M22451887.7507.8
UNICOM ViT-B/32LAION-400M22438483.615.5
UNICOM ViT-B/16LAION-400M22438485.955.6
UNICOM ViT-L/14LAION-400M22451888.3507.8

MLCD: against CLIP, OpenCLIP, FLIP and UNICOMMLCD:对比 CLIP、OpenCLIP、FLIP 与 UNICOM

MLCD’s ViT-L/14 is trained for 32 epochs on LAION-400M; for zero-shot tasks a text encoder is then trained against the frozen image encoder (LiT). Over 26 linear-probe datasets it averages 84.6, against 82.3 for OpenCLIP and 83.3 for UNICOM on the same data and 83.5 for CLIP reproduced on WIT-400M; it is ahead of OpenCLIP on 25 datasets and of UNICOM on 23 (Figure 4). Over 25 zero-shot datasets it averages 67.5, against 66.0 for FLIP and 63.6 for OpenCLIP; it is ahead of OpenCLIP on 23 and of FLIP on 15 (Table 9). In zero-shot retrieval it ties FLIP on Flickr30k text R@1 and is best on every other metric except Flickr30k text R@5 and R@10 (Table 10). On ImageNet it reaches 87.1 fine-tuned, 84.6 linear and 75.6 zero-shot, and it is the most robust LAION-400M model on four of the five shifted test sets; FLIP stays ahead on ImageNet-R (Table 11).

MLCD 的 ViT-L/14 在 LAION-400M 上训练 32 个 epoch;零样本任务所需的文本编码器随后在冻结的图像编码器上训练(LiT)。在 26 个线性探测数据集上,它平均 84.6,相同数据下 OpenCLIP 为 82.3、UNICOM 为 83.3,在 WIT-400M 上复现的 CLIP 为 83.5;它在 25 个数据集上领先 OpenCLIP,在 23 个上领先 UNICOM(图 4)。在 25 个零样本数据集上,它平均 67.5,FLIP 为 66.0,OpenCLIP 为 63.6;其中 23 个领先 OpenCLIP,15 个领先 FLIP(表 9)。零样本检索中,它在 Flickr30k 文本检索 R@1 上与 FLIP 持平,除 Flickr30k 文本检索的 R@5、R@10 外其余指标都最好(表 10)。在 ImageNet 上,它的微调、线性探测和零样本结果分别为 87.1、84.6、75.6,五个分布偏移测试集中有四个是 LAION-400M 模型里最鲁棒的,ImageNet-R 上 FLIP 仍领先(表 11)。

Figure 4. MLCD minus a baseline on each dataset of Table 9, all ViT-L/14 trained on LAION-400M: UNICOM (single-label cluster discrimination) on 26 linear-probe datasets, and OpenCLIP (instance discrimination) on the same 26 and on 25 zero-shot datasets. Blue: MLCD ahead; red: behind; grey: tied. Each view has its own scale. Redrawn from Figure 4 of the MLCD paper.图 4. 在表 9 的每个数据集上,MLCD 减去基线的分数,均为在 LAION-400M 上训练的 ViT-L/14:基线为 UNICOM(单标签聚类判别,26 个线性探测数据集),以及 OpenCLIP(实例判别,同样 26 个线性探测数据集和 25 个零样本数据集)。蓝色表示 MLCD 领先,红色表示落后,灰色表示持平。每个视图的比例尺各自独立。据 MLCD 论文图 4 重绘。

Table 9ViT-L/14 on 26 linear-probe and 25 zero-shot datasets (FER2013 has no zero-shot score). CLIP is trained on WIT-400M, all others on LAION-400M. †: from the CLIP paper; ‡: reproduced by the MLCD authors; §: from the FLIP paper. Blue marks the best LAION-400M model in each group, as in the paper.表 9ViT-L/14 在 26 个线性探测数据集和 25 个零样本数据集上的结果(FER2013 没有零样本分数)。CLIP 在 WIT-400M 上训练,其余都在 LAION-400M 上训练。†:取自 CLIP 论文;‡:MLCD 作者复现;§:取自 FLIP 论文。蓝色为每组中最好的 LAION-400M 模型,与论文标注一致。

Dataset数据集Linear probe线性探测Zero-shot零样本
CLIP†CLIP‡OpenCLIP‡UNICOMMLCDCLIP†CLIP§OpenCLIP§FLIP§MLCD
Food-10195.295.393.393.494.392.991.087.489.390.3
CIFAR-1098.098.197.998.598.996.295.294.197.295.3
CIFAR-10087.587.287.990.892.077.975.677.184.183.7
Birdsnap77.077.878.082.483.448.351.261.363.062.9
SUN39781.881.581.080.082.167.766.670.773.172.1
Cars90.990.793.694.694.877.375.086.290.790.1
Aircraft69.468.064.474.579.636.132.321.829.139.4
VOC200789.689.791.791.492.584.183.383.583.184.5
DTD82.180.983.082.284.655.355.054.960.462.3
Pets95.194.993.394.295.393.593.690.892.693.7
Caltech-10196.596.095.595.797.292.692.494.093.893.9
Flowers99.299.298.899.399.378.777.772.175.079.4
MNIST99.299.299.299.299.387.276.071.580.378.5
FER201372.272.366.568.772.4–––––
STL-1099.899.899.298.599.399.399.398.298.599.1
EuroSAT98.296.797.196.799.159.962.053.353.559.7
RESISC4594.194.592.492.694.771.671.667.770.869.9
GTSRB92.592.992.592.792.550.351.647.341.450.7
KITTI64.765.977.577.878.223.126.929.334.828.7
Country21142.941.932.533.434.532.730.921.623.127.9
PCAM85.885.384.385.486.058.851.651.150.353.7
UCF10191.591.088.187.490.076.276.171.374.175.7
Kinetics-70072.070.664.066.768.560.359.550.555.857.7
CLEVR57.859.659.860.360.124.322.222.022.722.2
Hateful Memes76.261.857.657.457.963.355.355.354.058.4
SST-280.879.871.972.473.464.067.357.158.557.9
Average平均84.283.582.383.384.666.965.663.666.067.5

Table 10Zero-shot image–text retrieval on the Flickr30k and MSCOCO test splits, ViT-L/14. §: from the FLIP paper. Blue marks the best LAION-400M model in each column, as in the paper.表 10Flickr30k 与 MSCOCO 测试集上的零样本图文检索,ViT-L/14。§:取自 FLIP 论文。蓝色为每列中最好的 LAION-400M 模型,与论文标注一致。

Model模型Data数据Text retrieval文本检索Image retrieval图像检索
Flickr30kMSCOCOFlickr30kMSCOCO
R@1R@5R@10R@1R@5R@10R@1R@5R@10R@1R@5R@10
CLIP§WIT-400M87.899.199.856.279.886.469.390.294.035.860.770.7
OpenCLIP§LAION-400M87.397.999.158.080.688.172.090.895.041.366.676.1
FLIP§LAION-400M89.198.599.660.282.689.975.492.595.944.269.278.4
MLCDLAION-400M89.198.499.560.883.291.375.993.196.844.569.679.9

Table 11ImageNet under fine-tuning, linear probe and zero-shot, and zero-shot robustness on five shifted test sets, ViT-L/14. §: from the FLIP paper. Blue marks the best LAION-400M model in each column, as in the paper.表 11ImageNet 上的微调、线性探测和零样本结果,以及五个分布偏移测试集上的零样本鲁棒性,ViT-L/14。§:取自 FLIP 论文。蓝色为每列中最好的 LAION-400M 模型,与论文标注一致。

Model模型Data数据ImageNetZero-shot robustness零样本鲁棒性
Fine-tune微调Linear probe线性探测Zero-shot零样本IN-V2IN-AIN-RObjectNetIN-Sketch
CLIP§WIT-400M–83.975.369.571.986.868.658.5
OpenCLIP§LAION-400M86.282.172.864.048.384.358.856.9
FLIP§LAION-400M––74.666.851.286.559.159.9
MLCDLAION-400M87.184.675.668.956.485.162.760.4
Single- against multi-label on LAION-400M and COYO-700M, ViT-B/32 (Table 12)单标签与多标签在 LAION-400M 和 COYO-700M 上的对比,ViT-B/32(表 12)

With ViT-B/32, MLCD beats UNICOM by 2.2 points on LAION-400M (81.4 vs 79.2) and by 1.6 on COYO-700M (82.9 vs 81.3), averaged over 26 linear-probe datasets. COYO-700M helps action recognition: with MLCD, Kinetics-700 rises from 60.9 to 64.2.

使用 ViT-B/32 时,在 26 个线性探测数据集上平均,MLCD 在 LAION-400M 上比 UNICOM 高 2.2(81.4 对 79.2),在 COYO-700M 上高 1.6(82.9 对 81.3)。COYO-700M 有助于动作识别:使用 MLCD 时,Kinetics-700 从 60.9 升到 64.2。

Table 12Single-label (UNICOM) against multi-label (MLCD) cluster discrimination on two pre-training sets, ViT-B/32, linear probe on 26 datasets. Blue marks the better of the two on each dataset, as in the paper.表 12单标签(UNICOM)与多标签(MLCD)聚类判别在两个预训练数据集上的对比,ViT-B/32,26 个数据集的线性探测。蓝色为每个数据集上两者中较好的一个,与论文标注一致。

Dataset数据集LAION-400MCOYO-700M
UNICOMMLCDUNICOMMLCD
Food-10185.887.888.190.2
CIFAR-1096.897.595.496.9
CIFAR-10086.688.285.886.8
Birdsnap70.272.471.472.1
SUN39774.677.676.677.4
Cars93.393.893.193.5
Aircraft70.771.472.774.7
VOC200788.391.988.190.4
DTD78.080.481.783.5
Pets93.193.293.393.6
Caltech-10194.696.995.697.7
Flowers98.598.897.598.8
MNIST98.799.399.399.3
FER201364.366.470.370.9
STL-1097.898.698.799.1
EuroSAT96.898.697.899.0
RESISC4590.692.191.592.7
GTSRB90.090.589.990.1
KITTI76.477.776.777.5
Country21122.530.930.433.7
PCAM82.983.482.184.4
UCF10184.286.386.387.5
Kinetics-70057.260.961.864.2
CLEVR52.654.157.459.2
Hateful Memes52.457.964.368.4
SST-262.170.469.173.4
Average平均79.281.481.382.9

As the vision tower of LLaVA-1.5, an MLCD ViT-L/14 pre-trained on LAION-400M and COYO-700M, then trained one more epoch at 336 px, replaces CLIP ViT-L/14 under the LLaVA-1.5 recipe. With Qwen2-7B it is better on 12 of the 18 scores, with one tie; with Qwen2-72B it is better on 15 (Table 13). It loses on the OCR-heavy TextVQA and AI2D with both language models, which the paper plans to address by adding OCR models to the clustering.

作为 LLaVA-1.5 的视觉编码器,在 LAION-400M 与 COYO-700M 上预训练、再在 336 px 下训练一个 epoch 的 MLCD ViT-L/14,按 LLaVA-1.5 的流程替换 CLIP ViT-L/14。搭配 Qwen2-7B 时,它在 18 项分数中有 12 项更好、1 项持平;搭配 Qwen2-72B 时有 15 项更好(表 13)。两种语言模型下,它在偏重 OCR 的 TextVQA 和 AI2D 上都落后,论文计划在聚类时加入 OCR 模型来弥补。

Table 13CLIP ViT-L/14 against MLCD ViT-L/14 (pre-trained on LAION-400M and COYO-700M) as the vision tower of LLaVA-1.5, with the LLaVA-1.5 settings and two Qwen2 language models. TVQA is TextVQA. Blue marks the better tower for each language model, as in the paper.表 13以 CLIP ViT-L/14 和 MLCD ViT-L/14(在 LAION-400M 与 COYO-700M 上预训练)作为 LLaVA-1.5 的视觉编码器,沿用 LLaVA-1.5 的设置,搭配两个 Qwen2 语言模型。TVQA 即 TextVQA。蓝色为每个语言模型下较好的视觉编码器,与论文标注一致。

Benchmark基准Qwen2-7BQwen2-72B
CLIPMLCDCLIPMLCD
VQAv2val77.9978.3279.4779.51
GQAeval62.6663.5663.8166.80
VizWizval48.5846.2767.1467.37
SQAimg72.2474.2276.1074.69
TVQAval48.9842.5262.3157.32
L-Wildtest58.7058.9065.4166.00
AI2Dtest64.8662.8272.4171.41
MathVmini33.6033.6038.3046.5
HBIall39.9639.4645.1045.21
MMMUval40.7042.3039.7044.70
cMMMUval33.7033.1037.4541.20
MMBenchEN72.0373.8876.6378.59
MMBenchCN70.2971.4775.3977.24
SEED-Benchall64.2565.7966.5468.67
SEED-Benchimg69.4071.0572.2876.53
SEED-Benchvid44.7245.8944.7145.91
MMEperception1512155815961633
MMEcognition335384378383

The patch features carry semantics without dense supervision. After one epoch at 448 px, thresholding the first PCA component of the 32×32 patch tokens separates objects from the background, and mapping three components to RGB colours objects of the same category alike (Figure 5).

它的 patch 特征不需要稠密监督就带有语义。在 448 px 下训练一个 epoch 后,对 32×32 个 patch token 的第一主成分取阈值即可把物体与背景分开,再把三个主成分映射为 RGB,同类物体呈现相近的颜色(图 5)。

Photos of animals and objects next to the PCA of their MLCD patch features: the background is removed and objects of the same category share a colour
Figure 5. PCA of MLCD ViT-L/14 patch features at 448 px, from the paper. Objects of the same category share a colour.图 5. MLCD ViT-L/14 在 448 px 下 patch 特征的主成分分析(取自论文)。同类物体颜色相近。

After the papers论文之后

The repository kept scaling MLCD as a vision tower for multimodal LLMs. ViT-bigG/14 models at 336 and 448 px add 2D RoPE; inside LLaVA-NeXT with Qwen2.5-7B, the 448-px model scores 73.80 on ChartQA, 83.34 on DocVQA and 582 on OCRBench, above CLIP ViT-L/14 and SigLIP SO400M (Table 14). In April 2025 MLCD ViT-bigG was merged into Hugging Face Transformers as MLCDVisionModel.

代码仓库继续把 MLCD 扩展为多模态大模型的视觉编码器。336 px 和 448 px 的 ViT-bigG/14 模型加入了 2D RoPE;在搭配 Qwen2.5-7B 的 LLaVA-NeXT 中,448 px 模型在 ChartQA、DocVQA、OCRBench 上分别得到 73.80、83.34、582,高于 CLIP ViT-L/14 和 SigLIP SO400M(表 14)。2025 年 4 月,MLCD ViT-bigG 以 MLCDVisionModel 的形式并入 Hugging Face Transformers。

Table 14From the repository README, not from either paper: vision towers inside LLaVA-NeXT, trained on its official data with Qwen2.5-7B. MLCD rows shaded; blue marks the best score in each column.表 14取自代码仓库 README,不在两篇论文中:在 LLaVA-NeXT 中替换视觉编码器,使用官方训练数据和 Qwen2.5-7B。MLCD 行加底色,蓝色为每列最佳。

Vision tower视觉编码器2D RoPE2D RoPEChartQADocVQAInfoVQAOCRBenchMMMU
CLIP (ViT-L-14-336px)–66.5275.2138.88525.0044.20
SigLIP (ViT-SO400M-384px)–69.2876.7141.38554.0046.78
DFN5B (ViT-H-14-378px)–64.3670.8738.59473.0048.00
MLCD (ViT-L-14-336px)–67.8476.4643.48531.0044.30
MLCD (ViT-bigG-14-336px)✓71.0779.6344.38572.0046.78
MLCD (ViT-bigG-14-448px)✓73.8083.3446.59582.0046.00

The objective also outlived the two papers. Extended from whole images to regions it became RICE (ICCV 2025 highlight), the vision encoder of LLaVA-OneVision-1.5. OneVision-Encoder is trained by cluster discrimination over more than one million concepts, and Mage-ViT uses negative-sampling cluster discrimination with the same 10% ratio.

这个训练目标也延续到了两篇论文之后。从整张图扩展到区域后,它成为 RICE(ICCV 2025 Highlight),也就是 LLaVA-OneVision-1.5 的视觉编码器。OneVision-Encoder 在一百多万个概念上做聚类判别训练,Mage-ViT 也采用带负采样的聚类判别,负采样比例同样是 10%。

Open-source resources开源资源

Code and models are public. The repository is MIT-licensed; on Hugging Face the MLCD ViT-B/32 and ViT-L/14 weights are Apache-2.0 and the ViT-bigG/14 weights MIT.

代码与模型全部公开。代码仓库采用 MIT 许可;Hugging Face 上 MLCD 的 ViT-B/32 与 ViT-L/14 权重采用 Apache-2.0,ViT-bigG/14 权重采用 MIT。

Citation引用

citation.bib
@inproceedings{anxiang_2024_mlcd,
  title     = {Multi-label Cluster Discrimination for Visual Representation Learning},
  author    = {An, Xiang and Yang, Kaicheng and Dai, Xiangzi and Feng, Ziyong and Deng, Jiankang},
  booktitle = {ECCV},
  year      = {2024}
}
@inproceedings{anxiang_2023_unicom,
  title     = {Unicom: Universal and Compact Representation Learning for Image Retrieval},
  author    = {An, Xiang and Deng, Jiankang and Yang, Kaicheng and Li, Jiawei and Feng, Ziyong and
               Guo, Jia and Yang, Jing and Liu, Tongliang},
  booktitle = {ICLR},
  year      = {2023}
}

Authors作者

UNICOM · Xiang An, Jiankang Deng†, Kaicheng Yang, Jiawei Li, Ziyong Feng, Jia Guo, Jing Yang, Tongliang Liu

MLCD · Xiang An, Kaicheng Yang, Xiangzi Dai, Ziyong Feng, Jiankang Deng†

† Corresponding author. UNICOM: DeepGlint, Huawei, InsightFace, University of Cambridge, University of Sydney. MLCD: DeepGlint, Huawei Noah’s Ark Lab.† 通讯作者。UNICOM:格灵深瞳、华为、InsightFace、剑桥大学、悉尼大学。MLCD:格灵深瞳、华为诺亚方舟实验室。