Submitted:
02 November 2026
Posted:
04 November 2026
You are already at the latest version
Abstract
Music genre classification remains a fundamental yet challenging task in music information retrieval, requiring models that capture local time–frequency patterns and long-range temporal dependencies. To address this, we propose ResMamba, a hybrid architecture that augments a ResNet-style four-stage backbone with Mamba blocks. Building upon the selective structured state space sequence model, ResMamba first adapts the selective SSM into a 4D-compatible residual Mamba block that captures global dependencies at linear complexity. We then design the ConvMamba dual-path block, which combines this adapted Mamba branch with a parallel convolutional branch through a learned 1×1 fusion, jointly modeling global sequential context and local spectro-temporal patterns. Furthermore, we adopt a multi-scale fusion head that aggregates hierarchical representations across all four stages. Experiments on the GTZAN dataset demonstrate that our full ResMamba model achieves a 5-fold cross-validation accuracy of 88.99% ± 1.58%, surpassing the strongest published method in our comparison (88.64%). All models are trained from scratch without any pretraining, external data, or data augmentation. Beyond GTZAN, ResMamba also generalizes to the larger FMA benchmarks under the same training protocol, attaining 64.52% ± 1.88% on FMA-Small under 10-fold cross-validation — the best published from-scratch result — and 65.75% on FMA-Medium under the official artist-level split, surpassing the widely cited SVM baseline of Defferrard et al. (63%).
Keywords:
music genre classification
; state space model
; Mamba
; ResNet
; spectrogram analysis
; deep learning
1. Introduction
Music genre classification remains a cornerstone task in Music Information Retrieval (MIR). The ability to automatically categorize musical pieces into predefined genres—such as classical, jazz, rock, or pop—underpins a wide range of applications, including music streaming services, automated playlist generation, content-based recommendation systems, and large-scale archival management. Since the introduction of the GTZAN dataset [1] and systematic feature-engineering approaches by Tzanetakis and Cook, the field has undergone a significant paradigm shift: evolving from hand-crafted acoustic features with shallow classifiers to deep learning methods capable of learning representations directly from raw or preprocessed audio.
Convolutional Neural Networks (CNNs) have long served as the dominant paradigm for spectrogram-based music classification. Architectures such as ResNet [2], VGG [37], and CRNNs [12] treat mel-spectrograms as two-dimensional images, applying successive local convolutions to extract time–frequency patterns. Despite their effectiveness, the intrinsic inductive bias of CNNs—specifically, the limited receptive field of convolutional kernels—imposes an architectural bottleneck on modeling long-range dependencies across musical sections. Genre-defining characteristics, such as verse–chorus transitions, instrumentation variations, and rhythmic modulations, often unfold over tens of seconds, necessitating the ability to correlate temporally distant events along the sequence axis.
Among CNN architectures, ResNet [2] stands as one of the most influential designs in modern deep learning. By introducing residual connections with identity mappings, ResNet mitigates the degradation problem that hindered earlier deep networks, enabling stable training of very deep architectures. It has been successfully adapted to diverse modalities such as speech recognition, environmental sound classification, and music information retrieval, where its hierarchical feature extraction paradigm—characterized by four stages with progressively increasing channel dimensions and decreasing spatial resolutions—provides a natural multi-scale representation that aligns well with the compositional structure of audio signals.
The recent emergence of State Space Models (SSMs), particularly the Structured State Space Sequence Model (S4) [4] and its selective variant, Mamba (S6) [3], has opened new avenues for sequence modeling with linear complexity. Mamba introduces a data-dependent selection mechanism that enables the model to selectively retain relevant tokens while filtering out noise, achieving performance competitive with Transformers on language and vision tasks while maintaining inference complexity. Subsequent works, including Vision Mamba [7] and VMamba [11], have further demonstrated that the Mamba framework can be effectively adapted to visual recognition through multi-directional scanning strategies for image patches.
In this paper, we propose ResMamba, a hybrid architecture that integrates the selective SSM block of Mamba into a ResNet-style four-stage hierarchical backbone for music genre classification. Our key contributions are threefold:
- 1)
- We design a 4D-compatible Mamba wrapper that encapsulates the selective SSM within a 4D residual module interface, MambaWrapper, which accepts and returns feature maps of shape . This module enables global context aggregation with linear time complexity while maintaining compatibility with hierarchical CNN backbones.
- 2)
- We propose a ConvMamba dual-path block comprising two parallel branches: a Mamba branch leveraging the aforementioned 4D-adapted module for global sequence modeling, and a convolutional branch employing two stacked convolutions for local spectro-temporal feature extraction. The outputs from both branches are concatenated and fused via a learnable convolution, effectively preserving complementary global and local representations.
- 3)
- We adopt a multi-scale fusion head that aggregates hierarchical features from all four stages prior to classification; ablation studies confirm that this aggregation yields complementary gains over the proposed ConvMamba blocks alone.
Extensive experiments on the GTZAN dataset validate the effectiveness of our approach. Notably, the ConvMamba variant with multi-scale fusion achieves a 5-fold cross-validation accuracy of , trained from scratch without any pretraining, external data, or data augmentation. Beyond GTZAN, ResMamba also generalizes to the larger Free Music Archive (FMA) benchmarks under the same protocol, attaining on FMA-Small under 10-fold cross-validation and on FMA-Medium under the official artist-level split.
The remainder of this paper is organized as follows. Section 2 reviews related work in music genre classification and state space models. Section 3 details the proposed ResMamba architecture. Section 4 describes the experimental setup and presents a comprehensive analysis of the results. Finally, Section 5 concludes the paper and outlines directions for future work.
2. Related Work
2.1. Music Genre Classification
The GTZAN dataset, introduced by Tzanetakis and Cook [1], has served as one of the most widely used benchmarks for music genre classification for over two decades. Early approaches predominantly relied on hand-engineered acoustic features—including mel-frequency cepstral coefficients (MFCCs), spectral centroid, zero-crossing rate, and rhythmic descriptors—coupled with classical classifiers such as support vector machines (SVMs) or Gaussian mixture models (GMMs). More recently, Muniz and Souza Filho [26] revisited hand-crafted feature pipelines with a statistically grounded wrapper-based feature selection procedure, deriving a compact feature set that transfers across GTZAN, FMA, and other music datasets. In a complementary statistical direction, Shen and Xiao [22] formulated genre classification as a functional data analysis problem, modeling the temporal trajectories of acoustic features with basis-function expansions and thereby offering a principled non-deep alternative on standard benchmarks.
The advent of deep learning catalyzed significant progress in this domain. Choi et al. [14] pioneered the application of CNNs directly to mel-spectrograms, reframing audio classification as an image recognition task. Kim et al. [25] subsequently demonstrated through extensive multi-task transfer-learning experiments that the choice and number of learning source tasks substantially influence the quality of deep music representations. This paradigm was subsequently advanced through deeper architectures borrowed from computer vision, including VGG [37], ResNet [2], DenseNet [38], MobileNetV2 [39], MobileNetV3 [40], and ShuffleNetV2 [41]. More recently, attention mechanisms, particularly self-attention within Transformer encoders [23,31], have been investigated for their capacity to capture long-range dependencies in music; however, the quadratic computational complexity of standard attention remains a bottleneck for scalability on extended audio sequences.
Recurrent neural networks (RNNs), notably long short-term memory (LSTM) networks, have also been employed to model the temporal evolution of audio features. In particular, convolutional recurrent neural networks [12] pair a convolutional front-end with a recurrent sequence model to capture both spectro-temporal patterns and long-term temporal context. Transfer learning has further amplified the utility of such deep representations: Choi et al. [16] showed that models trained on large-scale audio tagging data transfer effectively to classification and regression tasks. Nevertheless, LSTMs are inherently limited by vanishing gradients over prolonged sequences and sequential processing constraints, which hinder training efficiency on modern parallel hardware.
Complementary to fully supervised audio-only modeling, recent studies explore label-efficient and knowledge-augmented settings. Shen and Xiao [28] adapt frozen music foundation models to zero-to-few-shot genre classification via prototype calibration and embedding-space prompt learning, while Ding et al. [21] embed genre-centric knowledge graphs into audio representations, achieving 68.07% accuracy on FMA-Medium. Although these methods achieve competitive performance, they depend on external semantic knowledge, pretrained speech-language backbones, or auxiliary metadata, rather than compact end-to-end audio architectures.
2.2. State Space Models and Mamba
State space models (SSMs) offer a principled framework for modeling continuous-time dynamics and have recently re-emerged as efficient alternatives to attention mechanisms for long-sequence modeling. The S4 model [4] introduced structured diagonal parameterization of the state matrix, achieving complexity in the convolutional mode, with the state matrix initialized via HiPPO. Subsequent variants, including S4D [5] and DSS [6], further streamlined this parameterization while preserving strong performance on the Long Range Arena benchmark.
A pivotal advancement came with Mamba [3], which incorporated an input-dependent selection mechanism into the SSM framework. This selective structured state space model (S6) endows the network with content-aware reasoning capabilities: the discretized state transition matrices and become functions of the input token, enabling dynamic propagation or filtering of information along the sequence. Consequently, Mamba achieves Transformer-comparable quality on language modeling tasks while maintaining linear scaling with respect to sequence length.
In the vision domain, Vision Mamba (VIM) [7] and VMamba [11] adapted the Mamba block for image recognition. VIM employs bidirectional scanning over flattened image patches to capture global visual context, whereas VMamba introduces a cross-scan module that traverses 2D feature maps along four directions—horizontal, vertical, and two diagonals—to enrich spatial representation. These efforts demonstrated that Mamba-based architectures can match ViT and Swin Transformer variants on ImageNet classification while offering substantial memory efficiency gains.
Hybrid convolution–SSM designs have also been explored beyond natural-image recognition. MedMamba [10] couples convolutional layers with the selective SSM for medical image classification, and a homonymous ConvMamba [9] combines Mamba with CNNs for hyperspectral image classification. Although these models share the philosophy of complementing the SSM with convolutional inductive biases, our ConvMamba block is architecturally distinct: it embeds a 4D-adapted Mamba branch and a parallel two-layer convolutional branch within a residual block, fuses the two branches via channel concatenation followed by a learned convolution. This design enables more effective capture of time-frequency patterns from the anisotropic 2D Mel spectrogram.
Building upon these foundations, our work adapts Mamba specifically for music spectrograms, where the temporal axis encodes musical structure and the frequency axis captures pitch and timbral information. Unlike natural images, where spatial translation invariance is paramount, mel-spectrograms exhibit anisotropic semantics: the horizontal (time) dimension conveys long-range musical narrative, while the vertical (frequency) dimension reflects localized harmonic structure. ResMamba is explicitly designed to respect this asymmetry through its dual-path convolution-SSM architecture.
3. Proposed Method: ResMamba
3.1. Overall Architecture
ResMamba employs a hierarchical ResNet-style backbone comprising four stages, as illustrated in Figure 1. Given an input mel-spectrogram , the stem first projects it to a 64-channel feature map via a convolution with stride 2 and padding 3, followed by batch normalization and ReLU activation:
and subsequently applies a max-pooling layer with stride 2, yielding a feature map of size .
This feature map is subsequently processed through four sequential stages. Each stage comprises residual blocks and produces output channels, with ; spatial downsampling is applied at the beginning of stages 2–4. In principle, any building block that accepts and returns 4D feature maps can be integrated into this architecture, including standard ResNet BasicBlock or Bottleneck modules. While each stage permits flexible instantiation of its core component, this work specifically employs two proposed variants: the Mamba block (AdaptMambaBlock), which substitutes the two stacked convolutions in the native ResNet BasicBlock with a MambaWrapper followed by BN, and the ConvMamba dual-path module (ConvMambaBlock), which integrates this Mamba branch (MambaWrapper + BN) with a parallel convolutional branch.
3.2. MambaWrapper: Wrapping Selective SSM for 2D Features
We adopt the unidirectional MambaVision mixer [8] and encapsulate it within a 4D residual module interface, MambaWrapper, which accepts and returns feature maps of shape . The native Mamba block operates on 3D sequences , where B is the batch size, N the sequence length, and D the token embedding dimension. To bridge this dimensional mismatch with 2D spectrogram features , MambaWrapper performs a structure-preserving round-trip transformation. Specifically, it first applies a convolution (proj_in) to project the channel dimension from C to D while maintaining the 4D spatial layout:
The projected 4D tensor is then flattened along the spatial axes and transposed to form a 3D token sequence with sequence length :
The resulting 3D tensor is then fed into the native selective SSM (MambaVisionMixer). Internally, the SSM operates as follows. The input is projected to an inner dimension through a linear projection and split into two branches and , each of width :
Each branch passes through a depthwise 1D convolution () followed by SiLU activation to capture local sequential context:
The selective SSM parameters are computed from :
where is the state dimension. The continuous-time parameters are discretized with step size using the first-order approximation:
where has a diagonal structure with negative real eigenvalues to guarantee stability. The SSM computes the output via the recurrent formulation:
where the subscript t indicates that , , and are input-dependent and vary across positions. This selective mechanism is the core innovation of S6 over prior SSM architectures, as it allows the model to dynamically decide which information to retain or discard along the sequence.
The final output is formed by concatenating the SSM output with the branch and projecting the combined representation back to the embedding dimension:
where is a learnable per-channel skip-connection parameter, and projects the concatenated -dimensional representation back to dimension D. Finally, the MambaWrapper recovers the 4D spatial layout by transposing and reshaping from to , completing the dimension-preserving round-trip transformation.
To balance global context modeling with computational efficiency, we employ a soft window-partitioning strategy. In the high-resolution stages (Stages 1 and 2), flattening the entire feature map into a single sequence would produce very long token streams ( and , i.e., and tokens for the mel-spectrogram input); we therefore partition the feature map into non-overlapping windows of size and execute the SSM independently within each window. This reduces the per-scan sequence length to 64 tokens and, for the mel-spectrogram input, confines each window to roughly 0.7–1.5 s of audio, so that short rhythmic and phrasal structures are captured locally at low cost. In the low-resolution, high-channel stages (Stages 3 and 4), whose feature maps contain only and tokens (640 and 160 for the input), we instead apply full-sequence SSM () to aggregate global context over the entire feature map with modest computational overhead. Unlike Swin Transformer’s hard shifted-window partitioning, our soft windows are non-overlapping and are partitioned only once, with the window grid kept fixed throughout the network: local context inside each window is enriched by the depthwise convolution preceding the SSM, while cross-window information is re-integrated through the parallel convolutional branch of the ConvMamba block and the multi-scale aggregation across stages. No shifted-window re-partitioning is required.
3.3. AdaptMambaBlock: Single-Path Mamba Residual Block
As the most elementary instantiation of the Mamba SSM in the ResNet-style framework, AdaptMambaBlock serves as a drop-in replacement for the standard ResNet basic blocks (e.g., BasicBlock or Bottleneck) that are stacked to form each stage, replacing their convolutional pathway with Mamba-based state-space sequence modeling. Configured with an expansion factor of 1 (aligning with the BasicBlock design), it establishes a lightweight, single-path architecture that serves as a baseline for assessing the specific contributions of selective state-space mechanisms to music genre classification. The detailed architecture is illustrated in Figure 2 and formally defined below.
Given an input feature map , optional spatial downsampling is applied when inter-stage resolution reduction is required ():
where when . The resulting representation is then processed by a MambaWrapper module. To preserve structural integrity during the 2D→1D→2D round-trip transformation, this module strictly operates with , ensuring proper alignment between 2D spatial dimensions and the 1D token sequence:
Stochastic depth regularization (DropPath) is subsequently applied to enhance training stability and generalization:
where the drop probability increases linearly with block depth. A residual shortcut provides the identity path; when spatial dimensions or channel counts mismatch (), a convolution with stride 2 followed by BatchNorm is employed to align the skip connection:
Finally, the output is obtained through residual addition followed by activation:
In contrast to the dual-path ConvMamba block (Section 3.4), AdaptMambaBlock relies solely on the Mamba branch, omitting any parallel convolutional path. This yields a more streamlined architecture with reduced parameter count and computational overhead. Furthermore, the configuration maintains a constant channel dimension throughout the feed-forward transformation, preserving the parameter efficiency characteristic of the original ResNet BasicBlock. Such a design facilitates direct ablation comparisons between pure Mamba-based and hybrid ConvMamba residual architectures.
3.4. ConvMambaBlock: Dual-Path Convolution-Mamba Residual Block
While the Mamba block excels at global context aggregation, it lacks the inductive bias necessary for capturing fine-grained local spectro-temporal patterns—a strength inherent to convolutions. To synergize these complementary capabilities, we propose the ConvMamba dual-path block (ConvMambaBlock), illustrated in Figure 3. Specifically, the block comprises two parallel branches: a Mamba branch (MambaWrapper + BatchNorm2d) and a convolutional branch.
Given an input , spatial downsampling, when required between stages (), is performed once via average pooling and shared by both branches—identical to the downsampling operation in Eq. (12):
where when . The two branches then compute their respective representations from this shared downsampled input as follows.
Mamba branch:
Convolutional branch:
The branch outputs are concatenated along the channel dimension and fused via a convolution:
where denotes channel-wise concatenation. Finally, the output is obtained through a residual connection with stochastic depth:
where the identity shortcut follows the same projection strategy as Eq. (15): when , and otherwise. Notably, the fusion convolution adaptively reweights the contributions of global (Mamba) and local (convolutional) features at each spatial location, enabling data-driven integration of complementary representations.
3.5. Multi-Scale Fusion Head
Standard ResNet architectures perform classification using only final-stage features after global average pooling. However, successive downsampling operations discard fine-grained spectral details (e.g., pitch and timbre) encoded in early-stage representations. To mitigate this information loss, we adopt a multi-scale fusion head inspired by hierarchical feature aggregation, which integrates features from all four stages.
Let denote the output feature map of stage k (). Each is first spatially aligned to a uniform resolution via adaptive average pooling, then concatenated along the channel dimension:
The fused representation is subsequently compressed by a convolution with BatchNorm and ReLU activation, followed by dropout regularization, global average pooling, a 128-dimensional fully connected layer, and finally the classification head.
4. Experiments
We evaluate ResMamba in two depth configurations that differ only in the number of blocks per stage: a compact configuration with blocks and a deeper configuration with blocks. Our main experiments employ the compact configuration, instantiated with each of the three block types described in Section 3: Mamba-only, ConvMamba, and ConvMamba with multi-scale fusion (ConvMamba+MS). The deeper configuration, combined with the best-performing block type (ConvMamba+MS), is evaluated only in the ablation study to assess the effect of network depth (Table 3).
All models are evaluated under consistent settings with identical preprocessing and core training hyperparameters, except for dataset-specific adaptations in batch size, learning-rate schedule, and early stopping (highlighted in Table 1). Specifically, we employ five-fold stratified cross-validation on GTZAN and stratified 10-fold track-level cross-validation on FMA-Small, while FMA-Medium follows the official artist-level train/validation/test splits. These protocols are chosen to align with those of the published studies. On FMA-Medium, we use the official artist-level split released by Defferrard et al. [17], the same partition on which they reported their widely cited 63% SVM baseline. On GTZAN and FMA-Small, we adopt track-level protocols matching the reference studies [19,26]: each track is assigned intact to a single fold, so no audio content is shared between training and test sets.
Unless otherwise noted, all experiments use full-resolution mel-spectrograms as input, without temporal downsampling or data augmentation. This setting preserves both the complete 128-band frequency axis and the full temporal context; its effectiveness is validated by the input-resolution ablation in Section 4.3, which demonstrates that accuracy improves monotonically with temporal resolution. Finally, because some published results rely on pretrained models or external data, such methods are discussed in the text (Section 4.7) rather than used as direct baselines in the comparison tables. For every method listed in the tables, the evaluation protocol is explicitly reported.
4.1. Dataset and Preprocessing
We evaluate all models on the GTZAN dataset [1], which comprises 1,000 audio tracks evenly distributed across ten genres: blues, classical, country, disco, hip-hop, jazz, metal, pop, reggae, and rock. Each track is stored as a 22050 Hz mono WAV file with 16-bit resolution and a nominal duration of 30 seconds. A detailed analysis of actual track durations reveals a range from 29.93 s to 30.65 s, with a mean of 30.02 s ( s). Only nine of the 999 usable tracks (0.9%) are slightly shorter than 30 s, 989 (99.0%) marginally exceed this length, and one track has a duration equal to 30 s within measurement precision.
To assess generalization beyond GTZAN, we additionally evaluate on the Free Music Archive (FMA) dataset [17], which offers a more realistic and challenging benchmark. Its small subset (FMA-Small) contains 8,000 tracks uniformly distributed across eight genres, while the medium subset (FMA-Medium) comprises 25,000 tracks spanning 16 genres (the 8,000 FMA-Small tracks plus 17,000 additional tracks). For FMA-Small, we employ stratified 10-fold cross-validation over track-level splits, preserving genre proportions in each fold, in line with the 10-fold, track-level evaluation commonly used in FMA-Small studies [19,26]. For FMA-Medium, since the eight FMA-Small genres are a subset of the sixteen FMA-Medium genres, we merge the two subsets by their corresponding official artist-level splits into a single 16-class protocol. All FMA tracks are provided as 30-second clips as well and undergo the identical preprocessing pipeline described below (consistent mel-spectrogram parameters), with only the classification head adjusted to match the respective number of genres.
Audio Preprocessing. Since all tracks in GTZAN, FMA-Small, and FMA-Medium are approximately 30 seconds long, we adopt the same input convention for all three datasets: tracks shorter than 30 s are zero-padded at the end, while longer tracks are truncated to their first 30 s. Mel-spectrograms are computed with , hop length , and , yielding a time–frequency representation for each 30-second segment. The resulting spectrograms are converted to the decibel scale and replicated across three channels to simulate RGB input. All models are trained using this identical pipeline and receive the full-resolution mel-spectrograms directly, without temporal downsampling. No data augmentation—neither waveform-level (e.g., pitch shifting, time stretching, or noise injection) nor spectrogram-level (e.g., SpecAugment time/frequency masking)—is applied to any input in any experiment.
Figure 4 presents, for each of the ten GTZAN genres, the mel-spectrogram produced by our preprocessing pipeline for the first track of that genre in the dataset’s ordering. As a compact time–frequency representation, the mel-spectrogram captures both harmonic content (vertical structure across mel bins) and temporal evolution (horizontal axis). Visually, the ten genres exhibit distinctly characteristic patterns: classical music features sparse, well-separated harmonic lines interspersed with extended silent intervals; metal and rock display dense, sustained high-energy activations across a broad frequency range; hip-hop and pop show pronounced low-frequency energy concentrated in rhythmic bursts; jazz and blues present moderate, variable textures with irregular note onsets; country and reggae demonstrate a balanced mixture of harmonic and percussive elements; and disco is dominated by a steady four-on-the-floor bass-drum pulse accompanied by lush string and brass layers. These marked visual differences suggest that music genre classification can be effectively formulated as an image recognition task, wherein deep visual backbones learn discriminative features directly from the spectrogram representation.
Data Splitting. For GTZAN, we employ five-fold stratified cross-validation on 999 usable tracks (one unreadable file excluded), where each fold contains approximately 800 training and 200 validation samples, with genre proportions preserved in both sets. For FMA-Small, we employ stratified 10-fold cross-validation over track-level splits: six corrupted tracks were excluded, leaving 7,994 effective tracks, and each fold uses roughly 800 tracks for evaluation and the remaining ∼7,200 for training, with genre proportions preserved in both sets. For FMA-Medium, we adopt the official artist-level train/validation/test splits: twenty corrupted tracks were excluded, yielding 19,904/2,504/2,572 effective train/validation/test tracks under the merged 16-class protocol. Within each dataset, all models trained in this work are evaluated on the identical effective track set under the same fold assignments, ensuring a fair comparison among them.
4.2. Implementation Details
All models are implemented in PyTorch and trained on a single NVIDIA GPU. We employ the AdamW optimizer [13] with an initial learning rate of and a weight decay of , preceded by a 5-epoch linear warmup from to . On GTZAN, the learning rate follows a step-based schedule that multiplies it by at epochs 60 and 90 (half and three-quarters of the 120 training epochs), and no early stopping is applied, so each model runs for the full 120 epochs. On FMA-Small and FMA-Medium, a plateau-based schedule multiplies the learning rate by only when both the validation accuracy and the validation loss show no improvement for 10 consecutive epochs, down to a floor of (1% of the initial learning rate), and early stopping with a patience of 20 epochs is applied. Each model is trained for at most 120 epochs using the cross-entropy loss function, with a batch size of 16 on GTZAN and 32 on FMA.
For established vision backbones, we adopt the official torchvision [36] implementations and train them from scratch without pretrained weights, modifying only the final fully connected layer for these backbones by replacing it with a randomly initialized linear classifier whose output dimension matches the number of genres in each dataset. This ensures a purely architectural comparison, largely free from confounding effects introduced by preprocessing variations. Table 1 summarizes the key experimental settings for reference.
4.3. Ablation Studies
4.3.1. Effect of Input Resolution
Before evaluating the internal components of ResMamba, we first examine the impact of temporal resolution. Using ResNet-18 as a representative baseline, we compare four candidate resolutions that share the same 128-band mel-frequency axis but differ in temporal compression:
- ( compression): aggressive downsampling approaching the ms perceptual threshold [45];
- ( compression): moderate temporal compression;
- ( compression): fine temporal granularity;
- (no compression): full-resolution input.
Downsampled resolutions are obtained via AdaptiveAvgPool2d applied to the original mel-spectrogram, preserving the frequency axis without interpolation. The full-resolution input is used directly without any spatial reduction.
Table 2 presents the results. Accuracy improves monotonically with temporal resolution, indicating that every downsampling step discards some genre-discriminative temporal information. The degradation is most substantial under aggressive downsampling to (), where the effective frame interval approaches the ms perceptual threshold [45], whereas the full-resolution input achieves the best accuracy (). The largest gain occurs between and ( percentage points), and the temporal axis continues to carry substantial genre-discriminative information up to the full resolution, with a further improvement of percentage points from to . This indicates that performance has not yet saturated at ms granularity.
Based on these findings, we adopt the full-resolution input as the unified setting for all subsequent experiments, as it consistently yields superior accuracy.
4.3.2. Effect of the Proposed Components
To isolate the contribution of each proposed component, we evaluate four configurations: (i) a Mamba-only variant, where the ConvMamba block is replaced by a plain AdaptMambaBlock (removing the convolutional branch); (ii) the ConvMamba block without multi-scale fusion; (iii) the full ConvMamba + MS model; and (iv) a deeper variant to examine the impact of network depth. All ResMamba variants share an identical ResNet-style backbone, training hyperparameters, and input resolution of . Table 3 summarizes the 5-fold cross-validation accuracy on GTZAN, with ResNet-18 serving as the baseline.
As shown in Table 3, the Mamba-only variant () already surpasses the ResNet-18 baseline () by 1.41 percentage points, demonstrating that the selective SSM’s global sequential modeling is a competitive alternative to purely convolutional feature extraction. Nevertheless, this gain remains modest, because mel-spectrogram classification relies heavily on local textural patterns—such as harmonic stacks, formant transitions, and transient onsets—that align naturally with the inductive bias of convolutional receptive fields. Despite its global context capability, pure SSM-based sequence modeling lacks an explicit spatial prior for capturing local textural patterns; consequently, the locality it learns from scratch on the limited training data (GTZAN provides only 800 training samples per fold) remains limited, motivating an explicit enhancement of its local information capture capability.
The ConvMamba block effectively addresses this limitation. Its convolutional branch provides local spectral priors via two stacked convolutions (with BatchNorm and ReLU), stabilizing early-layer representations, while the Mamba branch captures complementary global dependencies. A learned fusion dynamically balances these pathways. Incorporating the ConvMamba block (w/o MS) yields a gain to ( points over Mamba-only). Adding the multi-scale fusion head further improves accuracy to ( points), confirming that the synergy between the convolutional and Mamba branches enhances model performance.
The additional gain from multi-scale fusion arises from the complementary nature of hierarchical features. Early-stage features retain high spatial resolution and capture fine-grained spectral details (e.g., harmonic structure, transient attacks), whereas late-stage features encode semantic genre-level patterns. The learnable fusion within the MS head enables adaptive integration of information across all four backbone stages, thereby enriching the final representation beyond what single-scale features can provide.
Notably, scaling the full ConvMamba + MS model from the compact backbone (, 15.1M params) to the deeper architecture (, 28.0M params) leads to slight degradation rather than improvement. This corroborates our finding in Section 4.4 that increased capacity does not guarantee better generalization on GTZAN; with limited training data, the deeper variant exacerbates overfitting instead of capturing more discriminative structure. This observation motivates our adoption of the compact ResMamba as the primary configuration.
4.4. Comparison with Established Vision Backbones
To contextualize ResMamba’s design choices, we benchmark 12 established vision architectures spanning diverse design paradigms: residual CNNs (ResNet-18/34/50/101 [2]), the EfficientNet family (B0–B3, V2-S) [42,43] with depthwise separable convolutions, inverted bottlenecks, and compound scaling, the grouped-convolution network ResNeXt-50 (32×4d) [44], the window-based vision Transformer Swin-T [15], and the hybrid Mamba–Transformer architecture MambaVision-T [8]. All baselines are drawn from torchvision’s official model zoo except MambaVision-T, which we adopt from the official implementation released by its authors. For families with a clear capacity ladder (ResNet and EfficientNet), we include several sizes to probe whether larger models yield commensurate gains on music classification, retaining the configurations that attained the most competitive accuracy under the computational budget. Every model is trained from scratch under the identical 5-fold protocol without data augmentation and directly consumes the full-resolution mel-spectrogram input. In particular, the official torchvision Swin-T automatically zero-pads feature maps to multiples of the window size (e.g., the stage-1 feature width , which is not divisible by 7, is padded to 329), so it processes the spectrogram at full resolution without resizing.
MambaVision-T is the only baseline that requires window configuration adaptation. Its default [8, 8, 14, 7] configuration is designed for images: the first two stages are purely convolutional, and the last two stages use and windows. In our spectrogram setting, however, the stride-4 convolutional stem and stage-wise downsampling reduce the feature-map height of these two stages to 8 and 4, respectively—both below the corresponding window size—so windowing would require heavy zero-padding that leaves most windowed tokens empty. We therefore set window_size in the last two stages: as in our model, no windowing is applied and the mixers perform global modeling over the entire feature map. The first two stages, being purely convolutional, likewise perform no windowing, making the leading 8s in [8, 8, 0, 0] inert placeholders. MambaVision-T thus consumes the full-resolution input directly, without window-based zero-padding or resizing.
Table 4 reports the 5-fold average validation accuracy and number of parameters for each model, where ResMamba denotes our full proposed model, i.e., the four-stage backbone with ConvMamba blocks and the multi-scale fusion (MS) head. Results confirm several observations:
- Smaller models suffice for GTZAN. Although the ResNet variants span two block designs—the BasicBlock in ResNet-18/34 and the Bottleneck in ResNet-50/101—and parameter counts from 11.2 to 42.5 M, their accuracies (ResNet-18: 85.38%, ResNet-34: 82.38%, ResNet-50: 85.08%, ResNet-101: 82.18%) differ by at most points, and within each block-design family accuracy even declines with depth. Larger models thus do not necessarily help on this dataset. This justifies our choice of a compact 4-stage backbone with only two blocks per stage.
- Efficiency-oriented designs transfer poorly to spectrograms. All EfficientNet variants (B0–B3, V2-S), despite their compound scaling and depthwise separable convolutions, attain only 76.68–81.48%, well below the ResNet family, suggesting that architectures optimized for natural images do not transfer directly to mel-spectrogram classification.
- Transformers underperform without pretraining. Swin-T, which relies on window-based self-attention and relative position biases, achieves 77.48% despite 27.5 M parameters, the second-lowest accuracy in the table, confirming that pure attention architectures struggle to learn from the 800 training samples per fold. MambaVision-T (83.59%) improves over Swin-T by re-introducing convolution priors, yet still lags the strongest CNNs (ResNet-18: 85.38%, ResNet-50: 85.08%, ResNeXt-50: 84.88%).
- ConvMamba’s efficiency advantage. ResMamba achieves 88.99% with 15.1 M parameters and 15.6 G FLOPs (measured at the full resolution). It outperforms the strongest CNN baseline, ResNet-18 (85.38%), by 3.61 percentage points, and the ResNeXt-50 baseline (84.88%) by 4.11 points while using 34% fewer parameters, delivering global context modeling at a computational cost below quadratic-complexity self-attention models (e.g., Swin-T: 19.7 G FLOPs).
4.5. Comparison with State-of-the-Art Methods
Table 5 compares our ResMamba (ConvMamba + Multi-Scale Fusion) against published results on the GTZAN benchmark. The cited methods span the main deep-learning families for music genre classification: attention-based vision transformers [31], reduced convolutional recurrent neural networks [33], CNN–Transformer hybrids [23], and decomposed-feature gradient boosting [34].
ResMamba achieves the highest accuracy in Table 5 at , with a standard deviation derived from five-fold cross-validation. It surpasses the strongest published method, the reduced-CRNN model of Setiorini et al. [33] (88.64%), by 0.35 percentage points, and outperforms the attention-based method [31] (86.8%) by 2.19 percentage points. Against the recent baselines spanning decomposed-feature boosting [34] and CNN–Transformer hybrids [23] (85.5–87.41%), ResMamba gains 1.58–3.49 percentage points. These gains further validate the effectiveness of combining the ConvMamba dual-path design with multi-scale hierarchical feature aggregation for mel-spectrogram classification. It is worth noting that Yang et al. [32] (82.4%) evaluate on GTZAN under a hierarchical 80/20 split with artist-level filtering and near-duplicate removal, which is not directly comparable to the results in the table and is therefore not tabulated here. We note that direct numerical comparisons across published methods should be interpreted with caution due to differences in data splitting (e.g., random track-level vs. segment-level), segment duration, input resolution, and the presence or absence of a dedicated validation set. Our 5-fold stratified cross-validation and fixed experimental hyperparameters provide a transparent evaluation framework that facilitates meaningful comparison.
4.6. Error Analysis
To gain deeper insight into the model’s behavior, we aggregate the per-sample predictions across all five cross-validation folds and construct the confusion matrix shown in Figure 5.
Three genres — Classical (96/100), Blues (93/100), and Metal (93/100) — achieve the highest diagonal entries, followed closely by Jazz (91/99) and Pop (91/100), indicating that their spectro-temporal signatures are highly distinctive and well-separated from other genres. Classical music, with its sparse harmonic lines and extended silent intervals, presents a unique visual pattern that the ConvMamba backbone learns to recognize reliably. Metal and Jazz, despite both involving dense instrumentation, occupy complementary spectral regions: Metal is characterized by sustained broadband distortion, whereas Jazz exhibits transient note onsets with large dynamic range, enabling clean separation.
Conversely, several pairs exhibit notable confusion. Rock obtains the lowest diagonal count (80/100), with its 20 errors distributed across Country (9), Metal (3), Reggae (3), Disco (2), Pop (2), and Blues (1). The most prominent confusion involves the Rock–Country pair: Rock is misclassified as Country nine times and Country as Rock four times, jointly accounting for 13 of the 34 errors committed by these two genres. This bidirectional confusion reflects the stylistic continuum between blues-influenced rock and country ballads. Rock also confuses with Metal in both directions (5 samples of Metal predicted as Rock and 3 samples of Rock predicted as Metal), mirroring the shared distorted-guitar texture of hard rock and heavy metal. Reggae (82/100) is the second most confused genre, with its 18 errors spread over Disco (5), Rock (4), Blues (3), Pop (3), Hip-hop (2), and Jazz (1). The bidirectional Reggae–Disco (8) and Reggae–Rock (7) confusions again point to the shared off-beat rhythmic patterns of these dance-oriented genres. Country (86/100) is misclassified as Rock and as Jazz equally often (4 errors each), and Jazz additionally borrows from Classical (3); these pairs share sparse arrangements and melodic contours. Hip-hop (88/100) and Disco (89/100) show mild confusions with Reggae (4 and 3, respectively), consistent with the percussive, beat-driven characteristics common to these genres. These patterns align with well-known ambiguities in the GTZAN benchmark [35] and highlight opportunities for future refinement through rhythm-informed representations or genre-specific attention mechanisms.
4.7. Comparison with Recent FMA Studies
To assess the generalization of ResMamba beyond GTZAN, we additionally evaluate it on the Free Music Archive (FMA) dataset [17] introduced in Section 4.1. All models are trained under the protocol described in Section 4.2 (full-resolution mel-spectrogram input, AdamW optimizer, batch size 32), with the classification head adjusted to the corresponding number of genres.
Table 6 compares ResMamba with published FMA-Small results, for which we adopt the same 10-fold cross-validation protocol. The listed baselines span a 10-fold cross-validation protocol (Heakl et al. [19], 58.30%, reporting only the highest test accuracy), nested 10-fold cross-validation (Muniz et al. [26], 60.30%), and ten random 80/20 splits (Seo et al. [29], 57.38 ± 0.94%). The highest published FMA-Small accuracy of which we are aware is 64.30%, reported by Rai & Bhattacharjee [30] using BYOL-A pretrained embeddings with an unspecified data split; since this result relies on pretraining, it is not used as a direct baseline in the table. ResMamba, evaluated under the same track-level 10-fold cross-validation protocol without any data augmentation, attains , the highest accuracy among the from-scratch methods in Table 6, exceeding the pretraining-based result of Rai & Bhattacharjee (64.30%) by 0.22 percentage points without any pretraining or external data. It additionally outperforms the ResNet-18 baseline (), trained from scratch under the identical protocol, by 4.57 percentage points.
Table 7 compares ResMamba with published FMA-Medium results, for which we adopt the official artist-level split. Defferrard et al. [17] report an accuracy of 63% on FMA-Medium using hand-crafted features with an SVM under the official split — the most widely cited published result on the FMA dataset. Methods that exploit pretraining or external knowledge are discussed in the text instead: Ding et al. [21] report 68.07% by integrating a knowledge graph built from external instrument annotations (OpenMIC-2018) with audio representations, Lin et al. [24] report 69.00% with genreMERT, a music encoder pretrained on a large corpus, Kim et al. [20] report an F1 score of 0.6629 on FMA-Medium relying on external artist metadata and an 85/15 split of the official training set, and Shen and Xiao [28] report 78.10% with a frozen MusicFM backbone and a linear probe. Because these methods rely on external knowledge or large-scale pretraining, they are not directly comparable with our from-scratch result (65.75%) under the official 80/10/10 artist-level split.
The comparison confirms that FMA is substantially harder than GTZAN: the official FMA benchmark of Defferrard et al. [17] attains 63% on FMA-Medium with hand-crafted features and an SVM, well below typical GTZAN accuracies of the same class of methods. This gap reflects the larger intra-genre diversity and finer-grained genre taxonomy of FMA. Under the same official artist-level split, ResMamba reaches 65.75%, surpassing the Defferrard baseline by 2.75 percentage points while being trained end-to-end from mel-spectrograms with no hand-crafted features, no pretraining, no external data, and no data augmentation. To place this result in context, we additionally trained ResNet-18 [2] and ResNeXt-50 [44] from scratch under the identical protocol (full-resolution mel-spectrograms, AdamW, and the same regularization); these runs are marked with † in Table 7.
Defferrard et al. also organized the official CrowdAI genre recognition challenge on FMA-Medium [18], where models were trained on the entire FMA-Medium subset rather than on a held-out training partition, and the best submission reached a macro F1 of 0.909 on 30,000 held-out clips sampled from FMA-large/full. Since both the training data and the evaluation protocol differ from ours, this result is not directly comparable with the accuracies above. Odle and Lin [27] reproduced the GTZAN and FMA benchmarks with a single uniform pipeline and found that, in their experiments, every architecture they tested scored below commonly reported levels, which they attribute to methodological inconsistency and data leakage in earlier studies.
The strongest published results on this benchmark are obtained under less self-contained conditions that rely on external knowledge or large-scale pretraining (see the discussion above); ResMamba trails the two closest pretraining-based results (Ding et al. [21], 68.07%, and Lin et al. [24], 69.00%) by 2.32 and 3.25 percentage points, respectively, while consuming nothing beyond the audio content of FMA-Medium itself. The higher figure of Shen and Xiao [28] (78.10%) is not directly comparable because it uses a frozen backbone with a linear probe and is therefore not trained on FMA, and the remaining pretraining-based method of Kim et al. [20] reports only macro F1 rather than accuracy. This suggests that pretraining the proposed ConvMamba block on a larger corpus is a promising direction for closing the remaining gap.
5. Conclusion
In this paper, we introduced ResMamba, an architecture that harmonizes Mamba blocks with a ResNet-style hierarchical backbone for music genre classification. We constructed a 4D-compatible Mamba block by wrapping the selective SSM into a residual module, and then designed the ConvMamba dual-path block, which combines this adapted Mamba branch with a parallel convolutional branch through a learned fusion. We further employed a multi-scale fusion head that aggregates hierarchical features across all backbone stages.
Experiments on the GTZAN dataset demonstrated that the ConvMamba dual-path design with multi-scale fusion achieves a 5-fold average accuracy of . Ablation studies confirmed that each component — the convolutional branch and the multi-scale head — contributes positively to overall performance. On the larger FMA benchmarks, ResMamba attains on FMA-Small under 10-fold cross-validation and on FMA-Medium under the official artist-level split, demonstrating consistent generalization without any pretraining or external data.
Future work may explore several directions. First, integrating the ConvMamba blocks into larger backbones (e.g., ResNet-50/101 depth) may further improve accuracy on larger datasets, where the additional capacity can be exploited more effectively than on small benchmarks such as GTZAN. Second, the window-partitioning strategy could be extended with cross-window SSM scanning (inspired by VMamba’s cross-scan module) to enhance inter-window information exchange. Third, transfer learning from large-scale pretrained audio models could provide stronger initial representations. Finally, extending ResMamba to other MIR tasks such as music tagging, instrument recognition, and emotion classification would further validate the generality of the architecture.
References
- Tzanetakis, G.; Cook, P. Musical genre classification of audio signals. IEEE Trans. Speech Audio Process. 2002, 10, 293–302. Available online: http://marsyas.info/downloads/datasets.html. [CrossRef]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. Proc. IEEE Conf. Comput. Vis. Pattern Recognit. (CVPR), 2016; pp. 770–778. [Google Scholar]
- Gu, A.; Dao, T. Mamba: Linear-time sequence modeling with selective state spaces. arXiv 2023, arXiv:2312.00752. [Google Scholar]
- Gu, A.; Goel, K.; Ré, C. Efficiently modeling long sequences with structured state spaces. Proc. Int. Conf. Learn. Represent. (ICLR); 2022. [Google Scholar]
- Gu, A.; Goel, K.; Gupta, A.; Ré, C. On the parameterization and initialization of diagonal state space models. Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), 2022. [Google Scholar]
- Gupta, A.; Gu, A.; Berant, J. Diagonal state spaces are as effective as structured state spaces. Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), 2022. [Google Scholar]
- Zhu, L.; Liao, B.; Zhang, Q.; Wang, X.; Liu, W.; Wang, X. Vision Mamba: Efficient visual representation learning with bidirectional state space model. Proc. Int. Conf. Mach. Learn. (ICML); 2024. [Google Scholar]
- Hatamizadeh, A.; Kautz, J. MambaVision: A hybrid Mamba-Transformer vision backbone. Proc. IEEE/CVF Conf. Comput. Vis. Pattern Recognit. (CVPR), 2025. [Google Scholar]
- Zhang, H.; Liu, H.; Shi, Z.; Mao, S.; Chen, N. ConvMamba: Combining Mamba with CNN for hyperspectral image classification. Neurocomputing 2025, 131016. [Google Scholar] [CrossRef]
- Yue, Y.; Li, Z. MedMamba: Vision Mamba for medical image classification. arXiv 2024, arXiv:2403.03849. [Google Scholar]
- Liu, Y.; Tian, Y.; Zhao, Y.; Yu, H.; Xie, L.; Wang, Y.; Ye, Q.; Liu, Y. VMamba: Visual state space model. Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), 2024. [Google Scholar]
- Choi, K.; Fazekas, G.; Sandler, M.; Cho, K. Convolutional recurrent neural networks for music classification. Proc. IEEE Int. Conf. Acoust. Speech Signal Process. (ICASSP), 2017; pp. 2392–2396. [Google Scholar]
- Loshchilov, I.; Hutter, F. Decoupled weight decay regularization. Proc. Int. Conf. Learn. Represent. (ICLR); 2019. [Google Scholar]
- Choi, K.; Fazekas, G.; Sandler, M. Automatic tagging using deep convolutional neural networks. Proc. Int. Soc. Music Inf. Retr. Conf. (ISMIR), 2016. [Google Scholar]
- Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin Transformer: Hierarchical vision Transformer using shifted windows. Proc. IEEE/CVF Int. Conf. Comput. Vis. (ICCV), 2021; pp. 10012–10022. [Google Scholar]
- Choi, K.; Fazekas, G.; Sandler, M.; Cho, K. Transfer learning for music classification and regression tasks. Proc. Int. Soc. Music Inf. Retr. Conf. (ISMIR), 2017. [Google Scholar]
- Defferrard, M.; Benzi, K.; Vandergheynst, P.; Bresson, X. FMA: A dataset for music analysis. Proc. Int. Soc. Music Inf. Retr. Conf. (ISMIR), 2017; pp. 316–323. Available online: https://github.com/mdeff/fma.
- Defferrard, M.; Mohanty, S. P.; Carroll, S. F.; Salathé, M. Learning to recognize musical genre from audio: Challenge overview. in Companion Proc. Web Conf. (WWW’18 Companion), 2018. [Google Scholar] [CrossRef]
- Heakl, A.; Abdelgawad, A.; Parque, V. A study on broadcast networks for music genre classification. Proc. Int. Jt. Conf. Neural Netw. (IJCNN), Padua, Italy, 2022. [Google Scholar]
- Kim, J.; Won, M.; Serra, X.; Liem, C. C. Transfer learning of artist group factors to musical genre classification. Proc. Web Conf. (WWW), 2018; pp. 1929–1934. [Google Scholar]
- Ding, H.; Zhai, L.; Zhao, C.; Wang, F.; Wang, G.; Xi, W.; Wang, Z.; Zhao, J. Genre classification empowered by knowledge-embedded music representation. IEEE/ACM Trans. Audio Speech Lang. Process. 2024, vol. 32, 2764–2781. [Google Scholar] [CrossRef]
- Shen, J.; Xiao, G. Music genre classification based on functional data analysis. IEEE Access 2024, vol. 12, 185483–185491. [Google Scholar] [CrossRef]
- Chen, J.; Ma, X.; Li, S.; Ma, S.; Zhang, Z.; Ma, X. A hybrid parallel computing architecture based on CNN and transformer for music genre classification. Electronics 2024, vol. 13(no. 16), 3313. [Google Scholar] [CrossRef]
- Lin, Y.-X.; Lin, J.-C.; Wei, W.-L.; Wang, J.-C. Learnable counterfactual attention for music classification. IEEE/ACM Trans. Audio Speech Lang. Process. 2025, vol. 33, 570–584. [Google Scholar] [CrossRef]
- Kim, J.; Urbano, J.; Liem, C. C. S.; Hanjalic, A. One deep music representation to rule them all? A comparative analysis of different segmentation approaches. Neural Comput. Appl. 2020, vol. 32(no. 4), 1067–1093. [Google Scholar] [CrossRef]
- Muniz, V. H. S.; Souza Filho, J. B. O. Robust handcrafted features for music genre classification. Neural Comput. Appl. 2023, vol. 35, 9335–9348. [Google Scholar] [CrossRef]
- Odle, E.; Lin, P.-C. Overfitting in music genre classification: Evaluating differences between the GTZAN and FMA datasets. Proc. 8th Int. Conf. Artif. Intell. Cloud Comput. (AICCC), Tokyo, Japan, 2025; pp. 245–249. [Google Scholar]
- Shen, J.; Xiao, G. Zero-to-few shot music genre classification via prototype calibration and prompt learning in audio–language models. Int. J. Multimed. Inf. Retr. 2026, 15, 24. [Google Scholar] [CrossRef]
- Seo, W.; Cho, S.-H.; Teisseyre, P.; Lee, J. A short survey and comparison of CNN-based music genre classification using multiple spectral features. IEEE Access 2024, vol. 12, 245–259. [Google Scholar] [CrossRef]
- Rai, K.; Bhattacharjee, M. Evaluating pretrained general-purpose audio representations for music genre classification. Proc. Int. Conf. Pattern Recognit. Mach. Intell. (PReMI), 2026; pp. 840–850. [Google Scholar]
- Wu, P.; Gao, W.; Chen, Y.; Xu, F.; Ji, Y.; Tu, J.; Lin, H. An improved ViT model for music genre classification based on mel spectrogram. PLoS ONE 2025. [Google Scholar] [CrossRef]
- Yang, Z.; Zhang, R.; Wang, X. Music genre classification via time-frequency dual-stream neural networks and SimCLR-based self-supervised learning. Informatica 2025, vol. 49(no. 36). [Google Scholar] [CrossRef]
- Setiorini, E.; Widjaja, M.; Wicaksana, A. Reduced convolutional recurrent neural network using MFCC for music genre classification on the GTZAN dataset. Informatica 2025, vol. 49(no. 17), 145–154. [Google Scholar] [CrossRef]
- Gan, R.; Huang, T.; Shao, J.; Wang, F. Music genre classification based on VMD-IWOA-XGBOOST. Mathematics 2024, vol. 12(no. 10), 1549. [Google Scholar] [CrossRef]
- Sturm, B. L. The state of the art ten years after a state of the art: Future research in music information retrieval. J. New Music Res. 2014, vol. 43(no. 2), 147–172. [Google Scholar] [CrossRef]
- Marcel, S.; Rodriguez, Y. Torchvision the machine-vision package of torch. Proc. ACM Int. Conf. Multimedia (MM), 2010; pp. 1485–1488. [Google Scholar]
- Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. Proc. Int. Conf. Learn. Represent. (ICLR); 2015. [Google Scholar]
- Huang, G.; Liu, Z.; van der Maaten, L.; Weinberger, K. Q. Densely connected convolutional networks. Proc. IEEE Conf. Comput. Vis. Pattern Recognit. (CVPR), 2017; pp. 4700–4708. [Google Scholar]
- Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.-C. MobileNetV2: Inverted residuals and linear bottlenecks. Proc. IEEE Conf. Comput. Vis. Pattern Recognit. (CVPR), 2018; pp. 4510–4520. [Google Scholar]
- Howard, A.; Sandler, M.; Chu, G.; Chen, L.-C.; Chen, B.; Tan, M.; Wang, W.; Zhu, Y.; Pang, R.; Vasudevan, V.; Le, Q. V.; Adam, H. Searching for MobileNetV3. Proc. IEEE/CVF Int. Conf. Comput. Vis. (ICCV), 2019; pp. 1314–1324. [Google Scholar]
- Ma, N.; Zhang, X.; Zheng, H.-T.; Sun, J. ShuffleNet V2: Practical guidelines for efficient CNN architecture design. Proc. Eur. Conf. Comput. Vis. (ECCV); 2018; pp. 116–131. [Google Scholar]
- Tan, M.; Le, Q. V. EfficientNet: Rethinking model scaling for convolutional neural networks. Proc. Int. Conf. Mach. Learn. (ICML); 2019; pp. 6105–6114. [Google Scholar]
- Tan, M.; Le, Q. V. EfficientNetV2: Smaller models and faster training. Proc. Int. Conf. Mach. Learn. (ICML); 2021; pp. 10096–10106. [Google Scholar]
- Xie, S.; Girshick, R.; Dollár, P.; Tu, Z.; He, K. Aggregated residual transformations for deep neural networks. Proc. IEEE Conf. Comput. Vis. Pattern Recognit. (CVPR), 2017; pp. 1492–1500. [Google Scholar]
- Zwicker, E.; Fastl, H. Psychoacoustics: Facts and Models, 2nd ed.; Springer: Berlin, Germany, 1999. [Google Scholar]
Figure 1.
Overall architecture of ResMamba. The backbone adopts a four-stage hierarchy, beginning with a stem that projects the 3-channel mel-spectrogram input to 64 feature maps via a convolution followed by a max-pooling layer, yielding a feature map of size . In the high-resolution Stages 1 and 2, whose flattened feature maps would form very long sequences, the feature maps are partitioned into non-overlapping soft windows of size to keep the per-scan sequence length tractable, whereas the low-resolution Stages 3 and 4, whose feature maps are already downsampled to and , allow full-sequence SSM to capture global context across the entire feature map with modest computational overhead. A multi-scale fusion head aggregates features from all stages prior to classification.
Figure 1.
Overall architecture of ResMamba. The backbone adopts a four-stage hierarchy, beginning with a stem that projects the 3-channel mel-spectrogram input to 64 feature maps via a convolution followed by a max-pooling layer, yielding a feature map of size . In the high-resolution Stages 1 and 2, whose flattened feature maps would form very long sequences, the feature maps are partitioned into non-overlapping soft windows of size to keep the per-scan sequence length tractable, whereas the low-resolution Stages 3 and 4, whose feature maps are already downsampled to and , allow full-sequence SSM to capture global context across the entire feature map with modest computational overhead. A multi-scale fusion head aggregates features from all stages prior to classification.

