Downloads · 30 days
119
3% of all-time downloads
riddhimanrana/fastvlm-0.5b-captions
fastvlm-0.5b-captions is a image-text-to-text model from riddhimanrana. 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 apple-amlr.
Note: We have published our research paper on this, which you can find here 'https://openreview.net/pdf?id=Tu0PwHgwcZ'
Downloads · 30 days
119
3% of all-time downloads
All-time downloads
4K
Public
Parameters
634M
867 MB on disk
Likes
3
Public
Click a slice to open those files.
.bin491 MB · 57%
How the weights are stored.
U32634M · 100%
From the Hugging Face model README
Note: We have published our research paper on this, which you can find here 'https://openreview.net/pdf?id=Tu0PwHgwcZ'
fastvlm-0.5b-captions is a finetuned version of FastVLM-0.5B Stage 3 from the FastVLM official repository, built for efficient structured image captioning on mobile devices. This model incorporates LoRA fine-tuning, 4-bit quantization, and MobileCLIP-S0 as its vision tower, achieving substantial RAM reductions for embedded inference. This is part of a larger research project that I'm conducting. Find out more at orionlive.ai/research or visit my git repo riddhimanrana/orion
apple/ml-fastvlm, specifically FastVLM-0.5B Stage 3Demo on iPhone 13 Pro Max
To run inference of PyTorch checkpoint, follow the instruction below. I recommend you go through apple/ml-fastvlm for further instructions on inference on Apple Silicon and other devices.
python predict.py --model-path /path/to/checkpoint-dir \
--image-file /path/to/image.png \
--prompt "Describe the image."
The prompt I used for the dataset, in training, and in practice is:
You are a vision-language model that analyzes images for context-aware reasoning.
Given a visual scene, generate a rich, structured, and detailed description that includes:\n\n
1. Main Focus – What is the primary object, person, or action in the scene?\n
2. Surrounding Objects & Context – List and describe notable secondary objects, people, or environment details.\n
3. Spatial Relationships – Describe where the objects are relative to one another.\n
4. Activities & Interactions – What are people or objects doing? Are there interactions or implied motions?\n
5. Scene Type & Time – Describe the overall type of scene (e.g. urban street, kitchen, park) and visible time of day.\n
6. Inferences & Intent – Based on visual cues, infer what might have just happened or what might happen next.\n
7. Style & Aesthetic – Describe the scene’s mood, lighting, or style (e.g. bright, moody, colorful).\n\n
Your goal: make your description so complete and detailed that an image generator could reconstruct the scene with full visual accuracy from your output alone.
riddhimanrana/coco-fastvlm-2k-val2017MobileCLIP-S0r=128alpha=256Dropout = 0.11512| Hyperparameter | Value |
|---|---|
| Precision | fp32 (Apple Silicon, no bf16/fp16) |
| Learning rate | 2e-4 |
| Weight decay | 0.0 |
| Warmup ratio | 0.03 |
| Scheduler | cosine |
| Batch size (train) | 8 |
| Batch size (eval) | 4 |
| Gradient accumulation | 1 |
| Max token length | 512 |
| Logging steps | 1 |
| Evaluation strategy | no |
| Save strategy | steps (default step interval) |
| Gradient checkpointing | True |
| Lazy preprocessing | True |
| DataLoader workers | 4 |
Training duration: ~1.2 hours on M2 Pro (1 epoch over 2k samples)
Peak RAM usage: ~11.5 GB
Merged model size: 3.0 GB (pre-quantization)
Post-quantization size: ~864 MB (MLX-quantized, 4-bit)
Inference memory on iPhone (MLX): ~980MB-1.2GB RAM with 256 token generation
All devices were fed the same image. However, this model is only compatible with iPhone 12 and newer models. It has been tested on iPhone 11, but it doesn’t work due to incompatibility issues with Apple MLX support and smaller neural engines.
| Device | Chip | RAM | TTFT | Generation |
|---|---|---|---|---|
| iPhone 12 | A14 | 4GB | 2392ms | 73.5 tok/s |
| iPhone 13 Pro Max | A15 | 6GB | 1138ms | 74.1 tok/s |
| iPhone 14 | A15 | 6GB | 1069ms | 71.3 tok/s |
| MacBook Air 2020 | M1 | 8GB | 673ms | 131 tok/s |
Due to the direction of my current project, evaluation metrics weren’t particularly important so I didn't spend much time on it. However, I am open to community contributions for model evaluation.
| Metric | Avg Score |
|---|---|
| Completeness | 4.6 / 5 |
| Structure | 4.8 / 5 |
| Visual Accuracy | 4.5 / 5 |
The model produces rich, well-structured, and highly relevant captions optimized for real-time mobile inference. With ~930 MB size and <1 GB RAM usage, it is deployable on older iPhones w/o Apple Intelligence(e.g., iPhone 12 or newer). Despite fine-tuning on just 2,000 examples, its reasoning capability generalizes well due to the high-quality distilled prompts.
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
BibTeX:
@InProceedings{fastvlm2025,
author = {Pavan Kumar Anasosalu Vasu, Fartash Faghri, Chun-Liang Li, Cem Koc, Nate True, Albert Antony, Gokul Santhanam, James Gabriel, Peter Grasch, Oncel Tuzel, Hadi Pouransari},
title = {FastVLM: Efficient Vision Encoding for Vision Language Models},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2025}
}
Contact: @riddhimanrana on Hugging Face or GitHub