CoolFace
Modelpublic

Mrsmetamorphosis/wav2vec2-large-xls-r-300m-dm32

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes4downloads
Model Card

wav2vec2-large-xls-r-300m-dm32

This model is a fine-tuned version of facebook/wav2vec2-xls-r-300m for binary speech classification (dementia vs. no dementia). The objective is to detect cognitive impairment from spontaneous speech audio.


๐Ÿง  Model Description

The model leverages the multilingual XLS-R 300M wav2vec2 architecture and fine-tunes a classification head for dementia detection.

Key characteristics:

  • โ€”Pretrained speech representations from wav2vec2
  • โ€”Fine-tuned classification head
  • โ€”Random audio chunk sampling during training
  • โ€”Mixed precision training (Native AMP)
  • โ€”Feature encoder frozen during early training for stability

The model accepts 16 kHz audio input and outputs probabilities for two classes:

  • โ€”0 โ†’ Dementia
  • โ€”1 โ†’ No Dementia

๐Ÿ“‚ Training and Evaluation Data

Dataset composition:

  • โ€”227 training samples
  • โ€”48 validation samples
  • โ€”Two balanced class labels: dementia and nodementia

Audio preprocessing:

  • โ€”Resampled to 16 kHz
  • โ€”Random 32 second segments used during training
  • โ€”Standardized waveform normalization

Due to the relatively small dataset size, some variance across training runs is expected.


โš™๏ธ Training Procedure

Fine-tuning was conducted using the Hugging Face Trainer API.

Hyperparameters

  • โ€”Learning rate: 1e-4
  • โ€”Train batch size: 8
  • โ€”Eval batch size: 8
  • โ€”Gradient accumulation steps: 2
  • โ€”Effective batch size: 16
  • โ€”Number of epochs: 22
  • โ€”Optimizer: AdamW (fused implementation)
  • โ€”Betas: (0.9, 0.999)
  • โ€”Epsilon: 1e-8
  • โ€”LR scheduler: Linear
  • โ€”Mixed precision: Native AMP
  • โ€”Seed: 42

๐Ÿ–ฅ๏ธ Hardware

Training was performed on:

  • โ€”NVIDIA A100 GPU
  • โ€”CUDA-enabled PyTorch 2.10

๐Ÿ“Š Evaluation Results (Validation Set)

Final validation performance after 22 epochs:

  • โ€”Validation Loss: 0.5444
  • โ€”Accuracy: 0.7778
  • โ€”Precision: 0.6818
  • โ€”Recall: 0.9375
  • โ€”F1 Score: 0.7895

Confusion Matrix

[[13, 7], [ 1,15]]

Where:

  • โ€”True Negatives: 13
  • โ€”False Positives: 7
  • โ€”False Negatives: 1
  • โ€”True Positives: 15

๐Ÿ“ˆ Training Progress Snapshot

EpochValidation LossAccuracyPrecisionRecallF1
19.870.54300.72220.62500.93750.7500
22.000.54440.77780.68180.93750.7895

๐Ÿ”Ž Interpretation

The model demonstrates high recall (0.94), meaning it correctly identifies most dementia cases. There are moderate false positives, where some non-dementia samples are classified as dementia. Given the screening context, prioritizing recall is desirable to reduce missed positive cases.


๐Ÿšจ Intended Use

This model is intended for:

  • โ€”Academic research
  • โ€”Proof-of-concept dementia screening experiments
  • โ€”Speech-based cognitive impairment studies

This model is not intended for clinical diagnosis and should not be used for medical decision-making.


โš ๏ธ Limitations

  • โ€”Small dataset size may limit generalization.
  • โ€”Performance may vary across accents, languages, and recording environments.
  • โ€”Further validation on larger and more diverse datasets is required.

๐Ÿ“š Framework Versions

  • โ€”Transformers 5.0.0
  • โ€”PyTorch 2.10.0+cu128
  • โ€”Datasets 4.0.0
  • โ€”Tokenizers 0.22.2