Downloads · 30 days
216
53% of all-time downloads
AIRI-Institute/chexfract-maira2
chexfract-maira2 is a image-text-to-text model from AIRI-Institute. 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.
This repository contains the pre-trained models from our paper "ChexFract: From General to Specialized - Enhancing Fracture Description Generation in Medical AI".
Downloads · 30 days
216
53% of all-time downloads
All-time downloads
410
Public
Parameters
3.9B
7.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors7.8 GB · 100%
From the Hugging Face model README
This repository contains the pre-trained models from our paper "ChexFract: From General to Specialized - Enhancing Fracture Description Generation in Medical AI".
ChexFract models are specialized vision-language models fine-tuned for accurate fracture detection and description in chest X-ray images. These models significantly outperform general-purpose radiology report generation systems on fracture-specific tasks.
We release two best-performing models, each optimized for their respective encoder architecture:
ChexFract-MAIRA-2 (Best F1-Score with MAIRA-2 encoder)
ChexFract-CheXagent (Best F1-Score with CheXagent encoder)
pip install torch torchvision transformers pillow
Using MAIRA-2 encoder model:
from transformers import AutoModelForCausalLM, AutoProcessor
from PIL import Image
# Load model and processor
model = AutoModelForCausalLM.from_pretrained("AIRI-Institute/chexfract-maira2", trust_remote_code=True)
processor = AutoProcessor.from_pretrained("AIRI-Institute/chexfract-maira2", trust_remote_code=True)
messages = [{"role": "user", "content": "<|image_1|>\nDescribe bones on this chest X-ray"}]
# Load chest X-ray image
image = Image.open("chest_xray.png")
prompt = processor.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Generate fracture description
inputs = processor(prompt, image, return_tensors="pt")
outputs = model.generate(**inputs, eos_token_id=processor.tokenizer.eos_token_id, max_new_tokens=1024)
description = processor.decode(outputs[0, inputs['input_ids'].shape[1]:], skip_special_tokens=True)
print(f"Fracture description: {description}")
| Model | ROC-AUC | F1-Score | Accuracy | Precision | Recall |
|---|---|---|---|---|---|
| General MAIRA-2 (baseline) | 0.518 | 0.085 | 0.645 | 0.777 | 0.045 |
| ChexFract-MAIRA-2 | 0.713 | 0.629 | 0.748 | 0.682 | 0.584 |
| General CheXagent (baseline) | 0.604 | 0.376 | 0.700 | 0.791 | 0.246 |
| ChexFract-CheXagent | 0.697 | 0.591 | 0.752 | 0.750 | 0.487 |
Both models share the same architecture but use different visual encoders:
ChexFract-MAIRA-2:
ChexFract-CheXagent:
Important: These models are designed for research purposes. They are NOT intended for standalone diagnostic use.
If you use these models in your research, please cite:
@article{chexfract2025,
title={ChexFract: From General to Specialized - Enhancing Fracture Description Generation in Medical AI},
author={Nechaev, Nikolay and Przhezdzetskaia, Evgeniia and Umerenkov, Dmitry and Dylov, Dmitry V.},
journal={arXiv preprint arXiv:XXXX.XXXXX},
year={2025},
institution={Artificial Intelligence Research Institute (AIRI)}
}
Important: These models are derivative works based on multiple pre-trained models. The license for these models is subject to the most restrictive terms among the base model licenses.
Effective License: These models are provided under terms compatible with the most restrictive license among the base model licenses. Users must comply with ALL applicable base model licenses.
Base Model Licenses:
⚠️ IMPORTANT - Commercial Use Restrictions:
The most restrictive license applies: These models are NOT licensed for commercial use due to CC-BY-NC-4.0 and MSRLA restrictions. For commercial use, you must obtain appropriate licenses from the original model owners.
Before using these models, you must:
The fine-tuning code and modifications specific to this work may be subject to additional licensing terms. Please review all applicable licenses before commercial use.
We thank the contributors to the MIMIC-CXR, PadChest, BIMCV-COVID19, CheXpert, and OpenI datasets for making their data publicly available. We also acknowledge the computational resources provided for this research.
For questions or issues, please contact:
Disclaimer: These models are provided for research purposes only. They are not intended for clinical use without proper validation and regulatory approval.