eyupipler commited on
Commit
13e7d5c
·
verified ·
1 Parent(s): f749444

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +262 -1
README.md CHANGED
@@ -15,4 +15,265 @@ tags:
15
  - neuro
16
  - neura
17
  - healthcare
18
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  - neuro
16
  - neura
17
  - healthcare
18
+ ---
19
+ # Vbai Modelleri
20
+
21
+ ## Model Detayları
22
+
23
+ #### Vbai Modelleri MRI ve fMRI görüntüleri üzerine eğitilmiştir. Bu modellerin eğitildiği veri setleri Neurazum tarafından gizli tutulmaktadır. Derin öğrenme yöntemleri ile eğitilerek çok yüksek doğruluk oranları ile MRI ve fMRI üzerinde çok hassas bir şekilde çalışabilir. Demans ile ilgili tüm beyin görselleriyle çalışıp, teşhis koyabilir. Nörobilim alanındaki geri kalmışlığa, ilkelliğe ve hata paylarına "bai" modelleriyle birlikte son vermeyi hedeflemektedir.
24
+
25
+ ### Model Tanımı
26
+
27
+ - **Geliştirici:** _Neurazum_
28
+ - **Yayımcı:** _Eyüp İpler_
29
+ - **Model Tipi:** _MRI ve fMRI_
30
+ - **Lisans:** _CC-BY-NC-SA-4.0_
31
+
32
+ ## Kullanımlar
33
+
34
+ **Bu modellerdeki amacımız;**
35
+
36
+ - _Hastanın demans hastalıklarını (alzheimer gibi) daha erken ve daha doğru bir şekilde teşhis koymak,_
37
+ - _Hastanelerde çalışan doktorlara teşhis ve inceleme için kolaylık sağlamak,_
38
+ - _Risk taşıyan hastaları tespit etmek,_
39
+ - _Tanı koyulma aşamasında ki hata paylarını düşürmektir._
40
+
41
+ ## Direkt Kullanımlar
42
+
43
+ **Klasik Kullanım:**
44
+
45
+ ```python
46
+ import torch
47
+ import torch.nn as nn
48
+ from torchvision import transforms, models
49
+ from PIL import Image
50
+ import matplotlib.pyplot as plt
51
+ import os
52
+ from torchsummary import summary
53
+
54
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
55
+
56
+ model = models.resnet18(pretrained=False)
57
+ num_ftrs = model.fc.in_features
58
+ model.fc = nn.Linear(num_ftrs, 4)
59
+ model.load_state_dict(torch.load('Vbai-1.0 Dementia/model/yolu'))
60
+ model = model.to(device)
61
+ model.eval()
62
+ summary(model, (3, 224, 224))
63
+
64
+ transform = transforms.Compose([
65
+ transforms.Resize((224, 224)),
66
+ transforms.ToTensor(),
67
+ transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
68
+ ])
69
+
70
+ class_names = ['Demans Değil', 'Hafif Demans', 'Orta Demans', 'Çok Hafif Demans']
71
+
72
+ def predict(image_path, model, transform):
73
+ image = Image.open(image_path).convert('RGB')
74
+ image = transform(image).unsqueeze(0).to(device)
75
+ model.eval()
76
+ with torch.no_grad():
77
+ outputs = model(image)
78
+ probs = torch.nn.functional.softmax(outputs, dim=1)
79
+ _, preds = torch.max(outputs, 1)
80
+ return preds.item(), probs[0][preds.item()].item()
81
+
82
+ def show_image_with_prediction(image_path, prediction, confidence, class_names):
83
+ image = Image.open(image_path)
84
+ plt.imshow(image)
85
+ plt.title(f"Tahmin: {class_names[prediction]} (%{confidence * 100:.2f})")
86
+ plt.axis('off')
87
+ plt.show()
88
+
89
+ test_image_path = 'MRI/veya/fMRI/görüntüsü'
90
+ prediction, confidence = predict(test_image_path, model, transform)
91
+ print(f'Tahmin: {class_names[prediction]} (%{confidence * 100})')
92
+
93
+ show_image_with_prediction(test_image_path, prediction, confidence, class_names)
94
+ ```
95
+
96
+ ## Önyargı, Riskler ve Kısıtlamalar
97
+
98
+ **Vbai Modelleri;**
99
+
100
+ - _En büyük riski yanlış teşhis koymasıdır :),_
101
+ - _Herhangi bir kısıtlama bulunmamaktadır,_
102
+ - _Hastanın beyin görselleri hiçbir şekilde kişisel bilgi içermez. Bu nedenle, Vbai tarafından hiçbir şekilde kişisel veri elde edilemez._
103
+
104
+ ### Öneriler
105
+
106
+ - _Görseller ne kadar yüksek çözünürlükte olursa o kadar iyidir._
107
+
108
+ ## Modele Nasıl Başlanır
109
+
110
+ - Modelin içeriğindeki gerekli modülleri kurmak için;
111
+ - ```bash
112
+ pip install -r requirements.txt
113
+ ```
114
+ - Örnek kullanımla modelin ve veri setinin yolunu yerleştirin,
115
+ - Ve dosyayı çalıştırın.
116
+
117
+ ## Değerlendirme
118
+
119
+ - Vbai-1.0 Dementia => (Doğruluk oranı en az her ihtimalde = %90) (DEMANS DURUMLARI)
120
+
121
+ ### Sonuçlar
122
+
123
+ [![image](https://r.resimlink.com/BIgjLTN.png)](https://resimlink.com/BIgjLTN)
124
+
125
+ [![image](https://r.resimlink.com/3lQLUpatA.png)](https://resimlink.com/3lQLUpatA)
126
+
127
+ [![image](https://r.resimlink.com/uyT5Y.png)](https://resimlink.com/uyT5Y)
128
+
129
+ #### Özet
130
+
131
+ Özetle Vbai modelleri, hastanın demans durumunu tespit ederek tıp alanında çalışanlara kolaylık sağlamak amacıyla teşhis koyabilen görüntü işleme modelidir.
132
+
133
+ #### Donanım
134
+
135
+ Tek ihtiyacınız olan şey MRI ve fMRI (Ya da görüntüleri)!
136
+
137
+ ## Daha Fazla
138
+
139
+ LinkedIn: https://www.linkedin.com/company/neurazum
140
+
141
+ ### Yazar
142
+
143
+ Eyüp İpler - https://www.linkedin.com/in/eyupipler/
144
+
145
+ ### İletişim
146
+
147
148
+
149
+ # ------------------------------------
150
+
151
+ # Vbai Models
152
+
153
+ ## Model Details
154
+
155
+ #### Vbai models were trained on MRI and fMRI images. The data sets on which these models are trained are kept confidential by Neurazum. It can work very precisely on MRI and fMRI with very high accuracy rates by training with deep learning methods. It can work with all brain images related to dementia and diagnose. It aims to put an end to the backwardness, primitiveness and error margins in the field of neuroscience with ‘bai’ models.
156
+
157
+ ### Model Description
158
+
159
+ - **Developed by: _Neurazum_**
160
+ - **Shared by: _Eyüp İpler_**
161
+ - **Model type: _MRI and fMRI_**
162
+ - **License: _CC-BY-NC-SA-4.0_**
163
+
164
+ ## Uses
165
+
166
+ **Our aim in these models is to;**
167
+
168
+ - _To diagnose the patient's dementia diseases (such as Alzheimer's) earlier and more accurately,_
169
+ - _Providing convenience to doctors working in hospitals for diagnosis and examination,_
170
+ - _Identifying patients at risk,_
171
+ - _to reduce the margin of error in the diagnostic process._
172
+
173
+ ## Direct Uses
174
+
175
+ **Classical Use:**
176
+
177
+ ```python
178
+ import torch
179
+ import torch.nn as nn
180
+ from torchvision import transforms, models
181
+ from PIL import Image
182
+ import matplotlib.pyplot as plt
183
+ import os
184
+ from torchsummary import summary
185
+
186
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
187
+
188
+ model = models.resnet18(pretrained=False)
189
+ num_ftrs = model.fc.in_features
190
+ model.fc = nn.Linear(num_ftrs, 4)
191
+ model.load_state_dict(torch.load('Vbai-1.0 Dementia/model/path'))
192
+ model = model.to(device)
193
+ model.eval()
194
+ summary(model, (3, 224, 224))
195
+
196
+ transform = transforms.Compose([
197
+ transforms.Resize((224, 224)),
198
+ transforms.ToTensor(),
199
+ transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
200
+ ])
201
+
202
+ class_names = ['Non Demented', 'Mild Demented', 'Moderate Demented', 'Very Mild Demented']
203
+
204
+ def predict(image_path, model, transform):
205
+ image = Image.open(image_path).convert('RGB')
206
+ image = transform(image).unsqueeze(0).to(device)
207
+ model.eval()
208
+ with torch.no_grad():
209
+ outputs = model(image)
210
+ probs = torch.nn.functional.softmax(outputs, dim=1)
211
+ _, preds = torch.max(outputs, 1)
212
+ return preds.item(), probs[0][preds.item()].item()
213
+
214
+ def show_image_with_prediction(image_path, prediction, confidence, class_names):
215
+ image = Image.open(image_path)
216
+ plt.imshow(image)
217
+ plt.title(f"Prediction: {class_names[prediction]} (%{confidence * 100:.2f})")
218
+ plt.axis('off')
219
+ plt.show()
220
+
221
+ test_image_path = 'MRI/or/fMRI/image/path'
222
+ prediction, confidence = predict(test_image_path, model, transform)
223
+ print(f'Prediction: {class_names[prediction]} (%{confidence * 100})')
224
+
225
+ show_image_with_prediction(test_image_path, prediction, confidence, class_names)
226
+ ```
227
+
228
+ ## Bias, Risks and Limitations
229
+
230
+ **Vbai Models;**
231
+
232
+ - _The biggest risk is misdiagnosis :),_
233
+ - _There are no restrictions,_
234
+ - _The patient's brain images do not contain any personal information. Therefore, no personal data can be obtained by Vbai in any way._
235
+
236
+ ### Recommendations
237
+
238
+ - _The higher the resolution of the visuals, the better._
239
+
240
+ ## How to Get Started with the Model
241
+
242
+ - To install the necessary modeules in the model;
243
+ - ```bash
244
+ pip install -r requirements.txt
245
+ ```
246
+ - Place the path of the model in the example uses.
247
+ - And run the file.
248
+
249
+ ## Evaluation
250
+
251
+ - Vbai-1.0 Dementia => (Accuracy rate at least in all probability = 90%) (DEMENTIA STATES)
252
+
253
+ ### Results
254
+
255
+ [![image](https://r.resimlink.com/q93iSBueP0H.png)](https://resimlink.com/q93iSBueP0H)
256
+
257
+ [![image](https://r.resimlink.com/u5QMO0X42.png)](https://resimlink.com/u5QMO0X42)
258
+
259
+ [![image](https://r.resimlink.com/2NPDH0l.png)](https://resimlink.com/2NPDH0l)
260
+
261
+ #### Summary
262
+
263
+ In summary, Vbai models are image processing models that can diagnose the patient's dementia status in order to provide convenience to medical professionals.
264
+
265
+ #### Hardware
266
+
267
+ All you need is MRI and fMRI (or images)!
268
+
269
+ ## More
270
+
271
+ LinkedIn: https://www.linkedin.com/company/neurazum
272
+
273
+ ### Author
274
+
275
+ Eyüp İpler - https://www.linkedin.com/in/eyupipler/
276
+
277
+ ### Contact
278
+
279