Eyüp İpler
commited on
Commit
•
161bb86
1
Parent(s):
4dc9cf0
bai-2 Versions
Browse files- .gitattributes +3 -0
- Main Models/bai-2.0/README.md +43 -0
- Main Models/bai-2.0/bai-2.0.keras +3 -0
- Main Models/bai-2.1/README.md +43 -0
- Main Models/bai-2.1/bai-2.1.keras +3 -0
- Main Models/bai-2.2/README.md +81 -0
- Main Models/bai-2.2/bai-2.2.keras +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
Main[[:space:]]Models/bai-2.0/bai-2.0.keras filter=lfs diff=lfs merge=lfs -text
|
37 |
+
Main[[:space:]]Models/bai-2.1/bai-2.1.keras filter=lfs diff=lfs merge=lfs -text
|
38 |
+
Main[[:space:]]Models/bai-2.2/bai-2.2.keras filter=lfs diff=lfs merge=lfs -text
|
Main Models/bai-2.0/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# bai-2.0 (338787 parametre)
|
2 |
+
|
3 |
+
## EEG üzerinden duygu sınıflandırması yapan ilk kararlı modellerimizden olan "bai-2.0" modeli.
|
4 |
+
|
5 |
+
#### NOT: Gerçek zamanlı EEG veri takibi uygulamasına modeli entegre ederseniz, gerçek zamanlı olarak duygu tahmini yapabilmektedir. Uygulamaya erişebilmek için: https://github.com/neurazum/Realtime-EEG-Monitoring
|
6 |
+
|
7 |
+
## -----------------------------------------------------------------------------------
|
8 |
+
|
9 |
+
# bai-2.0 (338787 parameters)
|
10 |
+
|
11 |
+
## "bai-2.0" model, one of the first stable models that classifies emotions via EEG.
|
12 |
+
|
13 |
+
#### NOTE: If you integrate the model into a real-time EEG data tracking application, it can predict emotions in real time. To access the application: https://github.com/neurazum/Realtime-EEG-Monitoring
|
14 |
+
|
15 |
+
**Doğruluk/Accuracy: %97.93621013133207**
|
16 |
+
|
17 |
+
## -----------------------------------------------------------------------------------
|
18 |
+
|
19 |
+
# Kullanım / Usage:
|
20 |
+
|
21 |
+
```python
|
22 |
+
import numpy as np
|
23 |
+
import pandas as pd
|
24 |
+
from sklearn.preprocessing import StandardScaler
|
25 |
+
from tensorflow.keras.models import load_model
|
26 |
+
import matplotlib.pyplot as plt
|
27 |
+
|
28 |
+
model_path = 'model-path'
|
29 |
+
|
30 |
+
model = load_model(model_path)
|
31 |
+
|
32 |
+
model_name = model_path.split('/')[-1].split('.')[0]
|
33 |
+
|
34 |
+
plt.figure(figsize=(10, 6))
|
35 |
+
plt.title(f'Duygu Tahmini ({model_name}.0)')
|
36 |
+
plt.xlabel('Zaman')
|
37 |
+
plt.ylabel('Sınıf')
|
38 |
+
plt.legend(loc='upper right')
|
39 |
+
plt.grid(True)
|
40 |
+
plt.show()
|
41 |
+
model.summary()
|
42 |
+
|
43 |
+
```
|
Main Models/bai-2.0/bai-2.0.keras
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:29e3d5b1d22c913b9456494f8e03d5d8d1fdf263d0276998a4bea3d14582805b
|
3 |
+
size 4102623
|
Main Models/bai-2.1/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# bai-2.1 (338787 parametre)
|
2 |
+
|
3 |
+
## EEG üzerinden duygu sınıflandırması yapan "bai-2.1" modeli, bir önceki model olan "bai-2.0" modeline göre overfitting ihtimali azaltılmış ve optimize edilmiş versiyonudur. Tüm işlevleri aynıdır.
|
4 |
+
|
5 |
+
#### NOT: Gerçek zamanlı EEG veri takibi uygulamasına modeli entegre ederseniz, gerçek zamanlı olarak duygu tahmini yapabilmektedir. Uygulamaya erişebilmek için: https://github.com/neurazum/Realtime-EEG-Monitoring
|
6 |
+
|
7 |
+
## -----------------------------------------------------------------------------------
|
8 |
+
|
9 |
+
# bai-2.1 (338787 parameters)
|
10 |
+
|
11 |
+
## The "bai-2.1" model, which performs emotion classification over EEG, is an optimised version of the previous model "bai-2.0" with reduced overfitting probability. All functions are the same.
|
12 |
+
|
13 |
+
#### NOTE: If you integrate the model into a real-time EEG data tracking application, it can predict emotions in real time. To access the application: https://github.com/neurazum/Realtime-EEG-Monitoring
|
14 |
+
|
15 |
+
**Doğruluk/Accuracy: %97.93621013133207**
|
16 |
+
|
17 |
+
## -----------------------------------------------------------------------------------
|
18 |
+
|
19 |
+
# Kullanım / Usage:
|
20 |
+
|
21 |
+
```python
|
22 |
+
import numpy as np
|
23 |
+
import pandas as pd
|
24 |
+
from sklearn.preprocessing import StandardScaler
|
25 |
+
from tensorflow.keras.models import load_model
|
26 |
+
import matplotlib.pyplot as plt
|
27 |
+
|
28 |
+
model_path = 'model-path'
|
29 |
+
|
30 |
+
model = load_model(model_path)
|
31 |
+
|
32 |
+
model_name = model_path.split('/')[-1].split('.')[0]
|
33 |
+
|
34 |
+
plt.figure(figsize=(10, 6))
|
35 |
+
plt.title(f'Duygu Tahmini ({model_name}.1)')
|
36 |
+
plt.xlabel('Zaman')
|
37 |
+
plt.ylabel('Sınıf')
|
38 |
+
plt.legend(loc='upper right')
|
39 |
+
plt.grid(True)
|
40 |
+
plt.show()
|
41 |
+
model.summary()
|
42 |
+
|
43 |
+
```
|
Main Models/bai-2.1/bai-2.1.keras
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:45802a2ab5115e4e866e6b11bda2161f0b0da6cf107ce607369950c92808c32d
|
3 |
+
size 4102623
|
Main Models/bai-2.2/README.md
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# bai-2.2 (338787 parametre)
|
2 |
+
|
3 |
+
## bai-2.0 ve 2.1 sürümlerinin daha hızlı ve optimize edilmiş versiyonudur. Tüm işlevleri aynıdır.
|
4 |
+
|
5 |
+
#### NOT: Gerçek zamanlı EEG veri takibi uygulamasına modeli entegre ederseniz, gerçek zamanlı olarak duygu tahmini yapabilmektedir. Uygulamaya erişebilmek için: https://github.com/neurazum/Realtime-EEG-Monitoring
|
6 |
+
|
7 |
+
## -----------------------------------------------------------------------------------
|
8 |
+
|
9 |
+
# bai-2.2 (338787 parameters)
|
10 |
+
|
11 |
+
## It is a faster and optimized version of bai-2.0 and 2.1. All functions are the same.
|
12 |
+
|
13 |
+
#### NOTE: If you integrate the model into a real-time EEG data tracking application, it can predict emotions in real time. To access the application: https://github.com/neurazum/Realtime-EEG-Monitoring
|
14 |
+
|
15 |
+
|
16 |
+
**Doğruluk/Accuracy: %94,8874296435272**
|
17 |
+
|
18 |
+
# Kullanım / Usage
|
19 |
+
|
20 |
+
```python
|
21 |
+
import numpy as np
|
22 |
+
import pandas as pd
|
23 |
+
from sklearn.preprocessing import StandardScaler
|
24 |
+
from tensorflow.keras.models import load_model
|
25 |
+
import matplotlib.pyplot as plt
|
26 |
+
|
27 |
+
model_path = 'model-path'
|
28 |
+
|
29 |
+
model = load_model(model_path)
|
30 |
+
|
31 |
+
model_name = model_path.split('/')[-1].split('.')[0]
|
32 |
+
|
33 |
+
plt.figure(figsize=(10, 6))
|
34 |
+
plt.title(f'Duygu Tahmini ({model_name}.1)')
|
35 |
+
plt.xlabel('Zaman')
|
36 |
+
plt.ylabel('Sınıf')
|
37 |
+
plt.legend(loc='upper right')
|
38 |
+
plt.grid(True)
|
39 |
+
plt.show()
|
40 |
+
model.summary()
|
41 |
+
```
|
42 |
+
|
43 |
+
# Tahmin / Prediction
|
44 |
+
|
45 |
+
```python
|
46 |
+
import numpy as np
|
47 |
+
import pandas as pd
|
48 |
+
from sklearn.preprocessing import StandardScaler
|
49 |
+
from tensorflow.keras.models import load_model
|
50 |
+
|
51 |
+
model_path = 'model-path'
|
52 |
+
|
53 |
+
model = load_model(model_path)
|
54 |
+
|
55 |
+
scaler = StandardScaler()
|
56 |
+
|
57 |
+
predictions = model.predict(X_new_reshaped)
|
58 |
+
predicted_labels = np.argmax(predictions, axis=1)
|
59 |
+
|
60 |
+
label_mapping = {'NEGATIVE': 0, 'NEUTRAL': 1, 'POSITIVE': 2}
|
61 |
+
label_mapping_reverse = {v: k for k, v in label_mapping.items()}
|
62 |
+
|
63 |
+
#new_input = np.array([[23, 465, 12, 9653] * 637])
|
64 |
+
new_input = np.random.rand(1, 2548) # 1 örnek ve 2548 özellik
|
65 |
+
new_input_scaled = scaler.fit_transform(new_input)
|
66 |
+
new_input_reshaped = new_input_scaled.reshape((new_input_scaled.shape[0], 1, new_input_scaled.shape[1]))
|
67 |
+
|
68 |
+
new_prediction = model.predict(new_input_reshaped)
|
69 |
+
predicted_label = np.argmax(new_prediction, axis=1)[0]
|
70 |
+
predicted_emotion = label_mapping_reverse[predicted_label]
|
71 |
+
|
72 |
+
if predicted_emotion == 'NEGATIVE':
|
73 |
+
predicted_emotion = 'Negatif'
|
74 |
+
elif predicted_emotion == 'NEUTRAL':
|
75 |
+
predicted_emotion = 'Nötr'
|
76 |
+
elif predicted_emotion == 'POSITIVE':
|
77 |
+
predicted_emotion = 'Pozitif'
|
78 |
+
|
79 |
+
print(f'Giriş Verileri: {new_input}')
|
80 |
+
print(f'Tahmin Edilen Duygu: {predicted_emotion}')
|
81 |
+
```
|
Main Models/bai-2.2/bai-2.2.keras
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:72ab4b95522f7d9b9354617f8bf996ab9ae2af28d777233b89cc1543dc1fe88f
|
3 |
+
size 2051948
|