Figure 2.
Architecture of the AdaptMambaBlock. The input is optionally downsampled via AvgPool2d, then processed by a MambaWrapper (stride=1) for global sequential modeling, followed by BatchNorm2d and DropPath regularization. A residual connection adds the identity (or -convolved) input, and ReLU produces the final output.
Figure 2.
Architecture of the AdaptMambaBlock. The input is optionally downsampled via AvgPool2d, then processed by a MambaWrapper (stride=1) for global sequential modeling, followed by BatchNorm2d and DropPath regularization. A residual connection adds the identity (or -convolved) input, and ReLU produces the final output.

Figure 3.
Architecture of the ConvMamba dual-path block. The input feature map is processed in parallel by two branches: a Mamba SSM path for global sequential dependency modeling, and a convolutional path () for local spectro-temporal pattern extraction. Branch outputs are concatenated and fused via a convolution. A residual connection with stochastic depth regularization links the (optionally downsampled) input to the final output.
Figure 3.
Architecture of the ConvMamba dual-path block. The input feature map is processed in parallel by two branches: a Mamba SSM path for global sequential dependency modeling, and a convolutional path () for local spectro-temporal pattern extraction. Branch outputs are concatenated and fused via a convolution. A residual connection with stochastic depth regularization links the (optionally downsampled) input to the final output.

