Downloads · 30 days
32
100% of all-time downloads
FatimahEmadEldin/ArGuard-Qwen3-VL-8B-QLoRA-A1
ArGuard-Qwen3-VL-8B-QLoRA-A1 is a image-text-to-text model from FatimahEmadEldin. 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 peft.
QLoRA adapter for Qwen3-VL-8B-Instruct, fine-tuned for binary Arabic hateful meme detection (Subtask A1 of ArGuard 2026, Track A). The model receives the meme image, the OCR text, and a task instruction, and generates…
Downloads · 30 days
32
100% of all-time downloads
All-time downloads
32
Public
Repo size
833 MB
Likes
0
Public
Click a slice to open those files.
.safetensors411 MB · 93%
From the Hugging Face model README
QLoRA adapter for Qwen3-VL-8B-Instruct, fine-tuned for binary Arabic hateful meme detection (Subtask A1 of ArGuard 2026, Track A).
The model receives the meme image, the OCR text, and a task instruction, and generates Hateful or Not Hateful.
This was the NAMAA team's official A1 submission and is the best A1 system in our paper: NAMAA at ArGuard Shared Tasks: Multimodal Fusion, Vision–Language Model Adaptation, and In-Context Prompting for Arabic Hateful Meme Detection (ArabicNLP 2026).
Subtask A1, from Table 1 and Table 3 of the paper:
| Split | Accuracy | Macro-F1 | Macro-P | Macro-R | Weighted-F1 | F1 (Hateful) | F1 (Not Hateful) |
|---|---|---|---|---|---|---|---|
| Development | 0.75 | 0.73 | 0.73 | 0.73 | 0.75 | 0.67 | 0.80 |
| Test (official) | 0.7920 | 0.7610 | 0.7530 | 0.7740 | 0.7961 | 0.6750 | 0.8471 |
Comparison on the A1 test set (macro-F1):
| System | A1 |
|---|---|
| Qwen3-VL-8B (this model) | 0.7610 |
| Soft-vote ensemble (CLIP–MARBERTv2 + SigLIP–AraBERT-Twitter) | 0.7443 |
| CLIP–MARBERTv2 | 0.7374 |
| SigLIP–AraBERT-Twitter | 0.7345 |
| Llama 3.2 Vision 11B (QLoRA) | 0.6952 |
| Gemma 4 E4B (QLoRA) | 0.4906 |
| Path | Description |
|---|---|
best_adapter/ | Recommended. The early-stopped adapter selected on the development set, with tokenizer and processor files. |
root (adapter_model.safetensors, …) | The adapter from the final training epoch, with tokenizer and processor files. |
training_args.bin | The TRL/transformers training arguments. |
| Setting | Value |
|---|---|
| Base model | unsloth/Qwen3-VL-8B-Instruct-unsloth-bnb-4bit (4-bit NF4) |
| Method | QLoRA SFT with Unsloth + TRL; adapters on both vision and language attention / MLP projections |
| LoRA | r = 16, α = 16, dropout = 0, no bias |
| Optimisation | lr 2e-4, linear schedule, 5 warmup steps, weight decay 0.001, 8-bit AdamW |
| Batch / length | effective batch size 8, max sequence length 2048, 3 epochs |
| Seed | 3407 |
| Data | ArGuard 2026 Track A training split (3,500 memes); model selection on the 500-meme development split |
Generation is deterministic with at most 8 new tokens. The output is mapped onto the official label vocabulary.
Detect the classification of hateful Arabic memes from image and extracted text. The classification labels are only ['Hateful', 'Not Hateful'], return only the label.
import torch
from PIL import Image
from peft import PeftModel
from transformers import AutoProcessor, Qwen3VLForConditionalGeneration
REPO = "NAMAA-Space/ArGuard-Qwen3-VL-8B-QLoRA-A1"
base = Qwen3VLForConditionalGeneration.from_pretrained(
"unsloth/Qwen3-VL-8B-Instruct-unsloth-bnb-4bit", torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(base, REPO, subfolder="best_adapter").eval()
processor = AutoProcessor.from_pretrained(REPO, subfolder="best_adapter")
INSTRUCTION = ("Detect the classification of hateful Arabic memes from image and extracted text. "
"The classification labels are only ['Hateful', 'Not Hateful'], return only the label.")
image = Image.open("meme.jpg").convert("RGB")
ocr_text = "..." # OCR text of the meme
messages = [{"role": "user", "content": [
{"type": "image"},
{"type": "text", "text": f"{INSTRUCTION}\n\nOCR text: {ocr_text}"},
]}]
prompt = processor.apply_chat_template(messages, add_generation_prompt=True)
inputs = processor(images=[image], text=[prompt], return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=8, do_sample=False)
print(processor.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True).strip())
| Model | Description |
|---|---|
| ArGuard-Qwen3-VL-8B-QLoRA-A1 | Best A1 system (official A1 submission) |
| ArGuard-CLIP-MARBERTv2 | Dual encoder for A1 + A2 (official A2 submission) |
| ArGuard-SigLIP-AraBERT-Twitter | Dual encoder for A1 + A2 (best A2 test score) |
@inproceedings{djamai-etal-2026-namaa,
title = "{NAMAA} at {ArGuard} Shared Tasks: Multimodal Fusion, Vision{--}Language Model Adaptation, and In-Context Prompting for {A}rabic Hateful Meme Detection",
author = "Djamai, Abdelbasset and Al Jallad, Khloud and Emad Eldin, Fatimah and Nacar, Omer",
booktitle = "Proceedings of the Fourth Arabic Natural Language Processing Conference: Shared Tasks",
year = "2026",
address = "Budapest, Hungary",
publisher = "Association for Computational Linguistics",
}
@inproceedings{alam-etal-2026-arguard,
title = "{ArGuard} Shared Task: Harmful Content Detection in {A}rabic Memes and {LLM} Prompts",
author = "Alam, Firoj and Biswas, Md. Rafiul and Kmainasi, Mohamed Bayan and Shahroor, Ali Ezzat and Mubarak, Hamdy and Mikros, Georgios and Hasnat, Abul and Zaghouani, Wajdi",
booktitle = "Proceedings of the Fourth Arabic Natural Language Processing Conference: Shared Tasks",
year = "2026",
address = "Budapest, Hungary",
publisher = "Association for Computational Linguistics",
}
Authors: Abdelbasset Djamai, Khloud Al Jallad, Fatimah Emad Eldin, Omer Nacar (NAMAA Community). Contact: [email protected]