Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
fine-grained-recognition
chain-of-thought
vision-language
reasoning
qwen2-vl
conversational
text-generation-inference
Instructions to use StevenHH2000/Fine-R1-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use StevenHH2000/Fine-R1-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="StevenHH2000/Fine-R1-3B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("StevenHH2000/Fine-R1-3B") model = AutoModelForMultimodalLM.from_pretrained("StevenHH2000/Fine-R1-3B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use StevenHH2000/Fine-R1-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "StevenHH2000/Fine-R1-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "StevenHH2000/Fine-R1-3B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/StevenHH2000/Fine-R1-3B
- SGLang
How to use StevenHH2000/Fine-R1-3B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "StevenHH2000/Fine-R1-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "StevenHH2000/Fine-R1-3B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "StevenHH2000/Fine-R1-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "StevenHH2000/Fine-R1-3B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use StevenHH2000/Fine-R1-3B with Docker Model Runner:
docker model run hf.co/StevenHH2000/Fine-R1-3B
| library_name: transformers | |
| license: mit | |
| pipeline_tag: image-text-to-text | |
| tags: | |
| - fine-grained-recognition | |
| - chain-of-thought | |
| - vision-language | |
| - reasoning | |
| - qwen2-vl | |
| - arxiv:2602.07605 | |
| # Fine-R1: Make Multi-modal LLMs Excel in Fine-Grained Visual Recognition by Chain-of-Thought Reasoning | |
| This is the official 3B model released for the paper **[Fine-R1: Make Multi-modal LLMs Excel in Fine-Grained Visual Recognition by Chain-of-Thought Reasoning](https://huggingface.co/papers/2602.07605)**. | |
| **Authors**: Hulingxiao He, Zijun Geng, and Yuxin Peng. | |
| ## Introduction | |
| Fine-R1 is a Multi-modal Large Language Model (MLLM) specifically designed to excel in Fine-Grained Visual Recognition (FGVR). While traditional MLLMs often struggle with FGVR compared to contrastive models like CLIP, Fine-R1 bridges this performance gap by incorporating Chain-of-Thought (CoT) reasoning. It achieves state-of-the-art performance, even surpassing strong CLIP-like models, in identifying both seen and unseen fine-grained sub-categories with only 4-shot training. | |
| ## Methodology | |
| Fine-R1 employs an R1-style training framework consisting of two key stages: | |
| 1. **Chain-of-Thought Supervised Fine-tuning (SFT)**: This stage involves constructing a high-quality FGVR CoT dataset with rationales covering "visual analysis, candidate sub-categories, comparison, and prediction." This process trains the model to act as a strong open-world classifier. | |
| 2. **Triplet Augmented Policy Optimization (TAPO)**: This stage enhances the model's robustness and discriminative ability. It uses Intra-class Augmentation to improve robustness to intra-class variance and Inter-class Augmentation to maximize response distinction across sub-categories. | |
| ## GitHub Repository | |
| For code, data, and detailed training/evaluation instructions, please refer to the official repository: | |
| [https://github.com/PKU-ICST-MIPL/FineR1_ICLR2026](https://github.com/PKU-ICST-MIPL/FineR1_ICLR2026) | |
| ## Model Version | |
| Fine-R1-3B | |
| ## Usage | |
| This model can be used with the Hugging Face `transformers` library. For detailed usage examples and how to integrate it into your projects, please refer to the official [GitHub Repository](https://github.com/PKU-ICST-MIPL/FineR1_ICLR2026). | |
| ## Citation | |
| If you find this model or the research helpful, please consider citing: | |
| ```bibtex | |
| @article{he2026finer1, | |
| title={Fine-R1: Make Multi-modal LLMs Excel in Fine-Grained Visual Recognition by Chain-of-Thought Reasoning}, | |
| author={He, Hulingxiao and Geng, Zijun and Peng, Yuxin}, | |
| journal={arXiv preprint arXiv:2602.07605}, | |
| year={2026} | |
| } | |
| ``` |