Freeze-Align is a lightweight framework for flexible multimodal alignment.
It connects frozen vision and language encoders using small trainable projectors, allowing efficient cross-modal learning without the need for full-scale retraining.
This repository contains the code and datasets associated with our CVPR 2025 paper:
Harnessing Frozen Unimodal Encoders for Flexible Multimodal Alignment
This framework is built on the premise that semantically similar vision and language embedding spaces can be aligned through simple projection transformations. For example, by aligning DINOv2 with the Sentence-Transformer model all-roberta-large-v1, we achieve a remarkable 76% zero-shot ImageNet accuracy, surpassing comparable CLIP models while reducing alignment compute by 65x and paired data requirements by 20x.
We believe this approach holds immense potential for further advancements. We invite the open-source community to explore aligning newer, more powerful vision and language encoders to develop high-performing CLIP-like models with minimal effort. Notably, recent improvements in language models on the MTEB benchmark and advancements in SSL vision models present exciting opportunities for experimentation and innovation.
# Clone the repository
git clone https://github.com/mayug/freeze-align.git
cd freeze-align
# Create environment
conda env create -f environment.yaml
conda activate freeze-align
/alignment)Find the most semantically similar vision-language encoder pairs.
python get_semantic_sim.py
Workflow:
cka_results.png) and output the best encoder pair./train)Train lightweight projectors between frozen encoders.
Setup:
dinov2-arl-wds-combined.yaml.conda env create -f environment.yaml
conda activate freeze-align
bash extra_install.sh
Training Command:
python -m torch.distributed.launch --master_port=43770 --nproc_per_node=8 --use_env PretrainHydra.py --config dinov2-arl-wds-combined --output_dir ./storage/output/ --overrides +save_last_only=False fp16=True disable_wandb=False text_pooling=mean local_vision_projection=patch local_text_projection=patch text_projection=mlp
/collection)Curate a concept-rich dataset from LAION.
Steps:
/laion400m-meta/.python getting_laion_embeds.py --gpu <GPU_ID> --b <BATCH_SIZE> --m <MODEL> --p <PART>
python scores_new.py --gpu <GPU_ID> --b <BATCH_SIZE> --p <PART>
python sort_samples.py --p <PART> --max <MAX_SAMPLES> --b <BATCH_SIZE> --sort_b <SORT_BATCH_SIZE> --gpu <GPU_ID>
python collect_fast.py --parts <NUM_PARTS> --max <MAX_SAMPLES>
🔥 Tip: Complete all parts for each step before proceeding to the next.
push_to_hub utility for uploading trained modelsIf you use our work, please cite:
@inproceedings{maniparambil2025harnessing,
title={Harnessing Frozen Unimodal Encoders for Flexible Multimodal Alignment},
author={Maniparambil, Mayug and Akshulakov, Raiymbek and Djilali, Yasser Abdelaziz Dahou and Narayan, Sanath and Singh, Ankit and O'Connor, Noel E},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2025}
}
5 commits
Python
95.7%
Shell
4.3%
Freeze-Align is a lightweight framework for flexible multimodal alignment.
It connects frozen vision and language encoders using small trainable projectors, allowing efficient cross-modal learning without the need for full-scale retraining.
This repository contains the code and datasets associated with our CVPR 2025 paper:
Harnessing Frozen Unimodal Encoders for Flexible Multimodal Alignment
This framework is built on the premise that semantically similar vision and language embedding spaces can be aligned through simple projection transformations. For example, by aligning DINOv2 with the Sentence-Transformer model all-roberta-large-v1, we achieve a remarkable 76% zero-shot ImageNet accuracy, surpassing comparable CLIP models while reducing alignment compute by 65x and paired data requirements by 20x.
We believe this approach holds immense potential for further advancements. We invite the open-source community to explore aligning newer, more powerful vision and language encoders to develop high-performing CLIP-like models with minimal effort. Notably, recent improvements in language models on the MTEB benchmark and advancements in SSL vision models present exciting opportunities for experimentation and innovation.
# Clone the repository
git clone https://github.com/mayug/freeze-align.git
cd freeze-align
# Create environment
conda env create -f environment.yaml
conda activate freeze-align
/alignment)Find the most semantically similar vision-language encoder pairs.
python get_semantic_sim.py
Workflow:
cka_results.png) and output the best encoder pair./train)Train lightweight projectors between frozen encoders.
Setup:
dinov2-arl-wds-combined.yaml.conda env create -f environment.yaml
conda activate freeze-align
bash extra_install.sh
Training Command:
python -m torch.distributed.launch --master_port=43770 --nproc_per_node=8 --use_env PretrainHydra.py --config dinov2-arl-wds-combined --output_dir ./storage/output/ --overrides +save_last_only=False fp16=True disable_wandb=False text_pooling=mean local_vision_projection=patch local_text_projection=patch text_projection=mlp
/collection)Curate a concept-rich dataset from LAION.
Steps:
/laion400m-meta/.python getting_laion_embeds.py --gpu <GPU_ID> --b <BATCH_SIZE> --m <MODEL> --p <PART>
python scores_new.py --gpu <GPU_ID> --b <BATCH_SIZE> --p <PART>
python sort_samples.py --p <PART> --max <MAX_SAMPLES> --b <BATCH_SIZE> --sort_b <SORT_BATCH_SIZE> --gpu <GPU_ID>
python collect_fast.py --parts <NUM_PARTS> --max <MAX_SAMPLES>
🔥 Tip: Complete all parts for each step before proceeding to the next.
push_to_hub utility for uploading trained modelsIf you use our work, please cite:
@inproceedings{maniparambil2025harnessing,
title={Harnessing Frozen Unimodal Encoders for Flexible Multimodal Alignment},
author={Maniparambil, Mayug and Akshulakov, Raiymbek and Djilali, Yasser Abdelaziz Dahou and Narayan, Sanath and Singh, Ankit and O'Connor, Noel E},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year={2025}
}
5 commits
Python
95.7%
Shell
4.3%