File size: 5,417 Bytes
6c093f6
cd5ac83
6c093f6
cd5ac83
6c093f6
cd5ac83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
language: en
tags:
- summarization
- medical
library_name: transformers
pipeline_tag: summarization
---

# Automatic Personalized Impression Generation for PET Reports Using Large Language Models 📄✍

**Authored by**: Xin Tie, Muheon Shin, Ali Pirasteh, Nevein Ibrahim, Zachary Huemann, Sharon M. Castellino, Kara Kelly, John Garrett, Junjie Hu, Steve Y. Cho, Tyler J. Bradshaw

## 📑 Model Description

This is the fine-tuned T5 model for summarizing findings in PET reports. 

To check our fine-tuned large language models (LLMs) for PET report summarization: 
- [BERT2BERT-PET](https://huggingface.co/xtie/Clinicallongformer2roberta-PET-impression)
- [BART-PET](https://huggingface.co/xtie/BART-PET-impression)
- [BioBART-PET](https://huggingface.co/xtie/BioBART-PET-impression)
- [PEGASUS-PET](https://huggingface.co/xtie/PEGASUS-PET-impression)
- [T5v1.1-PET](https://huggingface.co/xtie/T5v1.1-PET-impression)
- [Clinical-T5-PET](https://huggingface.co/xtie/ClinicalT5-PET-impression)
- [Flan-T5-PET](https://huggingface.co/xtie/Flan-T5-PET-impression)
- [GPT2-XL-PET](https://huggingface.co/xtie/GPT2-PET-impression)
- [OPT-1.3B-PET](https://huggingface.co/xtie/OPT-PET-impression)
- [LLaMA-LoRA-PET](https://huggingface.co/xtie/LLaMA-LoRA-PET-impression)
- [Alpaca-LoRA-PET](https://huggingface.co/xtie/Alpaca-LoRA-PET-impression)

## 📑 Abstract

Purpose: To determine if fine-tuned large language models (LLMs) can generate accurate, personalized impressions for whole-body PET reports. 

Materials and Methods: Twelve language models were trained on a corpus of PET reports using the teacher-forcing algorithm, with the report findings as input and the clinical impressions as reference. An extra input token encodes the reading physician’s identity, allowing models to learn physician-specific reporting styles. Our corpus comprised 37,370 retrospective PET reports collected from our institution between 2010 and 2022. To identify the best LLM, 30 evaluation metrics were benchmarked against quality scores from two nuclear medicine (NM) physicians, with the most aligned metrics selecting the model for expert evaluation. In a subset of data, model-generated impressions and original clinical impressions were assessed by three NM physicians according to 6 quality dimensions and an overall utility score (5-point scale). Each physician reviewed 12 of their own reports and 12 reports from other physicians. Bootstrap resampling was used for statistical analysis. 

Results: Of all evaluation metrics, domain-adapted BARTScore and PEGASUSScore showed the highest Spearman’s ρ correlations (0.568 and 0.563) with physician preferences. Based on these metrics, the fine-tuned PEGASUS model was selected as the top LLM. When physicians reviewed PEGASUS-generated impressions in their own style, 89% were considered clinically acceptable, with a mean utility score of 4.08/5. Physicians rated these personalized impressions as comparable in overall utility to the impressions dictated by other physicians (4.03, P=0.41).

Conclusion: Personalized impressions generated by PEGASUS were clinically useful, highlighting its potential to expedite PET reporting.

[Read the full paper](https://arxiv.org/abs/2309.10066)
<!-- Link to our Arxiv paper -->

## 🚀 Usage

```bash
finetuned_model = "xtie/T5v1.1-PET-impression"
tokenizer = AutoTokenizer.from_pretrained(finetuned_model) 
model = AutoModelForSeq2SeqLM.from_pretrained(finetuned_model, ignore_mismatched_sizes=True).eval()

findings_info =
"""
Description: PET CT WHOLE BODY
Radiologist: James
Findings:
Head/Neck: xxx Chest: xxx Abdomen/Pelvis: xxx Extremities/Musculoskeletal: xxx
Indication:
The patient is a 60-year old male with a history of xxx
"""

inputs = tokenizer(findings_info.replace('\n', ' '),
                  padding="max_length",
                  truncation=True,
                  max_length=1024,
                  return_tensors="pt")
input_ids = inputs.input_ids.to("cuda")
attention_mask = inputs.attention_mask.to("cuda")
outputs = model.generate(input_ids,
                        attention_mask=attention_mask,
                        max_new_tokens=512, 
                        num_beam_groups=1,
                        num_beams=4, 
                        do_sample=False,
                        diversity_penalty=0.0,
                        num_return_sequences=1, 
                        length_penalty=2.0,
                        no_repeat_ngram_size=3,
                        early_stopping=True
                        )
# get the generated impressions
output_str = tokenizer.decode(outputs,
                              skip_special_tokens=True) 
```


### 📊 Performance Metrics

For detailed evaluation results, please refer to our paper.
- **ROUGE-1**: 53.7
- **ROUGE-2**: 30.7
- **ROUGE-L**: 40.3
- **BLEU**: 24.1
- **BERTScore**: 0.747

### 💡 Highlights

- The fine-tuned large language model provides clinically useful, personalized impressions based on PET findings.
- To our knowledge, this is the first attempt to automate impression generation for whole-body PET reports. 

### 🖥️ Hardware

The models were trained on NVIDIA A100 GPUs.

---

## 📁 Additional Resources
- **Finetuned from model:** [T5-Large](https://huggingface.co/google/t5-v1_1-large)
- **Codebase for training and inference:** [GitHub Repository](https://github.com/xtie97/PET-Report-Summarization)