Figure 4.
Mel-spectrograms of the first track from each of the ten GTZAN genres: blues.00000, classical.00000, country.00000, disco.00000, hiphop.00000, jazz.00000, metal.00000, pop.00000, reggae.00000, and rock.00000. Each spectrogram is a decibel-scaled time–frequency representation computed with , hop length , and . The distinct visual patterns across genres support treating genre classification as an image-based task.
Figure 4.
Mel-spectrograms of the first track from each of the ten GTZAN genres: blues.00000, classical.00000, country.00000, disco.00000, hiphop.00000, jazz.00000, metal.00000, pop.00000, reggae.00000, and rock.00000. Each spectrogram is a decibel-scaled time–frequency representation computed with , hop length , and . The distinct visual patterns across genres support treating genre classification as an image-based task.

Figure 5.
Confusion matrix aggregated over all five cross-validation folds for ResMamba on the GTZAN dataset. Rows indicate ground-truth labels and columns indicate predictions. Diagonal entries show the number of correctly classified samples per class. The overall 5-fold accuracy is 88.99%. Classical, Blues, and Metal achieve the highest per-class accuracy, while Rock and Reggae exhibit the most frequent inter-class confusions.
Figure 5.
Confusion matrix aggregated over all five cross-validation folds for ResMamba on the GTZAN dataset. Rows indicate ground-truth labels and columns indicate predictions. Diagonal entries show the number of correctly classified samples per class. The overall 5-fold accuracy is 88.99%. Classical, Blues, and Metal achieve the highest per-class accuracy, while Rock and Reggae exhibit the most frequent inter-class confusions.

