Preprint
Article

This version is not peer-reviewed.

ResMamba: A Dual-Path Convolution-Mamba Model for Music Genre Classification

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: 
;  ;  ;  ;  ;  

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 O ( N ) 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 ( B , C , H , W ) . 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 3 × 3 convolutions for local spectro-temporal feature extraction. The outputs from both branches are concatenated and fused via a learnable 1 × 1 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 88.99 % ± 1.58 % , 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 64.52 % ± 1.88 % on FMA-Small under 10-fold cross-validation and 65.75 % 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.

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 X ∈ R 3 × H × W , the stem first projects it to a 64-channel feature map via a 7 × 7 convolution with stride 2 and padding 3, followed by batch normalization and ReLU activation:
F 0 = ReLU BN Conv 2 d 7 × 7 , s = 2 , p = 3 ( X ) ,
and subsequently applies a 3 × 3 max-pooling layer with stride 2, yielding a feature map of size 64 × H / 4 × W / 4 .
This feature map is subsequently processed through four sequential stages. Each stage k ∈ { 1 , 2 , 3 , 4 } comprises n k residual blocks and produces C k output channels, with ( C 1 , C 2 , C 3 , C 4 ) = ( 64 , 128 , 256 , 512 ) ; 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 ( B , C , H , W ) . The native Mamba block operates on 3D sequences x ∈ R B × N × D , 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 F ∈ R B × C × H × W , MambaWrapper performs a structure-preserving round-trip transformation. Specifically, it first applies a 1 × 1 convolution (proj_in) to project the channel dimension from C to D while maintaining the 4D spatial layout:
F p = Conv 2 d 1 × 1 ( F ) ∈ R B × D × H × W
The projected 4D tensor F p is then flattened along the spatial axes and transposed to form a 3D token sequence with sequence length N = H · W :
u = Flatten ( F p ) ∈ R B × N × D
The resulting 3D tensor u is then fed into the native selective SSM (MambaVisionMixer). Internally, the SSM operates as follows. The input u is projected to an inner dimension 2 d inner through a linear projection and split into two branches x and z , each of width d inner :
x , z = Split ( Proj in ( u ) )
Each branch passes through a depthwise 1D convolution ( d conv = 3 ) followed by SiLU activation to capture local sequential context:
x ˜ = SiLU ( DWConv 1 d ( x ) ) , z ˜ = SiLU ( DWConv 1 d ( z ) )
The selective SSM parameters are computed from x ˜ :
B = Linear B ( x ˜ ) ∈ R L × d state
C = Linear C ( x ˜ ) ∈ R L × d state
Δ = Softplus ( Linear Δ ( x ˜ ) + b Δ )
where d state = 8 is the state dimension. The continuous-time parameters A , B , C are discretized with step size Δ using the first-order approximation:
A ¯ = exp ( Δ A ) , B ¯ = Δ B
where A ∈ R d inner × d state has a diagonal structure with negative real eigenvalues to guarantee stability. The SSM computes the output via the recurrent formulation:
h t = A ¯ t h t − 1 + B ¯ t x ˜ t , y t = C t h t + D ⊙ x ˜ t
where the subscript t indicates that A ¯ t , B ¯ t , and C t 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 z ˜ branch and projecting the combined representation back to the embedding dimension:
o = Proj out Concat y , z ˜
where D is a learnable per-channel skip-connection parameter, and Proj out projects the concatenated 2 d inner -dimensional representation back to dimension D. Finally, the MambaWrapper recovers the 4D spatial layout by transposing and reshaping o from ( B , N , D ) to ( B , D , H , W ) , 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 ( H · W / 16 and H · W / 64 , i.e., 32 × 323 = 10 , 336 and 16 × 161 = 2 , 576 tokens for the 128 × 1292 mel-spectrogram input); we therefore partition the feature map into non-overlapping windows of size 8 × 8 and execute the SSM independently within each window. This reduces the per-scan sequence length to 64 tokens and, for the 128 × 1292 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 H · W / 256 and H · W / 1024 tokens (640 and 160 for the 128 × 1292 input), we instead apply full-sequence SSM ( window _ size = 0 ) 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 x ∈ R C × H × W , optional spatial downsampling is applied when inter-stage resolution reduction is required ( stride > 1 ):
x s = AvgPool2d 2 × 2 ( x ) ,
where x s = x when stride = 1 . 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 stride = 1 , ensuring proper alignment between 2D spatial dimensions and the 1D token sequence:
x m = BN MambaWrapper stride = 1 ( x s ) .
Stochastic depth regularization (DropPath) is subsequently applied to enhance training stability and generalization:
x ˜ m = DropPath γ ( x m ) ,
where the drop probability γ increases linearly with block depth. A residual shortcut provides the identity path; when spatial dimensions or channel counts mismatch ( stride > 1 ), a 1 × 1 convolution with stride 2 followed by BatchNorm is employed to align the skip connection:
x skip = BN Conv2d 1 × 1 , s = 2 ( x ) , if stride > 1 , x , otherwise .
Finally, the output is obtained through residual addition followed by activation:
x out = ReLU x ˜ m + x skip .
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 expansion = 1 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 x ∈ R C × H × W , spatial downsampling, when required between stages ( stride > 1 ), is performed once via average pooling and shared by both branches—identical to the downsampling operation in Eq. (12):
x s = AvgPool2d 2 × 2 ( x ) ,
where x s = x when stride = 1 . The two branches then compute their respective representations from this shared downsampled input as follows.
Mamba branch:
x m = BN MambaWrapper ( x s ) ,
Convolutional branch:
x c = BN ( Conv 3 × 3 ( ReLU BN ( Conv 3 × 3 ( x s ) ) ) ) .
The branch outputs are concatenated along the channel dimension and fused via a 1 × 1 convolution:
x f = BN Conv 1 × 1 ( [ x m ; x c ] ) ,
where [ · ; · ] denotes channel-wise concatenation. Finally, the output is obtained through a residual connection with stochastic depth:
x out = ReLU DropPath ( x f ) + x skip ,
where the identity shortcut follows the same projection strategy as Eq. (15): x skip = BN Conv2d 1 × 1 , s = 2 ( x ) when stride > 1 , and x skip = x otherwise. Notably, the 1 × 1 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 F k ∈ R C k × H k × W k denote the output feature map of stage k ( k = 1 , … , 4 ). Each F k is first spatially aligned to a uniform resolution via adaptive average pooling, then concatenated along the channel dimension:
F concat = Concat ( AdaptivePool ( F 1 ) , … , AdaptivePool ( F 4 ) ) .
The fused representation is subsequently compressed by a 1 × 1 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 [ 2 , 2 , 2 , 2 ] blocks and a deeper configuration with [ 3 , 4 , 6 , 3 ] 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 [ 3 , 4 , 6 , 3 ] 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 128 × 1292 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 ( σ = 0.08  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 n fft = 2048 , hop length = 512 , and n mels = 128 , yielding a 128 × 1292 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 128 × 1292 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 10 − 4 and a weight decay of 10 − 2 , preceded by a 5-epoch linear warmup from 2 × 10 − 5 to 10 − 4 . On GTZAN, the learning rate follows a step-based schedule that multiplies it by 0.1 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 0.5 only when both the validation accuracy and the validation loss show no improvement for 10 consecutive epochs, down to a floor of 10 − 6 (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:
  • 128 × 320 ( ≈ 4 × compression): aggressive downsampling approaching the ∼ 100  ms perceptual threshold [45];
  • 128 × 640 ( ≈ 2 × compression): moderate temporal compression;
  • 128 × 960 ( 1.35 × compression): fine temporal granularity;
  • 128 × 1292 (no compression): full-resolution input.
Downsampled resolutions are obtained via AdaptiveAvgPool2d applied to the original 128 × 1292 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 128 × 320 ( 78.28 % ), where the effective frame interval approaches the ∼ 100  ms perceptual threshold [45], whereas the full-resolution input achieves the best accuracy ( 85.38 % ). The largest gain occurs between 128 × 320 and 128 × 640 ( + 4.90 percentage points), and the temporal axis continues to carry substantial genre-discriminative information up to the full resolution, with a further improvement of + 2.20 percentage points from 128 × 640 to 128 × 1292 . This indicates that performance has not yet saturated at ≈ 23  ms granularity.
Based on these findings, we adopt the full-resolution 128 × 1292 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 [ 3 , 4 , 6 , 3 ] variant to examine the impact of network depth. All ResMamba variants share an identical ResNet-style backbone, training hyperparameters, and input resolution of 128 × 1292 . 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 ( 86.79 % ) already surpasses the ResNet-18 baseline ( 85.38 % ) 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 3 × 3 convolutions (with BatchNorm and ReLU), stabilizing early-layer representations, while the Mamba branch captures complementary global dependencies. A learned 1 × 1 fusion dynamically balances these pathways. Incorporating the ConvMamba block (w/o MS) yields a gain to 88.39 % ( + 1.60 points over Mamba-only). Adding the multi-scale fusion head further improves accuracy to 88.99 % ( + 0.60 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 1 × 1 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 [ 2 , 2 , 2 , 2 ] backbone ( 88.99 % , 15.1M params) to the deeper [ 3 , 4 , 6 , 3 ] architecture ( 87.49 % , 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 128 × 1292 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 1292 / 4 = 323 , 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 224 × 224 images: the first two stages are purely convolutional, and the last two stages use 14 × 14 and 7 × 7 windows. In our spectrogram setting, however, the stride-4 convolutional stem and stage-wise 2 × 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 = 0 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 128 × 1292 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 3.2 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 128 × 1292 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 88.99 % ± 1.58 % , 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 128 × 1292 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 64.52 % ± 1.88 % , 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 ( 59.95 % ± 1.81 % ), 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 128 × 1292 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 1 × 1 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 88.99 % ± 1.58 % . 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 64.52 % ± 1.88 % on FMA-Small under 10-fold cross-validation and 65.75 % 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

  1. 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]
  2. 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]
  3. Gu, A.; Dao, T. Mamba: Linear-time sequence modeling with selective state spaces. arXiv 2023, arXiv:2312.00752. [Google Scholar]
  4. Gu, A.; Goel, K.; Ré, C. Efficiently modeling long sequences with structured state spaces. Proc. Int. Conf. Learn. Represent. (ICLR); 2022. [Google Scholar]
  5. 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]
  6. 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]
  7. 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]
  8. Hatamizadeh, A.; Kautz, J. MambaVision: A hybrid Mamba-Transformer vision backbone. Proc. IEEE/CVF Conf. Comput. Vis. Pattern Recognit. (CVPR), 2025. [Google Scholar]
  9. 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]
  10. Yue, Y.; Li, Z. MedMamba: Vision Mamba for medical image classification. arXiv 2024, arXiv:2403.03849. [Google Scholar]
  11. 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]
  12. 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]
  13. Loshchilov, I.; Hutter, F. Decoupled weight decay regularization. Proc. Int. Conf. Learn. Represent. (ICLR); 2019. [Google Scholar]
  14. Choi, K.; Fazekas, G.; Sandler, M. Automatic tagging using deep convolutional neural networks. Proc. Int. Soc. Music Inf. Retr. Conf. (ISMIR), 2016. [Google Scholar]
  15. 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]
  16. 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]
  17. 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.
  18. 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]
  19. 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]
  20. 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]
  21. 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]
  22. Shen, J.; Xiao, G. Music genre classification based on functional data analysis. IEEE Access 2024, vol. 12, 185483–185491. [Google Scholar] [CrossRef]
  23. 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]
  24. 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]
  25. 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]
  26. 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]
  27. 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]
  28. 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]
  29. 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]
  30. 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]
  31. 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]
  32. 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]
  33. 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]
  34. 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]
  35. 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]
  36. Marcel, S.; Rodriguez, Y. Torchvision the machine-vision package of torch. Proc. ACM Int. Conf. Multimedia (MM), 2010; pp. 1485–1488. [Google Scholar]
  37. Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. Proc. Int. Conf. Learn. Represent. (ICLR); 2015. [Google Scholar]
  38. 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]
  39. 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]
  40. 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]
  41. 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]
  42. 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]
  43. Tan, M.; Le, Q. V. EfficientNetV2: Smaller models and faster training. Proc. Int. Conf. Mach. Learn. (ICML); 2021; pp. 10096–10106. [Google Scholar]
  44. 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]
  45. 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 7 × 7 convolution followed by a 3 × 3 max-pooling layer, yielding a feature map of size 64 × H / 4 × W / 4 . 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 8 × 8 to keep the per-scan sequence length tractable, whereas the low-resolution Stages 3 and 4, whose feature maps are already downsampled to H / 16 × W / 16 and H / 32 × W / 32 , 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 7 × 7 convolution followed by a 3 × 3 max-pooling layer, yielding a feature map of size 64 × H / 4 × W / 4 . 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 8 × 8 to keep the per-scan sequence length tractable, whereas the low-resolution Stages 3 and 4, whose feature maps are already downsampled to H / 16 × W / 16 and H / 32 × W / 32 , 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.
