AI SeedbankHelp preserve open and free AI for humanity's future

← All models

audeering_wav2vec2-large-robust-24-ft-age-gender

audeering · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: · Leechers:

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


datasets:

  • agender
  • mozillacommonvoice
  • timit
  • voxceleb2 inference: true tags:
  • speech
  • audio
  • wav2vec2
  • audio-classification
  • age-recognition
  • gender-recognition license: cc-by-nc-sa-4.0 base_model:
  • facebook/wav2vec2-large-robust

Model for Age and Gender Recognition based on Wav2vec 2.0 (24 layers)

The model expects a raw audio signal as input and outputs predictions for age in a range of approximately 0...1 (0...100 years) and gender expressing the probababilty for being child, female, or male. In addition, it also provides the pooled states of the last transformer layer. The model was created by fine-tuning Wav2Vec2-Large-Robust on aGender, Mozilla Common Voice, Timit and Voxceleb 2. For this version of the model we trained all 24 transformer layers. An ONNX export of the model is available from doi:10.5281/zenodo.7761387. Further details are given in the associated paper and tutorial.

Usage

import numpy as np
import torch
import torch.nn as nn
from transformers import Wav2Vec2Processor
from transformers.models.wav2vec2.modeling_wav2vec2 import (
    Wav2Vec2Model,
    Wav2Vec2PreTrainedModel,
)


class ModelHead(nn.Module):
    r"""Classification head."""

    def __init__(self, config, num_labels):

        super().__init__()

        self.dense = nn.Linear(config.hidden_size, config.hidden_size)
        self.dropout = nn.Dropout(config.final_dropout)
        self.out_proj = nn.Linear(config.hidden_size, num_labels)

    def forward(self, features, **kwargs):

        x = features
        x = self.dropout(x)
        x = self.dense(x)
        x = torch.tanh(x)
        x = self.dropout(x)
        x = self.out_proj(x)

        return x


class AgeGenderModel(Wav2Vec2PreTrainedModel):
    r"""Speech emotion classifier."""

    def __init__(self, config):

        super().__init__(config)

        self.config = config
        self.wav2vec2 = Wav2Vec2Model(config)
        self.age = ModelHead(config, 1)
        self.gender = ModelHead(config, 3)
        self.init_weights()

    def forward(
            self,
            input_values,
    ):

        outputs = self.wav2vec2(input_values)
        hidden_states = outputs[0]
        hidden_states = torch.mean(hidden_states, dim=1)
        logits_age = self.age(hidden_states)
        logits_gender = torch.softmax(self.gender(hidden_states), dim=1)

        return hidden_states, logits_age, logits_gender



# load model from hub
device = 'cpu'
model_name = 'audeering/wav2vec2-large-robust-24-ft-age-gender'
processor = Wav2Vec2Processor.from_pretrained(model_name)
model = AgeGenderModel.from_pretrained(model_name)

# dummy signal
sampling_rate = 16000
signal = np.zeros((1, sampling_rate), dtype=np.float32)


def process_func(
    x: np.ndarray,
    sampling_rate: int,
    embeddings: bool = False,
) -> np.ndarray:
    r"""Predict age and gender or extract embeddings from raw audio signal."""

    # run through processor to normalize signal
    # always returns a batch, so we just get the first entry
    # then we put it on the device
    y = processor(x, sampling_rate=sampling_rate)
    y = y['input_values'][0]
    y = y.reshape(1, -1)
    y = torch.from_numpy(y).to(device)

    # run through model
    with torch.no_grad():
        y = model(y)
        if embeddings:
            y = y[0]
        else:
            y = torch.hstack([y[1], y[2]])

    # convert to numpy
    y = y.detach().cpu().numpy()

    return y


print(process_func(signal, sampling_rate))
#    Age        female     male       child
# [[ 0.33793038 0.2715511  0.2275236  0.5009253 ]]

print(process_func(signal, sampling_rate, embeddings=True))
# Pooled hidden states of last transformer layer
# [[ 0.024444    0.0508722   0.04930823 ...  0.07247854 -0.0697901
#   -0.0170537 ]]

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:59002b91d953a0b8c8c6ef648b048555eccf40af&dn=audeering_wav2vec2-large-robust-24-ft-age-gender

Open magnet in torrent client · infohash 59002b91d953a0b8c8c6ef648b048555eccf40af

Files & hashes

PathSizesha1sha256
LICENSE20.4 KB (20,850 B)7cdbe0b482f604a06a0988dad8877ae8d9257f7de66c269d4819aaab34b49ef5220c4ddab6756f21bb5180761a4eb8561f2b7bbd
README.md4.1 KB (4,199 B)ebb78acd37e410b7b6ad56e53abd94497990e9a25e6fdce50df2fa08b397463167f578f927ed479fa6bcf1e5cafb69d121aeeefe
config.json2.3 KB (2,402 B)17118039a42b1eb18d35d74d4f6b7e0cf097e675ba3723c2258e4d5531e0fb51956d7b64389cfebeadc311e96df10c312a1c08b2
model.safetensors1.18 GB (1,270,221,176 B)72ea46864356991010d36bf735e68114d8b137c35868cc9548a1dba701654ae4e0599104ba734eb0b3f0a03384f9180d2dfb06a5
preprocessor_config.json214 B (214 B)73caa151574001d3d495fae897e1d3896824971260ca5a31e13f69ee2fbf147504c8676db5f6398fd7a6b12294341dff838edfcf
pytorch_model.bin1.18 GB (1,270,310,981 B)9972655576054294d61e44e7310d3fd1f97971ea5c630cf42d0c47ca32324fb54f73564cf6c0df187fa1ae6843d0d7725e2c073f
vocab.json3 B (3 B)0967ef424bce6791893e9a57bb952f80fd536e93ca3d163bab055381827226140568f3bef7eaac187cebd76878e0b63e9e442356

Cite this release

Canonical URL
https://aiseedbank.org/models/audeering_wav2vec2-large-robust-24-ft-age-gender/
Slug
audeering_wav2vec2-large-robust-24-ft-age-gender
Infohash
59002b91d953a0b8c8c6ef648b048555eccf40af
License
cc-by-nc-sa-4.0
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: audeering_wav2vec2-large-robust-24-ft-age-gender.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositoryaudeering/wav2vec2-large-robust-24-ft-age-gender
Revision (pinned)bad2737f529168bc3d3fcd97edfaba9583c7d36d
Fetched at2026-09-03T20:58:24Z
License at fetchcc-by-nc-sa-4.0
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-09-03T20:58:50Z

cc-by-nc-sa-4.0non-commercial use only2.37 GB (2,540,559,825 bytes)transformerspytorchsafetensorswav2vec2speechaudioaudio-classificationage-recognitiongender-recognitionendpoints_compatiblepaper: 2306.16962