ast-finetuned-audioset-10-10-0.4593-finetuned-gtzan
This model is a fine-tuned version of MIT/ast-finetuned-audioset-10-10-0.4593 on the GTZAN dataset. It achieves the following results on the evaluation set:
- Accuracy: 0.8978
- Loss: 0.5666
Model description
Audio Spectrogram Transformer (AST) pre-trained on AudioSet, fine-tuned for 10-class music genre classification on GTZAN (Unit 4 hands-on exercise of the Hugging Face Audio Course). The 527-class AudioSet head is replaced by a new 10-class linear head; the whole network is fine-tuned.
Intended uses & limitations
Music genre classification of ~10 s, 16 kHz mono excerpts into: blues, classical, country, disco, hiphop, jazz, metal, pop, reggae, rock. GTZAN is small (1000 x 30 s clips) and known to contain duplicates, mislabelings and artist repetition, so accuracy on real-world music will be lower than reported here. For a full 30 s track, average the logits of its 10 s chunks.
Training and evaluation data
marsyas/gtzan (999 decodable clips). Clips are resampled to 16 kHz and cut into three non-overlapping 10 s chunks (AST input: 1024 frames x 128 mel bins). The train/validation split is stratified by genre and done by clip (85/15, seed 42), so chunks of one clip never appear in both sets: 2547 train chunks, 450 validation chunks (150 clips). Training uses SpecAugment-style time/frequency masking.
The reported accuracy is chunk-level. Averaging chunk logits per clip gives a clip-level accuracy of 0.9133 on the 150 validation clips.
Code: https://github.com/emrezorlu1239/course-projects/tree/main/huggingface-audio-course (unit4_genre_classifier/).
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 3e-05
- train_batch_size: 8
- eval_batch_size: 16
- seed: 42
- gradient_accumulation_steps: 2
- total_train_batch_size: 16
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 0.1
- num_epochs: 8.0
- mixed_precision_training: Native AMP
Training results
| Training Loss | Epoch | Step | Accuracy | Validation Loss |
|---|---|---|---|---|
| 0.3716 | 1.0 | 160 | 0.8089 | 0.6062 |
| 0.3005 | 2.0 | 320 | 0.8489 | 0.5623 |
| 0.1121 | 3.0 | 480 | 0.8778 | 0.4137 |
| 0.0392 | 4.0 | 640 | 0.8444 | 0.7292 |
| 0.0063 | 5.0 | 800 | 0.88 | 0.5956 |
| 0.0033 | 6.0 | 960 | 0.8889 | 0.5626 |
| 0.0069 | 7.0 | 1120 | 0.8956 | 0.5770 |
| 0.0009 | 8.0 | 1280 | 0.8978 | 0.5666 |
Framework versions
- Transformers 5.18.0
- Pytorch 2.11.0+cu128
- Datasets 5.0.1
- Tokenizers 0.23.2