Lucario-K17/Radiology_Med takes structured inputs like diagnosis labels and study metadata, and generates a coherent, detailed radiology report.
It is built on top of Meditron, a medical LLM, and fine-tuned with paired radiology data from MIMIC-CXR.
1from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
23model = AutoModelForSeq2SeqLM.from_pretrained("Lucario-K17/Radiology_Med", device_map="auto", torch_dtype="auto")4tokenizer = AutoTokenizer.from_pretrained("Lucario-K17/Radiology_Med")56# Example input format7prompt ="""
8Patient Age: 52
9Sex: Male
10View: PA
11Diagnosis: Atelectasis, Pleural Effusion
1213Generate a detailed radiology report based on this information.
14"""1516inputs = tokenizer(prompt, return_tensors="pt").to(model.device)1718output = model.generate(19**inputs,20 max_new_tokens=512,21 do_sample=True,22 top_k=50,23 top_p=0.95,24 temperature=0.725)2627report = tokenizer.decode(output[0], skip_special_tokens=True)28print(report)
Sample Output
Input: Patient Age: 52 | Sex: Male | View: PA | Diagnosis: Atelectasis, Pleural Effusion
Generated Report: The chest X-ray demonstrates evidence of left lower lobe atelectasis with associated blunting of the left costophrenic angle consistent with a small pleural effusion. Cardiac silhouette is within normal limits. No evidence of pneumothorax. Recommend clinical correlation and follow-up imaging if symptoms persist.
Training Details
Param
Value
Base Model
Meditron 7B
Quantization
4-bit (QLoRA)
Dataset
MIMIC-CXR (20,000 rows)
Optimizer
AdamW
LR
2e-5
Epochs
3
Batch Size
8 (gradient accumulation = 4)
Trainer Framework
Hugging Face Accelerate
Citation (MIT-GA Style)
If you use this model, please provide citation or link:
bibtex
1@misc{lucario2025radiologymed,
2 title = {Radiology_Med: MIMIC-CXR Fine-tuned Meditron Model for Report Generation},
3 author = {Kishore},
4 year = {2025},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/Lucario-K17/Radiology_Med}},
7 note = {Licensed under MIT-GA; citation or link required for use}
8}
License
MIT-GA License
Permission is granted to use, modify, and distribute this model for any purpose, including commercial,
provided that appropriate attribution is given by citing or linking to this model:
https://huggingface.co/Lucario-K17/Radiology_Med
The model and code are provided "AS IS", without warranty of any kind.