Table 1.
Summary of experimental settings.
| Category | Parameter | Value |
|---|---|---|
| Audio preprocessing | Sample rate | 22050 Hz |
| 2048 | ||
| Hop length | 512 | |
| 128 | ||
| Segment duration | 30 s | |
| Mel-spectrogram size | ||
| Input | Resolution | |
| Training | Optimizer | AdamW |
| Base learning rate | ||
| Weight decay | ||
| Batch size | 16 (GTZAN) / 32 (FMA) | |
| Epochs | 120 | |
| Loss function | Cross-entropy | |
| LR schedule | Warmup | Linear, 5 epochs |
| GTZAN | Step: LR at epochs 60 and 90 | |
| FMA-Small, FMA-Medium | Plateau: LR after 10 epochs without improvement (val. acc. & loss) |
|
| Early stopping | GTZAN | Not applied |
| FMA-Small, FMA-Medium | Applied (patience 20) | |
| Regularization | Dropout | 0.1 |
| Drop-path (max) | 0.1 | |
| Evaluation | Cross-validation | GTZAN: track-level stratified 5-fold CV |
| FMA-Small: track-level stratified 10-fold CV | ||
| Official split | FMA-Medium: official artist-level split | |
| Hardware | GPU | NVIDIA RTX 4090 |
| Platform | PyTorch 2.10.0 + CUDA 12.6 |
Rows with colored background indicate dataset-specific settings that differ across datasets.
Table 2.
Effect of input resolution on ResNet-18 performance (5-fold average on GTZAN). Feature Map denotes spatial dimensions before global average pooling. The full-resolution input () achieves the highest accuracy and is adopted for all subsequent experiments.
Table 2.
Effect of input resolution on ResNet-18 performance (5-fold average on GTZAN). Feature Map denotes spatial dimensions before global average pooling. The full-resolution input () achieves the highest accuracy and is adopted for all subsequent experiments.
| Resolution | Comp. | Feature Map | Acc (%) |
|---|---|---|---|
Table 3.
Ablation study of the proposed components on GTZAN (5-fold average, mel-spectrogram input). All variants share identical backbones, hyperparameters, and input resolutions. nBlocks denotes the number of residual blocks per stage; the first four rows adopt blocks per stage, while the deeper variant uses .
Table 3.
Ablation study of the proposed components on GTZAN (5-fold average, mel-spectrogram input). All variants share identical backbones, hyperparameters, and input resolutions. nBlocks denotes the number of residual blocks per stage; the first four rows adopt blocks per stage, while the deeper variant uses .
| Model | Block Type | nBlocks | Acc. (%) | Params (M) |
|---|---|---|---|---|
| ResNet-18 | BasicBlock | 11.2 | ||
| ResMamba | AdaptMamba | 2.2 | ||
| ResMamba | ConvMamba | 14.6 | ||
| ResMamba | ConvMamba+MS | 15.1 | ||
| ResMamba | ConvMamba+MS | 28.0 |
Table 4.
5-fold cross-validation results on GTZAN with mel-spectrogram input. Identical preprocessing and training hyperparameters are used throughout, with no data augmentation applied in any setting. Here and in the following tables, ResMamba denotes our full proposed model, i.e., the four-stage backbone with ConvMamba blocks and the multi-scale fusion (MS) head, with residual blocks per stage. Params are reported for the complete model (including the 10-way classification head). FLOPs are measured at the full resolution.
Table 4.
5-fold cross-validation results on GTZAN with mel-spectrogram input. Identical preprocessing and training hyperparameters are used throughout, with no data augmentation applied in any setting. Here and in the following tables, ResMamba denotes our full proposed model, i.e., the four-stage backbone with ConvMamba blocks and the multi-scale fusion (MS) head, with residual blocks per stage. Params are reported for the complete model (including the 10-way classification head). FLOPs are measured at the full resolution.
| Model | Acc (%) | Params (M) | FLOPs (G) |
|---|---|---|---|
| ResNet-18 | 11.2 | 12.1 | |
| ResNet-34 | 21.3 | 24.3 | |
| ResNet-50 | 23.5 | 27.2 | |
| ResNet-101 | 42.5 | 51.8 | |
| EfficientNet-B0 | 4.0 | 2.6 | |
| EfficientNet-B1 | 6.5 | 3.9 | |
| EfficientNet-B2 | 7.7 | 4.5 | |
| EfficientNet-B3 | 10.7 | 6.5 | |
| EfficientNet V2-S | 20.2 | 19.0 | |
| ResNeXt-50 (32×4d) | 23.0 | 28.2 | |
| Swin-T | 27.5 | 19.7 | |
| MambaVision-T | 31.1 | 29.6 | |
| ResMamba | 15.1 | 15.6 |
Table 5.
Comparison with published methods on GTZAN. Results are cited from the respective publications. The Split column states the data-splitting protocol where explicitly reported in the source paper. Other experimental settings (preprocessing, segment duration, augmentation) also vary across works.
Table 5.
Comparison with published methods on GTZAN. Results are cited from the respective publications. The Split column states the data-splitting protocol where explicitly reported in the source paper. Other experimental settings (preprocessing, segment duration, augmentation) also vary across works.
| Method | Acc (%) | Split |
|---|---|---|
| Chen et al. [23] | 87.41 | 10-fold, segment-levela |
| Gan et al. [34] | 85.5 | 80/20 train/testb |
| Wu et al. [31] | 86.8 | 80/20 train/valb |
| Setiorini et al. [33] | 88.64 | 60/20/20, segment-levela |
| ResMamba (5-fold CV) | 5-fold CVc |
aSegment-level split: short clips from the same recording are treated as independent samples, so clips of one song may appear in both training and test sets, which typically inflates accuracy relative to track-level evaluation. bRandom single track-level partition without artist isolation. cTrack-level stratified 5-fold cross-validation on 999 usable tracks (mean ± std over folds).
Table 6.
Comparison with published methods on the FMA-Small subset. ResMamba is evaluated under 10-fold cross-validation; evaluation protocols of the other methods are detailed in the table footnotes.
Table 6.
Comparison with published methods on the FMA-Small subset. ResMamba is evaluated under 10-fold cross-validation; evaluation protocols of the other methods are detailed in the table footnotes.
| Method | Acc. (%) | Split |
|---|---|---|
| Heakl et al. [19] | 58.30 | 10-fold CVa |
| Muniz et al. [26] | 60.30 | Nested 10-fold CVb |
| Seo et al. [29] | 57.38±0.94 | 80/20×10c |
| ResNet-18 | 59.95±1.81 | 10-fold CVd |
| ResMamba | 64.52±1.88 | 10-fold CVe |
a10-fold CV; Heakl et al. report the highest test accuracy. bNested 10-fold CV: an outer 10-fold loop evaluates generalization performance, while an inner loop performs wrapper-based feature selection within each outer training fold. cRandom 80/20 split repeated 10 times. dResNet-18 trained from scratch by us under the same protocol as ResMamba. eTrack-level stratified 10-fold cross-validation on 7,994 effective tracks (mean ± std over folds).
Table 7.
Comparison with published methods on the FMA-Medium subset. Results marked with † are obtained by our own training runs.
Table 7.
Comparison with published methods on the FMA-Medium subset. Results marked with † are obtained by our own training runs.
| Method | Acc. (%) | Macro F1 | Split |
|---|---|---|---|
| Defferrard et al. [17] | 63.00 | — | Official artist split |
| ResNet-18† | 62.99 | 0.3558 | Official artist split |
| ResNeXt-50† (32×4d) | 61.00 | 0.3516 | Official artist split |
| ResMamba† | 65.75 | 0.4262 | Official artist split |
†Obtained by our own training runs: all models are trained from scratch (no pretraining, no external data, no data augmentation) on full-resolution mel-spectrograms, with AdamW (lr=). Macro F1 is the 16-class macro-averaged F1, computed by us on the corresponding test sets; published methods do not report F1 (indicated by —).
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.