Preprints 241934 g001
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 1 × 1 -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 1 × 1 -convolved) input, and ReLU produces the final output.
Preprints 241934 g002
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 ( 3 × 3 → 3 × 3 ) for local spectro-temporal pattern extraction. Branch outputs are concatenated and fused via a 1 × 1 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 ( 3 × 3 → 3 × 3 ) for local spectro-temporal pattern extraction. Branch outputs are concatenated and fused via a 1 × 1 convolution. A residual connection with stochastic depth regularization links the (optionally downsampled) input to the final output.
Preprints 241934 g003
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 128 × 1292 decibel-scaled time–frequency representation computed with n fft = 2048 , hop length = 512 , and n mels = 128 . 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 128 × 1292 decibel-scaled time–frequency representation computed with n fft = 2048 , hop length = 512 , and n mels = 128 . The distinct visual patterns across genres support treating genre classification as an image-based task.
Preprints 241934 g004
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.
Preprints 241934 g005
Table 1. Summary of experimental settings.
Table 1. Summary of experimental settings.
Category Parameter Value
Audio preprocessing Sample rate 22050 Hz
n fft 2048
Hop length 512
n mels 128
Segment duration 30 s
Mel-spectrogram size 128 × 1292
Input Resolution 128 × 1292
Training Optimizer AdamW
Base learning rate 10 − 4
Weight decay 10 − 2
Batch size 16 (GTZAN) / 32 (FMA)
Epochs 120
Loss function Cross-entropy
LR schedule Warmup Linear, 5 epochs
GTZAN Step: 0.1 × LR at epochs 60 and 90
FMA-Small, FMA-Medium Plateau: 0.5 × 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 ( 128 × 1292 ) 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 ( 128 × 1292 ) achieves the highest accuracy and is adopted for all subsequent experiments.
Resolution Comp. Feature Map Acc (%)
128 × 320 4.0 × 4 × 10 78.28 ± 2.62
128 × 640 2.0 × 4 × 20 83.18 ± 2.45
128 × 960 1.35 × 4 × 30 84.28 ± 1.91
128 × 1292 1.0 × 4 × 41 85 . 38 ± 1 . 54
Table 3. Ablation study of the proposed components on GTZAN (5-fold average, 128 × 1292 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 [ 2 , 2 , 2 , 2 ] blocks per stage, while the deeper variant uses [ 3 , 4 , 6 , 3 ] .
Table 3. Ablation study of the proposed components on GTZAN (5-fold average, 128 × 1292 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 [ 2 , 2 , 2 , 2 ] blocks per stage, while the deeper variant uses [ 3 , 4 , 6 , 3 ] .
Model Block Type nBlocks Acc. (%) Params (M)
ResNet-18 BasicBlock [ 2 , 2 , 2 , 2 ] 85.38 ± 1.54 11.2
ResMamba AdaptMamba [ 2 , 2 , 2 , 2 ] 86.79 ± 1.03 2.2
ResMamba ConvMamba [ 2 , 2 , 2 , 2 ] 88.39 ± 2.55 14.6
ResMamba ConvMamba+MS [ 2 , 2 , 2 , 2 ] 88 . 99 ± 1 . 58 15.1
ResMamba ConvMamba+MS [ 3 , 4 , 6 , 3 ] 87.49 ± 0.88 28.0
Table 4. 5-fold cross-validation results on GTZAN with 128 × 1292 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 [ 2 , 2 , 2 , 2 ] residual blocks per stage. Params are reported for the complete model (including the 10-way classification head). FLOPs are measured at the full 128 × 1292 resolution.
Table 4. 5-fold cross-validation results on GTZAN with 128 × 1292 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 [ 2 , 2 , 2 , 2 ] residual blocks per stage. Params are reported for the complete model (including the 10-way classification head). FLOPs are measured at the full 128 × 1292 resolution.
Model Acc (%) Params (M) FLOPs (G)
ResNet-18 85.38 ± 1.54 11.2 12.1
ResNet-34 82.38 ± 0.95 21.3 24.3
ResNet-50 85.08 ± 1.16 23.5 27.2
ResNet-101 82.18 ± 2.71 42.5 51.8
EfficientNet-B0 77.98 ± 1.39 4.0 2.6
EfficientNet-B1 76.68 ± 2.98 6.5 3.9
EfficientNet-B2 78.38 ± 2.16 7.7 4.5
EfficientNet-B3 78.48 ± 2.78 10.7 6.5
EfficientNet V2-S 81.48 ± 1.88 20.2 19.0
ResNeXt-50 (32×4d) 84.88 ± 3.07 23.0 28.2
Swin-T 77.48 ± 1.75 27.5 19.7
MambaVision-T 83.59 ± 4.16 31.1 29.6
ResMamba 88 . 99 ± 1 . 58 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) 88 . 99 ± 1 . 58 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 128 × 1292 mel-spectrograms, with AdamW (lr= 10 − 4 ). 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.
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.