Supervised ResNet-18 on RAF-DB, 400 labelled images
The supervised-only control: the same backbone and schedule trained with cross-entropy on 400 labelled images and no unlabelled data. This is the checkpoint behind the 400 row of the report.
| field | value |
|---|---|
| backbone | ResNet-18, MS-Celeb-1M pretrained, 224x224 |
| trained on | 400 labelled + 11,871 unlabelled RAF-DB training images |
| seed | 5 |
| test accuracy | 70.80% |
| macro-F1 | 62.30% |
| ECE (10 bins) | 0.256 |
The other budgets are published as
phungthanhtu/rafdb-fer-supervised-{100,400,2000,4000}. This repository ships seed
5; the other seeds of the study are available on request.
Files
| file | what |
|---|---|
model.pt |
weights + config + class names + metrics (no pickled classes) |
model.py |
standalone network, load(), predict() |
example.py |
command line demo |
Quickstart
pip install torch torchvision pillow huggingface_hub
python example.py face.jpg
from huggingface_hub import hf_hub_download
import torch, model
net = model.load("phungthanhtu/rafdb-fer-adacm-400")
print(model.predict(net, "face.jpg"))
model.load downloads the weights, rebuilds the network and returns it in eval
mode; nothing from the training pipeline is needed.
Classes
Surprise, Fear, Disgust, Happiness, Sadness, Anger, Neutral
Preprocessing
Resize the shorter side to 224, ToTensor, then normalise with
mean=[0.485, 0.456, 0.406] and std=[0.229, 0.224, 0.225]. Training used random resized crops and RandAugment;
inference uses neither.
Intended use and limits
Research use on aligned face images, the same kind as RAF-DB. The model was trained on 400 labelled faces, so it is weakest on fear, sadness and neutral, which are the classes most often confused in the report. RAF-DB is licensed for non-commercial research; do not use this checkpoint on people in production.