Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: ko
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- video-classification
|
| 6 |
+
- cnn-lstm
|
| 7 |
+
- pytorch
|
| 8 |
+
- confusion-detection
|
| 9 |
+
- daiSEE
|
| 10 |
+
datasets:
|
| 11 |
+
- daiSEE
|
| 12 |
+
metrics:
|
| 13 |
+
- accuracy
|
| 14 |
+
- f1
|
| 15 |
+
- precision
|
| 16 |
+
- recall
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
## Colab Notebook
|
| 20 |
+
|
| 21 |
+
์๋ Colab์์ ๋ชจ๋ธ์ ์ง์ ์คํํ๊ณ ํ
์คํธํ ์ ์์ต๋๋ค.
|
| 22 |
+
|
| 23 |
+
[](https://colab.research.google.com/drive/1OkrPq9Cc0kXllSUFG24C-Xz6zZm45Izx?authuser=1#scrollTo=ixU-OYlQ2o79)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
# Face Comprehension: Confusion Binary Classification
|
| 27 |
+
|
| 28 |
+
์ด ๋ชจ๋ธ์ **DAiSEE ๋ฐ์ดํฐ์
**์ ๊ธฐ๋ฐ์ผ๋ก ์ฌ๋์ ํ์ ยทํ๋์ ๋ถ์ํ์ฌ **Confusion(ํผ๋)** ์ฌ๋ถ๋ฅผ ์ด์ง ๋ถ๋ฅํ๋ **๋น๋์ค ์ดํด ๋ชจ๋ธ**์
๋๋ค.
|
| 29 |
+
Confusion ๋ ์ด๋ธ(0~3)์ **0: Not Confused vs 1: Confused(1~3)** ๋ก ๋จ์ํํ์ฌ ํ์ตํ์์ต๋๋ค.
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
## ๋ชจ๋ธ ๊ตฌ์กฐ (Model Architecture)
|
| 34 |
+
|
| 35 |
+
- **Backbone**: MobileNetV2 (ImageNet ์ฌ์ ํ์ต ๊ฐ์ค์น ์ฌ์ฉ, ์ผ๋ถ ๋ ์ด์ด ๊ณ ์ )
|
| 36 |
+
- **Sequence Modeling**: LSTM (hidden_dim=256, num_layers=2)
|
| 37 |
+
- **Attention Mechanism**: Temporal Attention ์ ์ฉ
|
| 38 |
+
- **Classifier**: Fully-connected layer (2 ํด๋์ค: Not Confused / Confused)
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## ํ์ต ๋ฐ์ดํฐ (Dataset)
|
| 43 |
+
|
| 44 |
+
- **DAiSEE Dataset** (ํด๋์ค: Boredom, Confusion, Engagement, Frustration ์ค Confusion๋ง ์ฌ์ฉ)
|
| 45 |
+
- ๋ ์ด๋ธ ๋งคํ:
|
| 46 |
+
- Confusion = 0 โ Not Confused (0)
|
| 47 |
+
- Confusion = 1~3 โ Confused (1)
|
| 48 |
+
- ์
๋ ฅ ๋ฐ์ดํฐ: ๋น๋์ค ํ๋ ์ (sequence_length=30, image_size=112ร112)
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## ํ์ต ์ ์ฐจ (Training Procedure)
|
| 53 |
+
|
| 54 |
+
- Optimizer: Adam (lr=0.001)
|
| 55 |
+
- Loss: Weighted CrossEntropyLoss (Class imbalance ๋ณด์ )
|
| 56 |
+
- Not Confused: 67.5%, Confused: 32.5% โ ๊ฐ์ค์น ๋น์จ ์ฝ 1 : 2.1
|
| 57 |
+
- Scheduler: ReduceLROnPlateau (patience=3, factor=0.5)
|
| 58 |
+
- Epochs: 3~10 (์ต์
์ ๋ฐ๋ผ ๋ณ๊ฒฝ ๊ฐ๋ฅ)
|
| 59 |
+
- Batch Size: 8~16
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
## ์ฌ์ฉ ๋ฐฉ๋ฒ (How to Use)
|
| 64 |
+
|
| 65 |
+
```python
|
| 66 |
+
import torch
|
| 67 |
+
from face import DAiSEEConfusionNet
|
| 68 |
+
|
| 69 |
+
# ๋ชจ๋ธ ๋ก๋
|
| 70 |
+
model = DAiSEEConfusionNet()
|
| 71 |
+
model.load_state_dict(torch.load("confusion_binary_model.pth", map_location="cpu"))
|
| 72 |
+
model.eval()
|
| 73 |
+
|
| 74 |
+
# ์
๋ ฅ: (batch, seq_len, C, H, W)
|
| 75 |
+
dummy_input = torch.randn(1, 30, 3, 112, 112)
|
| 76 |
+
outputs = model(dummy_input)
|
| 77 |
+
|
| 78 |
+
prediction = torch.argmax(outputs, dim=1).item()
|
| 79 |
+
print("์์ธก ๊ฒฐ๊ณผ:", "Confused" if prediction == 1 else "Not Confused")
|