Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -12,11 +12,14 @@ tags:
|
|
| 12 |
datasets:
|
| 13 |
- perioperative-complications
|
| 14 |
pipeline_tag: text-classification
|
|
|
|
|
|
|
|
|
|
| 15 |
---
|
| 16 |
|
| 17 |
# PeriComp: Perioperative Complication Detection LoRA Adaptors
|
| 18 |
|
| 19 |
-

|
|
| 75 |
base_model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 76 |
|
| 77 |
# Load PeriComp adaptor
|
| 78 |
-
adaptor_name = "
|
| 79 |
model = PeftModel.from_pretrained(base_model, adaptor_name)
|
| 80 |
|
| 81 |
# Prepare clinical input
|
| 82 |
-
clinical_text =
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
Postoperative Course: POD#2 - Patient reports abdominal pain,
|
| 86 |
-
fever 38.5°C, elevated WBC count 15,000/μL...
|
| 87 |
-
'''
|
| 88 |
|
| 89 |
-
#
|
| 90 |
-
|
| 91 |
-
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 92 |
-
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 93 |
-
```
|
| 94 |
-
|
| 95 |
-
### Targeted Strategy Usage
|
| 96 |
|
| 97 |
-
|
| 98 |
|
| 99 |
-
|
| 100 |
-
# Define complications to assess
|
| 101 |
-
complications = [
|
| 102 |
-
"acute_kidney_injury",
|
| 103 |
-
"surgical_site_infection",
|
| 104 |
-
"paralytic_ileus",
|
| 105 |
-
# ... other complications
|
| 106 |
-
]
|
| 107 |
-
|
| 108 |
-
# Assess each complication individually
|
| 109 |
-
results = {}
|
| 110 |
-
for complication in complications:
|
| 111 |
-
prompt = f"Assess for {complication}: {clinical_text}"
|
| 112 |
-
# ... inference code
|
| 113 |
-
results[complication] = assessment
|
| 114 |
-
```
|
| 115 |
-
|
| 116 |
-
## 📈 Performance Metrics
|
| 117 |
|
| 118 |
-
|
|
|
|
| 119 |
|
| 120 |
-
|
| 121 |
-
- **Center 2 (External)**: Community hospital validation
|
| 122 |
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
| PeriComp-32B | 0.68 | 0.65 | 0.526 |
|
| 129 |
-
| PeriComp-QwQ-32B | 0.70 | 0.67 | 0.526 |
|
| 130 |
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
|
| 139 |
## 🔧 Technical Details
|
| 140 |
|
|
@@ -157,9 +136,16 @@ lora_config = {
|
|
| 157 |
}
|
| 158 |
```
|
| 159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
## 📋 Supported Complications
|
| 161 |
|
| 162 |
-
The models detect and grade 22 perioperative complications
|
| 163 |
|
| 164 |
1. **Cardiovascular**: Myocardial injury, cardiac arrhythmias
|
| 165 |
2. **Respiratory**: Pneumonia, respiratory failure
|
|
@@ -175,6 +161,9 @@ Each complication is graded as:
|
|
| 175 |
- **Moderate**: Significant medical management
|
| 176 |
- **Severe**: Life-threatening, intensive intervention
|
| 177 |
|
|
|
|
|
|
|
|
|
|
| 178 |
## 🏥 Clinical Applications
|
| 179 |
|
| 180 |
### Primary Use Cases
|
|
@@ -209,26 +198,47 @@ Each complication is graded as:
|
|
| 209 |
- Validate outputs against clinical judgment
|
| 210 |
- Consider local adaptation for specific institutional practices
|
| 211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
## 📚 Citation
|
| 213 |
|
| 214 |
If you use PeriComp in your research, please cite:
|
| 215 |
|
| 216 |
```bibtex
|
| 217 |
-
@article{
|
| 218 |
-
title={Enhancing
|
| 219 |
-
author={
|
| 220 |
-
journal={
|
| 221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
}
|
| 223 |
```
|
| 224 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
## 📧 Contact & Support
|
| 226 |
|
| 227 |
For questions, issues, or collaboration opportunities:
|
| 228 |
|
| 229 |
- **Research Team**: Department of Anesthesiology, First Affiliated Hospital of Sun Yat-sen University, Guangzhou, China
|
| 230 |
- **Technical Issues**: [email protected]
|
|
|
|
| 231 |
- **Clinical Applications**: Perioperative Complications Detection
|
|
|
|
| 232 |
|
| 233 |
## 📄 License
|
| 234 |
|
|
|
|
| 12 |
datasets:
|
| 13 |
- perioperative-complications
|
| 14 |
pipeline_tag: text-classification
|
| 15 |
+
paper_url: https://doi.org/10.1101/2025.06.11.25329235
|
| 16 |
+
paper_title: "Enhancing Privacy-Preserving Deployable Large Language Models for Perioperative Complication Detection: A Targeted Strategy with LoRA Fine-tuning"
|
| 17 |
+
repository: https://github.com/gscfwid/PeriComp
|
| 18 |
---
|
| 19 |
|
| 20 |
# PeriComp: Perioperative Complication Detection LoRA Adaptors
|
| 21 |
|
| 22 |
+

|
| 23 |
*Figure: Performance comparison of fine-tuned models across different sizes*
|
| 24 |
|
| 25 |
## 🩺 Model Overview
|
|
|
|
| 53 |
- **High variability** in expert performance across institutions
|
| 54 |
- **Cognitive load limitations** with complex documentation
|
| 55 |
|
| 56 |
+
Our research, published as a preprint on [medRxiv](https://doi.org/10.1101/2025.06.11.25329235), demonstrates that targeted task decomposition combined with LoRA fine-tuning enables smaller models to achieve expert-level diagnostic capabilities while maintaining practical deployability.
|
| 57 |
|
| 58 |
+

|
| 59 |
*Figure: Strict performance evaluation requiring exact complication type and severity matching*
|
| 60 |
|
| 61 |
## 🚀 Quick Start
|
|
|
|
| 78 |
base_model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 79 |
|
| 80 |
# Load PeriComp adaptor
|
| 81 |
+
adaptor_name = "gscfwid/Qwen3-8B-PeriComp"
|
| 82 |
model = PeftModel.from_pretrained(base_model, adaptor_name)
|
| 83 |
|
| 84 |
# Prepare clinical input
|
| 85 |
+
clinical_text = """
|
| 86 |
+
# Objective
|
| 87 |
+
The objective is to identify postoperative complications from patient data in medical records, mimicking the diagnostic expertise of a senior surgeon.
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
+
# Diagnostic Criteria
|
| 90 |
+
The diagnostic criteria for the 22 postoperative complications are as follows:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
+
{the diagnostic criteria for the 22 postoperative complications}
|
| 93 |
|
| 94 |
+
# Guidelines of Output structure
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|
| 96 |
+
The output format is specified as:
|
| 97 |
+
{defined the output structure}
|
| 98 |
|
| 99 |
+
# Data of medical records
|
|
|
|
| 100 |
|
| 101 |
+
- {General Information (De-identified)}
|
| 102 |
+
- {Postoperative Medical Record}
|
| 103 |
+
- {Abnormal Test Results}
|
| 104 |
+
- {Examination Results}
|
| 105 |
+
"""
|
|
|
|
|
|
|
| 106 |
|
| 107 |
+
# Prompt preparation format details can be found in the example files:
|
| 108 |
+
# - comprehensive_prompt.json for QwQ 32B adapter
|
| 109 |
+
# - targeted_prompts.json for Qwen 3 adapters
|
| 110 |
+
# Note: Models are trained on Chinese clinical texts; performance on other languages is not validated
|
| 111 |
|
| 112 |
+
# Generate complication assessment
|
| 113 |
+
inputs = tokenizer(clinical_text, return_tensors="pt")
|
| 114 |
+
outputs = model.generate(**inputs, max_new_tokens=512)
|
| 115 |
+
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 116 |
+
```
|
| 117 |
|
| 118 |
## 🔧 Technical Details
|
| 119 |
|
|
|
|
| 136 |
}
|
| 137 |
```
|
| 138 |
|
| 139 |
+
### 💻 Code and Data Access
|
| 140 |
+
|
| 141 |
+
- **GitHub Repository**: [gscfwid/PeriComp](https://github.com/gscfwid/PeriComp)
|
| 142 |
+
- **Complete Implementation**: Training scripts, evaluation code, and data processing pipelines
|
| 143 |
+
- **Prompt Engineering**: Optimized prompt templates for targeted complication detection
|
| 144 |
+
- **Clinical Data**: Available upon reasonable request through institutional collaboration with appropriate ethical approval
|
| 145 |
+
|
| 146 |
## 📋 Supported Complications
|
| 147 |
|
| 148 |
+
The models detect and grade 22 perioperative complications based on European Perioperative Clinical Outcome (EPCO) definitions¹:
|
| 149 |
|
| 150 |
1. **Cardiovascular**: Myocardial injury, cardiac arrhythmias
|
| 151 |
2. **Respiratory**: Pneumonia, respiratory failure
|
|
|
|
| 161 |
- **Moderate**: Significant medical management
|
| 162 |
- **Severe**: Life-threatening, intensive intervention
|
| 163 |
|
| 164 |
+
---
|
| 165 |
+
¹ Jammer, I. et al. Standards for definitions and use of outcome measures for clinical effectiveness research in perioperative medicine: European Perioperative Clinical Outcome (EPCO) definitions: a statement from the ESA-ESICM joint taskforce on perioperative outcome measures. *Eur J Anaesthesiol* 32, 88-105 (2015). DOI: 10.1097/EJA.0000000000000118
|
| 166 |
+
|
| 167 |
## 🏥 Clinical Applications
|
| 168 |
|
| 169 |
### Primary Use Cases
|
|
|
|
| 198 |
- Validate outputs against clinical judgment
|
| 199 |
- Consider local adaptation for specific institutional practices
|
| 200 |
|
| 201 |
+
### Data Access
|
| 202 |
+
|
| 203 |
+
⚠️ **Clinical datasets are not publicly available due to patient privacy protection**
|
| 204 |
+
|
| 205 |
+
**Data Request Process**:
|
| 206 |
+
- Clinical datasets can be requested from corresponding authors for legitimate research purposes
|
| 207 |
+
- Requests must include detailed research protocol and intended use
|
| 208 |
+
- Institutional ethical approval is required before data sharing
|
| 209 |
+
- Data sharing agreements must comply with local privacy regulations
|
| 210 |
+
- Contact: [email protected] for data access inquiries
|
| 211 |
+
|
| 212 |
## 📚 Citation
|
| 213 |
|
| 214 |
If you use PeriComp in your research, please cite:
|
| 215 |
|
| 216 |
```bibtex
|
| 217 |
+
@article{gao2025pericomp,
|
| 218 |
+
title={Enhancing Privacy-Preserving Deployable Large Language Models for Perioperative Complication Detection: A Targeted Strategy with LoRA Fine-tuning},
|
| 219 |
+
author={Gao, Shaowei and Zhao, Xu and Chen, Lihui and Yu, Junrong and Tian, Shuning and Zhou, Huaqiang and Chen, Jingru and Long, Sizhe and He, Qiulan and Feng, Xia},
|
| 220 |
+
journal={medRxiv},
|
| 221 |
+
pages={2025.06.11.25329235},
|
| 222 |
+
year={2025},
|
| 223 |
+
doi={10.1101/2025.06.11.25329235},
|
| 224 |
+
url={https://doi.org/10.1101/2025.06.11.25329235},
|
| 225 |
+
publisher={Cold Spring Harbor Laboratory Press}
|
| 226 |
}
|
| 227 |
```
|
| 228 |
|
| 229 |
+
**Paper**: [Enhancing Privacy-Preserving Deployable Large Language Models for Perioperative Complication Detection: A Targeted Strategy with LoRA Fine-tuning](https://doi.org/10.1101/2025.06.11.25329235)
|
| 230 |
+
|
| 231 |
+
**Code**: [GitHub Repository - gscfwid/PeriComp](https://github.com/gscfwid/PeriComp)
|
| 232 |
+
|
| 233 |
## 📧 Contact & Support
|
| 234 |
|
| 235 |
For questions, issues, or collaboration opportunities:
|
| 236 |
|
| 237 |
- **Research Team**: Department of Anesthesiology, First Affiliated Hospital of Sun Yat-sen University, Guangzhou, China
|
| 238 |
- **Technical Issues**: [email protected]
|
| 239 |
+
- **Clinical Data Requests**: [email protected] (requires ethical approval and institutional collaboration)
|
| 240 |
- **Clinical Applications**: Perioperative Complications Detection
|
| 241 |
+
- **Code Repository**: [GitHub Issues](https://github.com/gscfwid/PeriComp/issues) for implementation questions
|
| 242 |
|
| 243 |
## 📄 License
|
| 244 |
|