File size: 6,629 Bytes
e5ce52f
817033e
e5ce52f
9db6b80
e5ce52f
817033e
e5ce52f
817033e
e5ce52f
817033e
e5ce52f
817033e
e5ce52f
817033e
e5ce52f
 
 
 
817033e
e5ce52f
817033e
e5ce52f
817033e
e5ce52f
817033e
e5ce52f
 
 
 
 
817033e
e5ce52f
817033e
e5ce52f
817033e
e5ce52f
9db6b80
e5ce52f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# DoctorIA-MED-R-7B

# DoctorIA Medical Solutions: Revolutionizing Healthcare with AI-Powered Diagnostics

![Hugging Face Badge](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Model-blue) ![License](https://img.shields.io/badge/license-Apache%202.0-green)

[[Read the Paper]](https://example.com/paper) [[Demo]](https://example.com/demo) [[Hugging Face Model](https://huggingface.co/your-username/doctoria-model)]

**DoctorIA** is an innovative AI-powered solution designed to enhance radiological diagnostics, improve healthcare access, and reduce disparities in underserved areas of Morocco. Leveraging state-of-the-art machine learning techniques, DoctorIA provides accurate, efficient, and scalable diagnostic support for medical professionals.

---

## Overview

DoctorIA is built to assist healthcare providers with:
- **Automated Medical Image Analysis**: Accurate interpretation of X-rays, MRIs, and other medical imaging technologies.
- **Clinical Reasoning Support**: Advanced reasoning capabilities to assist in diagnosis, treatment planning, and risk assessment.
- **Healthcare Accessibility Initiatives**: Bridging gaps in healthcare access by offering scalable solutions to underserved populations.

Our mission is to empower healthcare professionals and patients alike by providing cutting-edge AI-driven diagnostic tools.

---

## Key Features

- **AI-Driven Diagnostic Tools**: Supports clinical reasoning and treatment planning by providing insights derived from advanced AI algorithms.
- **Radiology Assistance**: Assists radiologists with preliminary analysis of medical images.
- **Patient Education**: Provides clear explanations of medical procedures and technologies.
- **Multilingual Support**: Available in Arabic, French, English, and Spanish to cater to diverse populations.
- **Scalable Deployment**: Optimized for deployment in resource-constrained environments, ensuring accessibility even in underserved areas.

---

## Models

We release two versions of the DoctorIA model:

1. **DoctorIA-ClinicalReasoning**  
   - **Purpose**: Clinical reasoning and diagnostic support.  
   - **Tasks**: Symptom-to-diagnosis mapping, treatment planning, and evidence-based recommendations.  
   - **Quantization**: Available in 4-bit precision for reduced memory usage.  
   - **Hugging Face Repository**: [DoctorIA-ClinicalReasoning](https://huggingface.co/your-username/doctoria-clinical-reasoning)  

2. **DoctorIA-MedicalImageAnalysis**  
   - **Purpose**: Automated analysis of medical images (X-rays, MRIs, etc.).  
   - **Tasks**: Disease detection, lesion segmentation, and abnormality classification.  
   - **Quantization**: Available in 4-bit precision for reduced memory usage.  
   - **Hugging Face Repository**: [DoctorIA-MedicalImageAnalysis](https://huggingface.co/your-username/doctoria-medical-image-analysis)  

All models are released under the **Apache 2.0 License**.

---

## Organisation of the Repository

The repository is structured as follows:

- **`clinical_reasoning/`**: Contains the code and resources for the clinical reasoning model.
- **`medical_image_analysis/`**: Contains the code and resources for the medical image analysis model.
- **`examples/`**: Example scripts for inference, fine-tuning, and integration.
- **`datasets/`**: Links to datasets used for training and evaluation.
- **`notebooks/`**: Jupyter notebooks for experimentation and visualization.
- **`docs/`**: Additional documentation and tutorials.

---

## Requirements

To use DoctorIA, you will need:

- Python 3.8 or higher (Python 3.10 recommended).
- PyTorch (`torch`) and Transformers (`transformers`) libraries.
- GPU with at least 16GB of memory (for full-precision models).

Install dependencies using:

```bash
pip install -r requirements.txt
```

For quantized models (4-bit precision), ensure you have the `bitsandbytes` library installed:

```bash
pip install bitsandbytes
```

---

## Usage

### 1. Clinical Reasoning Model

Load the model and tokenizer:

```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification

model_name = "your-username/doctoria-clinical-reasoning"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

# Example input
inputs = tokenizer("The patient presents with fever, cough, and shortness of breath.", return_tensors="pt")
outputs = model(**inputs)
predicted_diagnosis = outputs.logits.argmax().item()
print(f"Predicted Diagnosis: {predicted_diagnosis}")
```

### 2. Medical Image Analysis Model

Load the model and feature extractor:

```python
from transformers import AutoFeatureExtractor, AutoModelForImageClassification
from PIL import Image
import requests

model_name = "your-username/doctoria-medical-image-analysis"
feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
model = AutoModelForImageClassification.from_pretrained(model_name)

# Example input
url = "https://example.com/chest-xray.jpg"
image = Image.open(requests.get(url, stream=True).raw)
inputs = feature_extractor(images=image, return_tensors="pt")
outputs = model(**inputs)
predicted_class = outputs.logits.argmax().item()
print(f"Predicted Class: {predicted_class}")
```

---

## Benchmarks

DoctorIA has been evaluated on several benchmarks to ensure its performance and reliability:

- **Clinical Reasoning**: Achieved **X% accuracy** on the DR.BENCH benchmark for clinical diagnostic reasoning.
- **Medical Image Analysis**: Achieved **Y% sensitivity** and **Z% specificity** on the CheXpert benchmark for chest X-ray analysis.

For more details, refer to our [paper](https://example.com/paper).

---

## Development

If you wish to contribute to DoctorIA or modify it for your needs:

1. Clone the repository:
   ```bash
   git clone https://github.com/your-username/doctoria.git
   cd doctoria
   ```

2. Install dependencies:
   ```bash
   pip install -e '.[dev]'
   ```

3. Run tests:
   ```bash
   pytest
   ```

---

## FAQ

Check out the [Frequently Asked Questions](FAQ.md) section before opening an issue.

---

## License

The codebase is released under the **Apache 2.0 License**.  
The model weights are released under the **CC-BY 4.0 License**.

---

## Citation

If you use DoctorIA in your research or projects, please cite our work:

```bibtex
@techreport{doctoria2025,
      title={DoctorIA: Enhancing Radiological Diagnostics with AI},
      author={Jad Tounsi El Azzoiani and Team DoctorIA},
      year={2025},
      eprint={XXXX.XXXXX},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://example.com/paper},
}
```