AAAI 2026
🎉 Overview of Geo-R for image geolocation. Given a query image, the agent generates a region-level reasoning chain grounded in geographic knowledge, followed by coordinate prediction. The framework integrates structured prompting, multi-modal understanding, and reinforcement optimization to enhance both interpretability and spatial accuracy.
conda create -n Geo-R python=3.10
conda activate Geo-R
bash setup.shWe provide the training JSON files; however, the corresponding image files need to be obtained from MP16-Pro.
MP16-Pro: Huggingface
SFT Data: Huggingface
GRPO Data: Huggingface
Qwen-VL-2.5-7B After 500k SFT : Huggingface
IM2GPS3K: images and metadata;
- Download the Our RL Data and unzip it, and we refer to the image dir as
<your_image_root>. - Change the
data_pathsandimage_foldersin the run_scripts/run_grpo_rec.sh file.
# These jsonl files are included in the annotation files at step 2.
# Note: please use jsonl files instead of json files.
data_paths="path/to/GEO_R_Train.json"
image_folders="path/to/GEO-R"bash run_scripts/run_grpo_rec.sh
Note
If you encounter 'CUDA out of memory' error, you can try to reduce the per_device_train_batch_size.
We use LLaMA-Factory to train the SFT model.
- Clone the LLaMA-Factory repository and install the dependencies.
git clone https://github.com/hiyouga/LLaMA-Factory.git
cd LLaMA-Factory
pip install -e ".[torch,metrics]"- Download the dataset_info.json, mllm_rec_json.json, and qwen2_5_vl_full_sft.yaml we provided here. Put the json files in the
LLaMA-Factory/datadirectory and the yaml file in theLLaMA-Factory/examples/train_fulldirectory. - Run the following command to train the SFT model.
llamafactory-cli train examples/train_full/qwen2_5_vl_full_sft.yamlWe support data loading the jsonl data of this format in src/open-r1-multimodal/src/open_r1/grpo_jsonl.py. Please note that you may need to use different reward functions for your specialized tasks. Welcome to PR to add your own reward functions or share any other interesting findings!
The jsonl has the format as follows:
{
"id": 1,
"image": "Clevr_CoGenT_TrainA_R1/data/images/CLEVR_trainA_000001_16885.png",
"conversations": [
{"from": "human", "value": "<image>What number of purple metallic balls are there?"},
{"from": "gpt", "value": "0"}
]
}If you want to use multi-image input, you can use the following format:
{
"id": 1,
"image": ["Clevr_CoGenT_TrainA_R1/data/images/CLEVR_trainA_000001_16885.png", "Clevr_CoGenT_TrainA_R1/data/images/CLEVR_trainA_000001_16886.png"],
"conversations": [
{"from": "human", "value": "<image><image>What number of purple metallic balls in total within the two images?"},
{"from": "gpt", "value": "3"}
]
}Note
The image path in the jsonl file should be relative to the image folder specified in --image_folders. The absolute path of the input image is constructed as os.path.join(image_folder, data['image']). For example:
- If your jsonl has
"image": "folder1/image1.jpg" - And you specify
--image_folders "/path/to/images/" - The full image path will be
/path/to/images/folder1/image1.jpg
Multiple data files and image folders can be specified using ":" as a separator:
--data_file_paths /path/to/data1.jsonl:/path/to/data2.jsonl \
--image_folders /path/to/images1/:/path/to/images2/The script can be run like this:
# You could refer to the run_grpo_rec.sh for the example
torchrun --nproc_per_node="8" \
--nnodes="1" \
--node_rank="0" \
--master_addr="127.0.0.1" \
--master_port="12345" \
src/open_r1/grpo_jsonl.py \
--output_dir output/$RUN_NAME \
--model_name_or_path Qwen/Qwen2.5-VL-3B-Instruct \
--deepspeed ${REPO_HOME}/src/open-r1-multimodal/local_scripts/zero3.json \
--data_file_paths /path/to/your/data.jsonl \ # can be multiple, separated by ":"
--image_folders /path/to/your/image/folder \ # can be multiple, separated by ":"
...We would like to express our sincere gratitude to DeepSeek, Open-R1, QwenVL, Open-R1-Multimodal, R1-V, RefCOCO, RefGTA, LLaMA-Factory, OVDEval, GUI-Testing-Arena, and LISA for providing open-source resources that contributed to the development of this project.
If you find this project useful, welcome to cite us.
@inproceedings{wu2026vision,
title={Vision-Language Reasoning for Geolocalization: A Reinforcement Learning Approach},
author={Wu, Biao and Fang, Meng and Chen, Ling and Xu, Ke and Cheng, Tao and Wang, Jun},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
year={2026}
}