apple-aiml-research/ml-veclip

The official repo for the paper "VeCLIP: Improving CLIP Training via Visual-enriched Captions"

Jupyter Notebook

256

15 commits

updated Sep 11, 2026

See the code

README

[ECCV-2024] VeCLIP: Improving CLIP Training via Visual-enriched Captions

  • A novel CLIP training scheme that achieves the SoTA performance on zero-shot ImageNet classification and COCO image text retreival using limited visual-enriched captions. * [Paper]

Zhengfeng Lai*, Haotian Zhang* , Bowen Zhang, Wentao Wu, Haoping Bai, Aleksei Timofeev, Xianzhi Du, Zhe Gan, Jiulong Shan, Chen-Nee Chuah, Yinfei Yang, Meng Cao [*: equal contribution]


Diagram of VeCap.

Release

  • [10/03/2024] 🔥🔥🔥 We release VeCap-V2: Revisit Large-Scale Image-Caption Data in Pre-training Multimodal Foundation Models.
  • [08/23/2024] 🔥🔥🔥 We release our VeCap-300M dataset.
  • [07/01/2024] 🔥 Our paper is accepted by ECCV 2024.
  • [03/06/2024] 🔥 We released the VeCLIP & VeCap-DFN checkpoints.

Contents

Install

  1. Clone this repository
git clone https://github.com/apple/ml-veclip
cd ml-veclip
  1. Create an environment and install related packages
conda create -n veclip python=3.9 -y
conda activate veclip
pip install -r requirements.txt

Getting Started

See the example notebook for details on how to simply load the different checkpoints using HuggingFace transformers.

VeCap-300M Download

We split our 300M data into 10 jsons: for each image, we save the web link and our caption.

wget -i vecap300m.txt -b -c

Checkpoints

We release the checkpoints for VeCLIP, which are trained from scratch on visual-enriched captions VeCap 3M/12M/100M/200M/300M, as reported in the paper. The models are evaluated on COCO/Flickr30k image-text retrieval and ImageNet/ImageNetv2 classification in a zero-shot fashion. Use wget or curl to download the below checkpoints.

DataModelResolutionCOCO (R@1)Flickr30k (R@1)ImageNetImageNetv2
I2TT2II2TT2I
VeCap 3MCLIP-B/16224x2245.463.2812.206.365.467.09
VeCLIP-B/16224x22422.3013.0140.6027.5815.9813.51
VeCap 12MCLIP-B/16224x22424.5214.2844.70290.631.6027.03
VeCLIP-B/16224x22447.7831.6273.9055.6838.1132.53
VeCap 100MCLIP-B/16224x22447.2430.6174.4057.1658.6450.96
VeCLIP-B/16224x22464.8246.1289.3073.1060.7754.17
VeCap 200MCLIP-B/16224x22452.2034.9780.9063.2663.7256.84
VeCLIP-B/16224x22467.2048.4091.1076.3264.6457.67

We further found our VeCap can also be complementary to other well-established filtering methods, e.g., Data Filtering Network (DFN). We also provide thosse checkpoints (referred to as VeCap-DFN) and report their performance below.

BackboneResolutionDataCOCO (R@1)Flickr30k (R@1)ImageNetImageNetV2
I2TT2II2TT2I
VeCap-DFN-B/16224x224DFN 62.9643.2087.1070.4476.1568.19
VeCap 300M64.7444.5890.1073.1446.4341.15
DFN + VeCap 300M66.2845.1288.8073.5676.1969.58
VeCap-DFN-L/14224x224DFN + VeCap 300M71.0651.1393.1080.9681.9575.48
VeCap-DFN-H/14336x336DFN + VeCap 300M72.7852.3393.6082.6483.0776.37

Citation

If you find VeCLIP useful, please cite using this BibTeX:

@misc{lai2024veclip,
      title={VeCLIP: Improving CLIP Training via Visual-enriched Captions}, 
      author={Zhengfeng Lai and Haotian Zhang and Bowen Zhang and Wentao Wu and Haoping Bai and Aleksei Timofeev and Xianzhi Du and Zhe Gan and Jiulong Shan and Chen-Nee Chuah and Yinfei Yang and Meng Cao},
      year={2024},
      eprint={2310.07699},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
@misc{lai2024revisitlargescaleimagecaptiondata,
      title={Revisit Large-Scale Image-Caption Data in Pre-training Multimodal Foundation Models}, 
      author={Zhengfeng Lai and Vasileios Saveris and Chen Chen and Hong-You Chen and Haotian Zhang and Bowen Zhang and Juan Lao Tebar and Wenze Hu and Zhe Gan and Peter Grasch and Meng Cao and Yinfei Yang},
      year={2024},
      eprint={2410.02740},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2410.02740}, 
}
@article{fang2023data,
  title={Data filtering networks},
  author={Fang, Alex and Jose, Albin Madappally and Jain, Amit and Schmidt, Ludwig and Toshev, Alexander and Shankar, Vaishaal},
  journal={arXiv preprint arXiv:2309.17425},
  year={2023}
}

Acknowledgement

Significant stargazers

George Lyon

30 followers · starred Mar 2024

Leonardo Ollero López

175 followers · starred Mar 2024

apple-aiml-research/ml-veclip

