rpmon's picture
Update README.md
beba220 verified
metadata
dataset_info:
  features:
    - name: audio
      dtype:
        audio:
          sampling_rate: 16000
    - name: genre
      dtype:
        class_label:
          names:
            '0': Electronic
            '1': Experimental
            '2': Folk
            '3': Hip-Hop
            '4': Instrumental
            '5': International
            '6': Pop
            '7': Rock
    - name: track_id
      dtype: int64
    - name: title
      dtype: string
    - name: artist
      dtype: string
  splits:
    - name: train
      num_bytes: 6389051091.8
      num_examples: 6400
    - name: validation
      num_bytes: 1591137207.8
      num_examples: 1600
  download_size: 7792316341
  dataset_size: 7980188299.6
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
      - split: validation
        path: data/validation-*

FMA Genre Classification Dataset

The FMA Genre Classification Dataset is a subset of the Free Music Archive (FMA), containing audio samples and genre labels for music classification tasks. This version uses the "small" subset of FMA, which contains 8,000 tracks of 30 seconds each, evenly distributed across 8 genres.

Dataset Description

Dataset Summary

This dataset consists of 8,000 audio tracks from the Free Music Archive (FMA), each 30 seconds in length, distributed across 8 musical genres. The audio has been preprocessed to ensure consistent format and sampling rate (16 kHz). The dataset is split into training (80%) and validation (20%) sets.

Supported Tasks

  • Audio Classification: The dataset can be used to train models for music genre classification
  • Audio Feature Learning: The dataset is suitable for training audio representation models

Languages

The audio content spans multiple languages, but the metadata is in English.

Dataset Structure

Number of tracks: 8,000
Audio length: 30 seconds each
Sampling rate: 16kHz (resampled from 44.1kHz)
Format: MP3
Split: 80% training, 20% validation

Data Fields

  • audio: Audio file (MP3 format, 30s, resampled to 16kHz)
  • genre: Genre label (one of 8 classes)
  • track_id: Unique identifier for the track
  • title: Track title
  • artist: Artist name

Genres

  1. Electronic
  2. Experimental
  3. Folk
  4. Hip-Hop
  5. Instrumental
  6. International
  7. Pop
  8. Rock

Dataset Creation

Source Data

The dataset is derived from the Free Music Archive (FMA), specifically the "small" subset. FMA is an open and easily accessible dataset consisting of full-length audio tracks with associated metadata.

Original FMA Dataset Paper

Preprocessing

  1. Audio files are loaded from MP3 format
  2. Resampled from 44.1kHz to 16kHz
  3. Converted to mono if stereo
  4. Verified for consistent length (30 seconds)
  5. Metadata cleaned and verified to match existing audio files

Considerations for Using the Data

Social Impact of Dataset

This dataset promotes research in music information retrieval and machine learning while respecting creative commons licensing. It helps advance automated music understanding while providing proper attribution to artists.

Discussion of Biases

The dataset may contain biases in:

  • Genre representation (equal distribution might not reflect real-world music distribution)
  • Western music bias
  • English language bias in metadata
  • Artist representation

Other Known Limitations

  • Limited to 30-second clips
  • Genre boundaries can be subjective
  • Some tracks might fit multiple genres
  • Audio quality varies between tracks

Additional Information

Dataset Curators

This version of the dataset was curated by [rpmon], based on the original FMA dataset created by Michaël Defferrard, Kirell Benzi, Pierre Vandergheynst, and Xavier Bresson.

Licensing Information

The dataset is released under Creative Commons licenses. Individual tracks may have different Creative Commons licenses. Please refer to the original FMA dataset for specific license information.

Citation Information

If you use this dataset, please cite the original FMA paper:

@inproceedings{defferrard2017fma,
  title={FMA: A Dataset for Music Analysis},
  author={Defferrard, Michal and Benzi, Kirell and Vandergheynst, Pierre and Bresson, Xavier},
  booktitle={18th International Society for Music Information Retrieval Conference},
  year={2017}
}

Usage Examples

from datasets import load_dataset

# Load the dataset
dataset = load_dataset("rpmon/fma-genre-classification")

# Access training data
train_data = dataset['train']

# Get an audio sample and its genre
audio = train_data[0]['audio']
genre = train_data[0]['genre']

# Process with AST feature extractor
from transformers import ASTFeatureExtractor
feature_extractor = ASTFeatureExtractor.from_pretrained("MIT/ast-finetuned-audioset-10-10-0.4593")
inputs = feature_extractor(audio["array"], sampling_rate=audio["sampling_rate"], return_tensors="pt")