EfficientNet-B2 facial-expression classifier
EmotiEffLib EfficientNet-B2 AffectNet checkpoint with eight visible-expression categories.
This repository contains immutable model artifacts used by Facetorch. Use the packaged Facetorch manifest to select a revision and artifact; do not treat mutable main or older unlisted files as a release contract.
Contract
| Field | Value |
|---|---|
| Model ID | fer-efficientnet-b2 |
| Architecture | TF EfficientNet-B2 with max pooling |
| Input | 260 by 260 RGB face crop |
| Output | Eight logits ordered as Anger, Contempt, Disgust, Fear, Happiness, Neutral, Sadness, Surprise. |
| Dynamic shapes | Batch dimension 1 through 64. |
| Weights license | Apache-2.0 |
Preprocessing: Resize to 260 by 260 and apply ImageNet mean [0.485, 0.456, 0.406] and standard deviation [0.229, 0.224, 0.225].
Release artifacts
| File | Format | Runtime | Devices | SHA-256 |
|---|---|---|---|---|
model-torch2.6.pt2 |
pt2 | >=2.6, <2.7 | cpu, cuda | faf0adb86eaf6f45e0511f41a4f0f41df2069da0216371132101b28e017a8320 |
model-torch2.11.pt2 |
pt2 | >=2.11, <2.12 | cpu, cuda | 5247f93acebf092290ec56e48bebf4220b58f07d3bd4d9907f07b532c42d09bc |
model.pt |
torchscript | >=2.6, <2.12 | cpu | 91672ff45602901b1631db910ec2e65db21def35bda550c5f4e30a75361c9bdd |
Facetorch v1 supports the Torch 2.6 and 2.11 cohort files listed in its manifest. The legacy TorchScript object is CPU-only and requires the explicit legacy opt-in. Files from unsupported cohorts are not part of the v1 release contract.
Loading the manifest-selected artifact
import torch
from huggingface_hub import hf_hub_download
from facetorch.artifacts import get_model_manifest
MODEL_ID = "fer-efficientnet-b2"
device = "cuda" if torch.cuda.is_available() else "cpu"
artifact = get_model_manifest().candidates(
MODEL_ID,
torch_version=torch.__version__,
device=device,
allow_legacy_models=False,
)[0]
path = hf_hub_download(
repo_id=artifact.repo_id,
revision=artifact.revision,
filename=artifact.filename,
)
model = torch.export.load(path).module().to(device).eval()
example = torch.randn(1, 3, 260, 260, device=device)
with torch.inference_mode():
output = model(example)
The random tensor above is only a loading smoke test. Use Facetorch's documented preprocessing for meaningful inference.
Provenance
| Upstream | Immutable revision | Role | License |
|---|---|---|---|
| https://github.com/sb-ai-lab/EmotiEffLib | 520a051c64cd191521e5934655314e769a319684 |
checkpoint publisher and architecture source | Apache-2.0 |
| Upstream checkpoint | SHA-256 | Source |
|---|---|---|
models/affectnet_emotions/enet_b2_8.pt |
20c8bb3ae6dace81b2ac51c8418bee508d86f14006566ecdfafdfd6d6acba14d |
publisher location |
Mapping method: exact_tensor_equality.
Result: 508 of 508 tensors matched exactly.
The repository owner approved the mapping and redistribution record on 2026-08-23. Under the recorded policy, an author-published checkpoint in a permissively licensed repository with no separate checkpoint terms uses that repository license. MIT and Apache-2.0 have not been converted or treated as interchangeable. See LICENSE, THIRD_PARTY_NOTICES.md, and Facetorch's facetorch/models/governance.json.
Papers
Intended use
- Research classification of visible facial-expression categories.
Limitations and responsible use
- Expression labels do not establish emotion, intent, mental state, or truthfulness.
- Performance varies with culture, context, demographic representation, pose, and image quality.
- The checkpoint license does not grant rights to AffectNet or other training datasets.
- The artifact license does not itself license training datasets, input data, or a deployment's processing of personal data.
- Do not use model output as the sole basis for consequential decisions about a person.