The official repo for the paper "VeCLIP: Improving CLIP Training via Visual-enriched Captions"

Jupyter Notebook

256

15 commits

updated Sep 11, 2026

See the code

README

[ECCV-2024] VeCLIP: Improving CLIP Training via Visual-enriched Captions

  • A novel CLIP training scheme that achieves the SoTA performance on zero-shot ImageNet classification and COCO image text retreival using limited visual-enriched captions. * [Paper]

Zhengfeng Lai*, Haotian Zhang* , Bowen Zhang, Wentao Wu, Haoping Bai, Aleksei Timofeev, Xianzhi Du, Zhe Gan, Jiulong Shan, Chen-Nee Chuah, Yinfei Yang, Meng Cao [*: equal contribution]


Diagram of VeCap.

Release

  • [10/03/2024] 🔥🔥🔥 We release VeCap-V2: Revisit Large-Scale Image-Caption Data in Pre-training Multimodal Foundation Models.
  • [08/23/2024] 🔥🔥🔥 We release our VeCap-300M dataset.
  • [07/01/2024] 🔥 Our paper is accepted by ECCV 2024.
  • [03/06/2024] 🔥 We released the VeCLIP & VeCap-DFN checkpoints.

Contents

Install

  1. Clone this repository
git clone https://github.com/apple/ml-veclip
cd ml-veclip
  1. Create an environment and install related packages
conda create -n veclip python=3.9 -y
conda activate veclip
pip install -r requirements.txt

Getting Started

See the example notebook for details on how to simply load the different checkpoints using HuggingFace transformers.

VeCap-300M Download

We split our 300M data into 10 jsons: for each image, we save the web link and our caption.

wget -i vecap300m.txt -b -c

Checkpoints

We release the checkpoints for VeCLIP, which are trained from scratch on visual-enriched captions VeCap 3M/12M/100M/200M/300M, as reported in the paper. The models are evaluated on COCO/Flickr30k image-text retrieval and ImageNet/ImageNetv2 classification in a zero-shot fashion. Use wget or curl to download the below checkpoints.

DataModelResolutionCOCO (R@1)Flickr30k (R@1)ImageNetImageNetv2
I2TT2II2TT2I
VeCap 3MCLIP-B/16224x2245.463.2812.206.365.467.09
VeCLIP-B/16224x22422.3013.0140.6027.5815.9813.51
VeCap 12MCLIP-B/16224x22424.5214.2844.70290.631.6027.03
VeCLIP-B/16224x22447.7831.6273.9055.6838.1132.53
VeCap 100MCLIP-B/16224x22447.2430.6174.4057.1658.6450.96
VeCLIP-B/16224x22464.8246.1289.3073.1060.7754.17
VeCap 200MCLIP-B/16224x22452.2034.9780.9063.2663.7256.84
VeCLIP-B/16224x22467.2048.4091.1076.3264.6457.67

We further found our VeCap can also be complementary to other well-established filtering methods, e.g., Data Filtering Network (DFN). We also provide thosse checkpoints (referred to as VeCap-DFN) and report their performance below.

BackboneResolutionDataCOCO (R@1)Flickr30k (R@1)ImageNetImageNetV2
I2TT2II2TT2I
VeCap-DFN-B/16224x224DFN 62.9643.2087.1070.4476.1568.19
VeCap 300M64.7444.5890.1073.1446.4341.15
DFN + VeCap 300M66.2845.1288.8073.5676.1969.58
VeCap-DFN-L/14224x224DFN + VeCap 300M71.0651.1393.1080.9681.9575.48
VeCap-DFN-H/14336x336DFN + VeCap 300M72.7852.3393.6082.6483.0776.37

Citation

If you find VeCLIP useful, please cite using this BibTeX:

@misc{lai2024veclip,
      title={VeCLIP: Improving CLIP Training via Visual-enriched Captions}, 
      author={Zhengfeng Lai and Haotian Zhang and Bowen Zhang and Wentao Wu and Haoping Bai and Aleksei Timofeev and Xianzhi Du and Zhe Gan and Jiulong Shan and Chen-Nee Chuah and Yinfei Yang and Meng Cao},
      year={2024},
      eprint={2310.07699},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
@misc{lai2024revisitlargescaleimagecaptiondata,
      title={Revisit Large-Scale Image-Caption Data in Pre-training Multimodal Foundation Models}, 
      author={Zhengfeng Lai and Vasileios Saveris and Chen Chen and Hong-You Chen and Haotian Zhang and Bowen Zhang and Juan Lao Tebar and Wenze Hu and Zhe Gan and Peter Grasch and Meng Cao and Yinfei Yang},
      year={2024},
      eprint={2410.02740},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2410.02740}, 
}
@article{fang2023data,
  title={Data filtering networks},
  author={Fang, Alex and Jose, Albin Madappally and Jain, Amit and Schmidt, Ludwig and Toshev, Alexander and Shankar, Vaishaal},
  journal={arXiv preprint arXiv:2309.17425},
  year={2023}
}

Acknowledgement

Significant stargazers

George Lyon

30 followers · starred Mar 2024

Leonardo Ollero López

175 followers · starred Mar 2024

Languages

Jupyter Notebook

99.7%