Add R(2+1)D-18 exam behavior classifier + model card
Browse files- README.md +48 -0
- best_model.pt +3 -0
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
pipeline_tag: video-classification
|
| 4 |
+
tags:
|
| 5 |
+
- video
|
| 6 |
+
- action-recognition
|
| 7 |
+
- r2plus1d
|
| 8 |
+
- pytorch
|
| 9 |
+
library_name: pytorch
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Exam Behavior Classifier — R(2+1)D-18
|
| 13 |
+
|
| 14 |
+
Classifies a short clip of a single student into one of five exam behaviors:
|
| 15 |
+
**normal, copying, gesture, mobile, notes**.
|
| 16 |
+
|
| 17 |
+
- **Architecture:** torchvision `r2plus1d_18`, Kinetics-400 pretrained, 5-way head.
|
| 18 |
+
- **Input:** 16 uniformly-sampled frames, center-cropped to 112×112, Kinetics normalization.
|
| 19 |
+
- **Training data:** 251 clips from the Kaggle *ExamCheating_MultiV* dataset (V1 prefix-labeled
|
| 20 |
+
+ 30 hand-labeled V2 clips).
|
| 21 |
+
- **Test (n=38, leakage-free group split):** accuracy **71.1%**, macro-F1 **0.680**.
|
| 22 |
+
On the original clean distribution: 78.8%; on out-of-distribution phone footage: 20% —
|
| 23 |
+
see the repo for the full distribution-gap analysis.
|
| 24 |
+
|
| 25 |
+
⚠️ **Research & education only — not a proctoring system.** Outputs are suggestions for a
|
| 26 |
+
human to review, never evidence of cheating. Full limitations and ethics discussion in the
|
| 27 |
+
[model card](https://github.com/MunkhbayarA/exam-cheating-detection/blob/main/model_card.md).
|
| 28 |
+
|
| 29 |
+
**Code, training pipeline, and demo app:**
|
| 30 |
+
[github.com/MunkhbayarA/exam-cheating-detection](https://github.com/MunkhbayarA/exam-cheating-detection)
|
| 31 |
+
|
| 32 |
+
## Usage
|
| 33 |
+
|
| 34 |
+
```python
|
| 35 |
+
import torch, torch.nn as nn
|
| 36 |
+
from torchvision.models.video import r2plus1d_18
|
| 37 |
+
from huggingface_hub import hf_hub_download
|
| 38 |
+
|
| 39 |
+
CLASSES = ["normal", "copying", "gesture", "mobile", "notes"]
|
| 40 |
+
|
| 41 |
+
ckpt_path = hf_hub_download("mbradiant/exam-behavior-classifier", "best_model.pt")
|
| 42 |
+
ckpt = torch.load(ckpt_path, map_location="cpu", weights_only=True)
|
| 43 |
+
model = r2plus1d_18()
|
| 44 |
+
model.fc = nn.Linear(model.fc.in_features, len(CLASSES))
|
| 45 |
+
model.load_state_dict(ckpt["model"])
|
| 46 |
+
model.eval()
|
| 47 |
+
# input: float tensor (B, 3, 16, 112, 112), Kinetics-normalized
|
| 48 |
+
```
|
best_model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6b27fe67b3394bb906ad8a32bb71eebf2741ab91b9445b610b25f90779cabac2
|
| 3 |
+
size 125388894
|