Collect and label audio
Assemble short clips with reliable genre labels and keep separate holdout sets to measure generalisation across artists and recording conditions.
Classify music by genre. Inspect confusions between classes.
Music-genre classification maps short audio clips to genre labels using features that capture timbre, rhythm and spectral content. Important challenges include polyphonic mixtures, varying recording quality, overlapping genres, label noise and class imbalance.
Learning concept · Not a validated service
Music-genre classification maps short audio clips to genre labels using features that capture timbre, rhythm and spectral content. Important challenges include polyphonic mixtures, varying recording quality, overlapping genres, label noise and class imbalance.
A proposed application: assist curators or streaming services by pre-tagging tracks to speed manual curation; human editors should review and correct tags before they affect user-facing recommendations.
Assemble short clips with reliable genre labels and keep separate holdout sets to measure generalisation across artists and recording conditions.
Compute mel-spectrograms, MFCCs and tempo/rhythm features from audio at a consistent sample rate and normalise across clips.
Fit a simple classifier (e.g. random forest or CNN) with cross-validation and track per-class precision, recall and macro F1.
Report confusion matrices, per-genre errors and failure modes such as mixed-genre clips and low-SNR audio.
The supplied starter synthesises single-tone audio clips at two centre frequencies, computes a simple FFT-based feature vector (mean, std, argmax, 95th percentile of the spectrum), then trains a RandomForestClassifier to separate the two synthetic frequency classes and prints a classification report.
def synth_clip(freq, label):
t = np.linspace(0, 1, sample_rate, endpoint=False)
signal = np.sin(2 * np.pi * freq * t) + 0.05 * rng.normal(size=sample_rate)
spectrum = np.abs(np.fft.rfft(signal))
features = [
spectrum.mean(),
spectrum.std(),
spectrum.argmax(),
np.percentile(spectrum, 95),
]The starter does not use music or genre labels. It creates sine-wave signals with noise and extracts simple spectral summary statistics; this only demonstrates a toy frequency-discrimination baseline, not real music-genre modelling. The dataset is tiny, synthetic and not representative of genre variation.
Proposed extension: replace synthetic clips with a labelled music dataset, extract mel-spectrograms and MFCCs, train a CNN or a feature-based classifier, and provide a human-review UI for ambiguous tags.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.