HoneyDog — MobileNetV4-Medium 31-Attribute Facial Predictor
A compact multi-task facial attribute model: one forward pass returns 3 mutually exclusive softmax groups (age, race, face shape) plus 22 binary attributes.
Backbone: MobileNetV4-Conv-Medium (mobilenetv4_conv_medium, 9.11 M nominal parameters),
initialised from ImageNet-1K weights and fine-tuned end-to-end on the full VGGFace2
(3,057,398 face images / 8,414 identities).
This is not a transformers model. It is a plain PyTorch checkpoint loaded by the
inference.py shipped in this repo — Hub's autogenerated pipeline() snippets do not apply.
Model specifications
| Item | Value |
|---|---|
| Backbone | mobilenetv4_conv_medium (timm) |
| Parameters | 9,108,850 (measured on the released checkpoint) |
| Checkpoint | model.pt, 70.4 MiB (73,801,483 bytes) — holds both model and ema state dicts; load() uses ema, which is the copy this run selected (use_ema: true) |
| Input | RGB, resized to 224×224 (BICUBIC), ImageNet mean/std |
| Outputs | 3 softmax heads (4 classes each) + 22 sigmoid attributes = 25 output heads |
| Best epoch | 7 (full-train run, 12 epochs) |
Output heads:
age—Young,Middle_Aged,Senior,OTHERrace—Asian,White,Black,OTHERface_shape—Oval_Face,Square_Face,Round_Face,OTHER- 22 binary attributes (sigmoid, threshold 0.5):
Beard,Eyeglasses,Obstructed_Forehead,Arched_Eyebrows,Male,Rosy_Cheeks,Wavy_Hair,Receding_Hairline,Bangs,Double_Chin,High_Cheekbones,Chubby,Brown_Eyes,Bags_Under_Eyes,Mouth_Closed,Smiling,Big_Nose,Heavy_Makeup,Wearing_Hat,Wearing_Earrings,Wearing_Necktie,Wearing_Lipstick
Evaluation
Held-out, fully frozen test split of 25,401 images (never seen during training).
Numbers below are copied from metrics.json in this repo.
| Metric | Value |
|---|---|
| Macro balanced accuracy | 95.45 % |
| Macro F1 | 94.01 % |
| Weakest single attribute (balanced accuracy) | 89.44 % (age) |
| Attributes below 60 % balanced accuracy | 0 |
| Attributes below 80 % balanced accuracy | 0 |
Usage
pip install torch torchvision timm pillow
import json
from inference import load, predict
device = "cuda" if torch.cuda.is_available() else "cpu"
model = load(device=device) # loads ./model.pt next to inference.py
result = predict(model, "face_example.jpg", device=device)
print(json.dumps(result, indent=2))
result["groups"][<age|race|face_shape>] holds the predicted class, its confidence and the full
probability vector; result["attributes"][<attribute>] holds {"present": bool, "confidence": float}.
Command line:
python inference.py face_example.jpg
Files
| File | Size | Purpose |
|---|---|---|
model.pt |
70.4 MiB | Checkpoint (ema key holds the inference weights) |
inference.py |
4.0 KB | Self-contained model definition + load() / predict() |
metrics.json |
517 B | Full evaluation record for the test split |
Limitations
- Attribute labels come from dataset annotation (VGGFace2 images + MAAD-Face annotations); they are
coarse, partly noisy, and the
OTHERclass absorbs anything outside the three named classes. - VGGFace2 is celebrity-skewed, so age/race/face-shape predictions inherit that bias.
- Accuracy drops on occluded, very low-resolution, or strongly rotated faces; the model was trained on 224×224 crops.
- Single-face, single-image classifier: no detection, no alignment, no identity/recognition.
- Demographic attributes are sensitive. Treat the outputs as noisy estimates for research or dataset-analytics use — not as grounds for decisions about individuals.
Data sources and citations
Trained on VGGFace2 images with MAAD-Face annotations. If you use this model or derivatives, follow the respective dataset licences and cite:
@inproceedings{cao2018vggface2,
title={VGGFace2: A dataset for recognising faces across pose and age},
author={Cao, Qiong and Shen, Li and Xie, Weidi and Parkhi, Omkar M and Zisserman, Andrew},
booktitle={2018 13th IEEE International Conference on Automatic Face & Gesture Recognition (FG 2018)},
pages={67--74},
year={2018},
organization={IEEE}
}
@article{terhorst2021maad,
title={MAAD-Face: A massively annotated attribute dataset for face recognition},
author={Terhorst, Philipp and Huber, Marco and Luu, Nhan and Fayyad, Fadi and Kirchbuchner, Florian and Kuijper, Arjan},
journal={IEEE Transactions on Information Forensics and Security},
volume={16},
pages={3942--3957},
year={2021},
publisher={IEEE}
}
@article{qin2024mobilenetv4,
title={MobileNetV4--Universal Models for the Mobile Ecosystem},
author={Qin, Danfeng and Leichner, Chas and Delakis, Manolis and Fornoni, Marco and Luo, Shuyang and Yang, Fan and Wang, Weijun and Banbury, Colby and Cheng, Yu and Bapst, Victor and others},
journal={arXiv preprint arXiv:2404.10518},
year={2024}
}