Audio Classification
Transformers
Safetensors
Chinese
genaid
feature-extraction
accent-recognition
speaker-disentanglement
wav2vec2
custom_code
Run this model with HF Jobs
Run walston/GenAID on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/walston/GenAID. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/walston/GenAID on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use walston/GenAID with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use walston/GenAID with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("audio-classification", model="walston/GenAID", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("walston/GenAID", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add GenAID vs WhisAID architecture comparison
Browse files13 unmodified lines14151617181913 unmodified linesGenAID is a Chinese accent encoder based on `facebook/wav2vec2-large-xlsr-53`. It produces a 64-dimensional accent embedding designed to reduce speaker information. The model recognizes nine labels: north, Sichuan, Guangdong, south, Henan, Shanghai, Wuhan, Tianjin, and Singapore.## Usage```python13 unmodified lines1415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585913 unmodified linesGenAID is a Chinese accent encoder based on `facebook/wav2vec2-large-xlsr-53`. It produces a 64-dimensional accent embedding designed to reduce speaker information. The model recognizes nine labels: north, Sichuan, Guangdong, south, Henan, Shanghai, Wuhan, Tianjin, and Singapore.## GenAID and WhisAID Medium side by sideThe comparison excludes Whisper's text decoder because accent identification uses only its audio encoder.| Component | GenAID (this model) | WhisAID Medium ||---|---|---|| Model-native input | Raw 16 kHz waveform `[B, T]` | 80-bin Whisper log-Mel `[B, 80, 3000]` || Backbone | Wav2Vec2 XLSR-53 Large | Whisper Medium audio encoder || Audio frontend | 7 convolution layers, combined stride 320 | 2 convolution layers, second layer stride 2 || Frontend output | `[B, Tβ², 512]` | `[B, 1500, 1024]` || Feature projection | `512 β 1024` | None after the CNN || Transformer blocks | 24 | 24 || Transformer width | 1024 | 1024 || Attention heads | 16 Γ 64 dimensions | 16 Γ 64 dimensions || FFN per block | `1024 β 4096 β 1024` | `1024 β 4096 β 1024` || Transformer output | `[B, Tβ², 1024]` | `[B, 1500, 1024]` || Pooling | Attention-mask-aware temporal mean | Temporal mean || Accent embedding | `1024 β 64 β 64` | `1024 β 256` || Accent output | `64 β 9` | `256 β 9` || Speaker disentanglement | `64 β 336`; uniform-distribution adversarial MSE | GRL + speaker-token attention, `256 β 336` || Task-relevant parameters | **315,530,560** | 306,473,897, excluding text decoder || Frozen parameters | 4,210,176 (7-layer XLSR CNN) | Audio encoder is evaluated under `torch.no_grad()` in the compared recipe || Effectively updated parameters | **311,320,384** | 444,249 |`Tβ²` is the downsampled XLSR sequence length. For a 10-second, 16 kHz waveform, `T=160,000` and `Tβ²β499`.### GenAID module details| Module | Layers | Input β output | Parameters | Training behavior ||---|---:|---|---:|---|| XLSR feature extractor | 7 CNN layers | `[B,T] β [B,Tβ²,512]` | 4,210,176 | Frozen || Feature projection + XLSR encoder | Projection + 24 Transformer blocks | `[B,Tβ²,512] β [B,Tβ²,1024]` | 311,228,544 | Updated || Masked mean pooling | 1 | `[B,Tβ²,1024] β [B,1024]` | 0 | No parameters || Information bottleneck | 2 Γ Linear + GELU | `1024 β 64 β 64` | 69,760 | Updated || Accent classifier | Linear, no bias | `64 β 9` | 576 | Updated || Speaker adversarial classifier | Linear, no bias | `64 β 336` | 21,504 | Updated during training || **Total** | | | **315,530,560** | |The 64-dimensional output of the second GELU is the reusable accent embedding. The speaker classifier is a training-only probe: its predicted speaker distribution is optimized toward a uniform distribution, discouraging the bottleneck from retaining speaker identity. The speaker branch is not required when extracting embeddings.## Usage```python
README.md+40