Instructions to use wesjos/fairface-monkeycake-3task-224 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use wesjos/fairface-monkeycake-3task-224 with timm:
import timm model = timm.create_model("hf-hub:wesjos/fairface-monkeycake-3task-224", pretrained=True) - Notebooks
- Google Colab
- Kaggle
Translate model card to English (README.md)
Browse files
README.md
CHANGED
|
@@ -1,97 +1,96 @@
|
|
| 1 |
-
---
|
| 2 |
language:
|
| 3 |
-
- zh
|
| 4 |
- en
|
| 5 |
-
license: cc-by-4.0
|
| 6 |
-
library_name: pytorch
|
| 7 |
-
pipeline_tag: image-classification
|
| 8 |
-
tags:
|
| 9 |
-
- image-classification
|
| 10 |
-
- fairface
|
| 11 |
-
- face-attribute
|
| 12 |
-
- pytorch
|
| 13 |
-
- timm
|
| 14 |
-
datasets:
|
| 15 |
-
- HuggingFaceM4/FairFace
|
| 16 |
-
base_model: timm/eva02_large_patch14_224.mim_in22k
|
| 17 |
-
metrics:
|
| 18 |
-
- accuracy
|
| 19 |
-
- f1
|
| 20 |
-
---
|
| 21 |
-
# FairFace-MonkeyCake-3Task-224
|
| 22 |
-
|
| 23 |
-
##
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
>
|
| 29 |
-
|
| 30 |
-
##
|
| 31 |
-
|
| 32 |
-
|
|
| 33 |
-
|---|---|
|
| 34 |
-
|
|
| 35 |
-
|
|
| 36 |
-
|
|
| 37 |
-
|
|
| 38 |
-
|
|
| 39 |
-
|
|
| 40 |
-
|
| 41 |
-
##
|
| 42 |
-
|
| 43 |
-
[HuggingFaceM4/FairFace](https://huggingface.co/datasets/HuggingFaceM4/FairFace)(Karkkainen & Joo, WACV 2021),原始 97,698 张。本项目按 SHA-256 内容去重后:
|
| 44 |
-
train 77,926 / selection 8,659 / test 10,931,三对交集为 0,官方 train 的图 0 张进入测试集。
|
| 45 |
-
|
| 46 |
-
##
|
| 47 |
-
|
| 48 |
-
|
|
| 49 |
-
|---|---:|---:|
|
| 50 |
-
|
|
| 51 |
-
|
|
| 52 |
-
|
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
##
|
| 57 |
-
|
| 58 |
-

|
| 59 |
-
|
| 60 |
-

|
| 61 |
-
|
| 62 |
-
##
|
| 63 |
-
|
| 64 |
-
```python
|
| 65 |
-
import inference
|
| 66 |
-
|
| 67 |
-
model = inference.load("model.pt")
|
| 68 |
-
print(inference.predict(model, "face.jpg"))
|
| 69 |
-
```
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
##
|
| 74 |
-
|
| 75 |
-
- **
|
| 76 |
-
- **
|
| 77 |
-
- **
|
| 78 |
-
- **已知群体差异**:种族边界(尤其 Latino / Middle Eastern / Indian / White 之间)本身模糊;
|
| 79 |
-
年龄是最弱的一项;部分性别×种族子群错误率显著偏高。
|
| 80 |
-
- **
|
| 81 |
-
|
| 82 |
-
##
|
| 83 |
-
|
| 84 |
-
-
|
| 85 |
-
-
|
| 86 |
-
-
|
| 87 |
-
|
| 88 |
-
##
|
| 89 |
-
|
| 90 |
-
```bibtex
|
| 91 |
-
@inproceedings{karkkainen2021fairface,
|
| 92 |
-
title={FairFace: Face Attribute Dataset for Balanced Race, Gender, and Age for Bias Measurement and Mitigation},
|
| 93 |
-
author={Karkkainen, Kimmo and Joo, Jungseock},
|
| 94 |
-
booktitle={WACV},
|
| 95 |
-
year={2021}
|
| 96 |
-
}
|
| 97 |
-
```
|
|
|
|
| 1 |
+
---
|
| 2 |
language:
|
|
|
|
| 3 |
- en
|
| 4 |
+
license: cc-by-4.0
|
| 5 |
+
library_name: pytorch
|
| 6 |
+
pipeline_tag: image-classification
|
| 7 |
+
tags:
|
| 8 |
+
- image-classification
|
| 9 |
+
- fairface
|
| 10 |
+
- face-attribute
|
| 11 |
+
- pytorch
|
| 12 |
+
- timm
|
| 13 |
+
datasets:
|
| 14 |
+
- HuggingFaceM4/FairFace
|
| 15 |
+
base_model: timm/eva02_large_patch14_224.mim_in22k
|
| 16 |
+
metrics:
|
| 17 |
+
- accuracy
|
| 18 |
+
- f1
|
| 19 |
+
---
|
| 20 |
+
# FairFace-MonkeyCake-3Task-224
|
| 21 |
+
|
| 22 |
+
## Overview
|
| 23 |
+
|
| 24 |
+
A face attribute classification model based on **EVA02-L/14 (MIM-22K)**, trained on the [HuggingFaceM4/FairFace](https://huggingface.co/datasets/HuggingFaceM4/FairFace) dataset.
|
| 25 |
+
Predicts three attributes: race, gender, and age.
|
| 26 |
+
|
| 27 |
+
> Teacher model with highest overall accuracy; 303M parameters and 344 img/s. Best suited for offline benchmarking rather than real-time edge deployment.
|
| 28 |
+
|
| 29 |
+
## Model Details
|
| 30 |
+
|
| 31 |
+
| Field | Value |
|
| 32 |
+
|---|---|
|
| 33 |
+
| Backbone | EVA02-L/14 (MIM-22K) ([timm/eva02_large_patch14_224.mim_in22k](https://huggingface.co/timm/eva02_large_patch14_224.mim_in22k)) |
|
| 34 |
+
| Parameters | 303,286,225 |
|
| 35 |
+
| Input | RGB, 224×224 |
|
| 36 |
+
| Normalization | mean=(0.4815, 0.4578, 0.4082), std=(0.2686, 0.2613, 0.2758) |
|
| 37 |
+
| Output | race (7 classes) + gender (2 classes) + age (8 ordinal thresholds / 9 brackets) |
|
| 38 |
+
| Test Set | 10,931 images (frozen deduplicated FairFace official val set) |
|
| 39 |
+
|
| 40 |
+
## Training Data
|
| 41 |
+
|
| 42 |
+
[HuggingFaceM4/FairFace](https://huggingface.co/datasets/HuggingFaceM4/FairFace)(Karkkainen & Joo, WACV 2021),原始 97,698 张。本项目按 SHA-256 内容去重后:
|
| 43 |
+
train 77,926 / selection 8,659 / test 10,931,三对交集为 0,官方 train 的图 0 张进入测试集。
|
| 44 |
+
|
| 45 |
+
## Evaluation Results
|
| 46 |
+
|
| 47 |
+
| Task | Accuracy | Macro-F1 |
|
| 48 |
+
|---|---:|---:|
|
| 49 |
+
| Race (7 classes) | 77.02% | 76.83% |
|
| 50 |
+
| Gender (2 classes) | 96.87% | 96.86% |
|
| 51 |
+
| Age (9 ordinal brackets) | 63.93% | 61.29% |
|
| 52 |
+
|
| 53 |
+
3-Task average accuracy: **79.27%**. Age MAE: **0.3838 brackets**, ±1 bracket accuracy: **97.94%**.
|
| 54 |
+
|
| 55 |
+
## Per-Class Performance
|
| 56 |
+
|
| 57 |
+

|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
|
| 61 |
+
## Usage
|
| 62 |
+
|
| 63 |
+
```python
|
| 64 |
+
import inference
|
| 65 |
+
|
| 66 |
+
model = inference.load("model.pt")
|
| 67 |
+
print(inference.predict(model, "face.jpg"))
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
Dependencies: `torch`, `timm`, `torchvision`, `pillow`.
|
| 71 |
+
|
| 72 |
+
## Limitations & Ethical Considerations
|
| 73 |
+
|
| 74 |
+
- **Research Use Only**: This model is developed strictly for face attribute research, bias measurement, and fairness auditing. **It must NOT be used for surveillance, identity verification, recruitment, credit evaluation, or any high-risk automated decision-making.**
|
| 75 |
+
- **Test Set Reuse**: This frozen test set was evaluated multiple times across project iterations; reported metrics are descriptive.
|
| 76 |
+
- **Single Random Seed**: Training was conducted under a single seed; differences smaller than 0.3 pp should be treated as noise.
|
| 77 |
+
- **已知群体差异**:种族边界(尤其 Latino / Middle Eastern / Indian / White 之间)本身模糊;
|
| 78 |
+
年龄是最弱的一项;部分性别×种族子群错误率显著偏高。
|
| 79 |
+
- **Label Attribution**: Labels reflect the categorical annotations of the FairFace dataset and do not represent individual identity, ethnicity, or personal self-identification.
|
| 80 |
+
|
| 81 |
+
## Data & Licensing
|
| 82 |
+
|
| 83 |
+
- **Dataset**: [HuggingFaceM4/FairFace](https://huggingface.co/datasets/HuggingFaceM4/FairFace), CC BY 4.0 (images sourced from YFCC100M under respective licenses).
|
| 84 |
+
- **Model Checkpoint**: Derivative work trained on FairFace, released under CC BY 4.0.
|
| 85 |
+
- **Pretrained Backbone**: [timm/eva02_large_patch14_224.mim_in22k](https://huggingface.co/timm/eva02_large_patch14_224.mim_in22k) (see upstream release for original license).EVA02-L/14 (MIM-22K)(原始许可见其发布页)。
|
| 86 |
+
|
| 87 |
+
## Citation
|
| 88 |
+
|
| 89 |
+
```bibtex
|
| 90 |
+
@inproceedings{karkkainen2021fairface,
|
| 91 |
+
title={FairFace: Face Attribute Dataset for Balanced Race, Gender, and Age for Bias Measurement and Mitigation},
|
| 92 |
+
author={Karkkainen, Kimmo and Joo, Jungseock},
|
| 93 |
+
booktitle={WACV},
|
| 94 |
+
year={2021}
|
| 95 |
+
}
|
| 96 |
+
```
|