Downloads · 30 days
19
3% of all-time downloads
weizhiwang/UniFilter-Qwen2.5-1.5B
UniFilter-Qwen2.5-1.5B is a image-text-to-text model from weizhiwang. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
Official implementation of Train a Unified Multimodal Data Quality Classifier with Synthetic Data accepted by EMNLP 2025 Findings.
Downloads · 30 days
19
3% of all-time downloads
All-time downloads
749
Public
Parameters
2B
4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4 GB · 100%
From the Hugging Face model README
Official implementation of Train a Unified Multimodal Data Quality Classifier with Synthetic Data accepted by EMNLP 2025 Findings.
UniFilter is a Unified Multimodal Data Quality Classifier for High-Quality Multimodal Data Filtering, which can generate quality scores for both image-text caption and interleaved document data. Such quality scores can be further used for high-quality data filtering to significantly strengthen the capability of pre-trained MLLMs.
This repo supports
If you just require the quality score generation, please install the customized LLaVA package only.
conda create -n unifilter python=3.10
conda activate unifilter
pip install -e LLaVA
pip install flash-attn==2.5.2 --no-build-isolation
We instruct Claude-3 or Claude-3.5 to generate the desired (multimodal data example, quality score) pairs across 4 designated quality levels. The synthetic data generation scrips are:
UniFilter is trained a large-scale set of (multimodal data example, quality score) pairs, which contains both caption data and interleaved document data. The synthetic multimodal example-score paired data are available at UniFilter-Post-Train-Data.
We develop the UniFilter training and scoring codebase based on LLaVA-Unified repo, which is adapted from LLaVA with the support for recent LLMs and Vision Encoders.
<!-- An additional [LlavaPhi3Classifier](LLaVA/llava/model/language_model/llava_phi3.py#235) class is customized as the model class for UniFilter. -->The architectural design of UniFilter contains three modules, the vision encoder, the visual projector, and the LLM Backbone. Different from a MLLM, the LLM Backbone does not have a language modeling head and we replace it with a score generation head. All these module parameters are specified with:
--mm_projector_type: visual projector, i.e. aapool_mlp representing average pooling vision projector with 144 tokens for one image--vision_tower: vision encoder, i.e. SigLIP-SO-400M with 384px resolution--model_name_or_path: LLM Backbone, i.e. Qwen2.5-0.5B-InstructPlease download the 558K subset of the LLAVA-Pretrain caption dataset LLaVA-Pretrain.
Training script with DeepSpeed ZeRO-2: pretrain.sh.
Training script with DeepSpeed ZeRO-3: train_classifier.sh.
Our training script will upload the metrics to wandb. The best UniFilter model is saved based on the best quality classification accuracy on the validation sets.
python data_scoring/data_quality_classifier_caption_scoring.py \
--model-path weizhiwang/UniFilter-Qwen2.5-1.5B \
--tar-file-path data/datacomp/medium_vanilla_filter\
--gpu-id 0 \
--batch-size 4 \
--tars-per-gpu 256 \
python data_scoring/data_quality_classifier_interleaved_scoring.py \
--model-path weizhiwang/UniFilter-Qwen2.5-1.5B \
--tar-file-path data/OBELICS/obelics_webdataset\
--gpu-id 0 \
--batch-size 1 \
--tars-per-gpu 128 \
Parameters to note:
--gpu-id: for large-scale score generation using multi-machines, specify the index of machines--model-path: path to the UniFilter model checkpoint--tar-file-path: path to the webdataset image-text caption data or interleaved document data tars--tars-per-gpu: the number of webdataset tars for a single-gpu to inference onPlease cite our paper if you find this repository interesting or helpful:
@article{UniFilter,
title={Train a Unified Multimodal Data Quality Classifier with Synthetic Data},
author={Wang, Weizhi and Lin, Rongmei and Li, Shiyang and Lockard, Colin and Sarkhel, Ritesh and Lokegaonkar, Sanket and Shang, Jingbo and Yan, Xifeng and Zalmout, Nasser and Li, Xian},
journal={arXiv preprint arXiv:2510.15162},
year={2025}
}