Views
No views yet
data_mining
course project for face verification on the 6,000-pair LFW protocol.| Checkpoint | Backbone | Training setup | LFW 10-fold accuracy | ROC AUC |
|---|---|---|---|---|
models/self_hsd_ir18_arcface/epoch_024.pth | IR-ResNet18 | ArcFace + hard-example self-distillation | 94.7167% | 0.974148 |
models/advanced_ir18_arcface/epoch_020.pth | IR-ResNet18 | ArcFace from scratch | 94.1167% | 0.971984 |
models/scratch_casia_arcface/epoch_021.pth | InceptionResnetV1 | ArcFace from scratch | 86.4833% | 0.930206 |
margin=16, image_size=112,
and the provided design/lfw_test_pair.txt pair list.models/*/*.pth: PyTorch checkpoints.models/*/best_lfw.json: best-checkpoint metadata.models/*/training_config.json and history.json: training configuration and logs.src/: training, evaluation, and backbone definition code.results/*: selected LFW metrics, plots, and pair scores.docs/PROJECT_README.md: original project README.reports/: project reports..pth file is a PyTorch checkpoint dictionary. Important keys:backbone: canonical backbone name.backbone_state_dict: embedding backbone weights.arcface_state_dict: ArcFace classification head weights used during training.optimizer_state_dict and scheduler_state_dict: training resume state.epoch, num_classes, and training metadata.backbone_state_dict.1import sys
2
3import torch
4import torch.nn.functional as F
5
6sys.path.append("src")
7from face_backbones import build_backbone
8
9checkpoint_path = "models/self_hsd_ir18_arcface/epoch_024.pth"
10payload = torch.load(checkpoint_path, map_location="cpu")
11
12model, _, _ = build_backbone(payload.get("backbone", "ir_resnet18"), pretrained_model=None)
13model.load_state_dict(payload["backbone_state_dict"], strict=True)
14model.eval()
15
16# `batch` should be an aligned RGB face tensor of shape [N, 3, 112, 112],
17# standardized with facenet_pytorch.fixed_image_standardization.
18with torch.no_grad():
19 embeddings = F.normalize(model(batch), p=2, dim=1)1python src/evaluate_lfw.py \
2 --lfw-root data/raw/lfw-deepfunneled \
3 --pairs-file design/lfw_test_pair.txt \
4 --checkpoint models/self_hsd_ir18_arcface/epoch_024.pth \
5 --preprocess mtcnn \
6 --mtcnn-margin 16 \
7 --image-size 112 \
8 --batch-size 512 \
9 --num-workers 0 \
10 --device cuda \
11 --output-dir results/self_hsd_ir18_lfw_epoch24_margin16requirements.txt or environment.yml. The project
uses facenet-pytorch==2.6.0 --no-deps because its package metadata pins an
older PyTorch version.