[Paper Review] Automatic Piano Transcription with Hierarchical Frequency-Time Transformer
This paper proposes hFT-Transformer, a two-level hierarchical frequency-time Transformer architecture for automatic piano transcription that models long-range spectral and temporal dependencies. By applying a 1D convolutional block followed by frequency-axis and time-axis Transformer encoders, and using a Transformer decoder to project frequency bins to piano pitches, the method achieves state-of-the-art F1 scores across all metrics on MAPS and MAESTRO v3.0.0 datasets.
Taking long-term spectral and temporal dependencies into account is essential for automatic piano transcription. This is especially helpful when determining the precise onset and offset for each note in the polyphonic piano content. In this case, we may rely on the capability of self-attention mechanism in Transformers to capture these long-term dependencies in the frequency and time axes. In this work, we propose hFT-Transformer, which is an automatic music transcription method that uses a two-level hierarchical frequency-time Transformer architecture. The first hierarchy includes a convolutional block in the time axis, a Transformer encoder in the frequency axis, and a Transformer decoder that converts the dimension in the frequency axis. The output is then fed into the second hierarchy which consists of another Transformer encoder in the time axis. We evaluated our method with the widely used MAPS and MAESTRO v3.0.0 datasets, and it demonstrated state-of-the-art performance on all the F1-scores of the metrics among Frame, Note, Note with Offset, and Note with Offset and Velocity estimations.
Motivation & Objective
- Address the challenge of modeling long-term spectral and temporal dependencies in polyphonic piano music for accurate automatic transcription.
- Overcome limitations of 2D convolutions and pooling layers that reduce frequency resolution and hinder harmonic structure modeling.
- Improve onset and offset estimation accuracy, especially at chunk boundaries during inference, by introducing a stride-halving technique.
- Demonstrate the effectiveness of a two-level hierarchical Transformer design that processes frequency and time axes separately with dedicated attention mechanisms.
- Enhance pitch representation learning by replacing linear projection with a Transformer decoder for frequency-to-pitch dimension conversion.
Proposed method
- Apply a 1D convolutional block along the time axis to extract temporal features before frequency-axis attention.
- Use a Transformer encoder to model long-range dependencies across frequency bins, preserving high-frequency resolution.
- Employ a Transformer decoder to project the frequency dimension (F bins) to the number of piano pitches (P = 88), replacing standard linear layers.
- Stack a second Transformer encoder along the time axis to model long-term temporal dynamics and improve offset prediction.
- Implement a stride-halving inference technique that uses only the central portion of each processing chunk to reduce boundary-related accuracy fluctuations.
- Train with a multi-task loss combining outputs from the first (frequency-processed) and second (time-processed) stages, using balanced loss coefficients (α₁=1.0, α₂=1.0) for optimal convergence and performance.

Experimental results
Research questions
- RQ1Can a two-level hierarchical Transformer architecture that separately models frequency and time axes improve piano transcription performance compared to standard 2D CNN or RNN-based models?
- RQ2Does replacing linear projection with a Transformer decoder for frequency-to-pitch dimension conversion lead to measurable performance gains in note and velocity estimation?
- RQ3How does the inclusion of a second Transformer encoder in the time axis affect offset and velocity prediction accuracy?
- RQ4To what extent does the proposed stride-halving inference technique mitigate performance degradation at chunk boundaries?
- RQ5What is the optimal balance between the first-stage and second-stage loss components for training stability and final F1 score?
Key findings
- hFT-Transformer achieved state-of-the-art F1 scores on all four evaluation metrics—Frame, Note, Note with Offset, and Note with Offset and Velocity—on both MAPS and MAESTRO v3.0.0 datasets.
- The second Transformer encoder in the time axis improved the Note with Offset F1 score from 80.23 (without) to 84.42 (with), demonstrating its value in modeling temporal dynamics.
- Replacing the linear converter with a Transformer decoder increased the Note with Offset and Velocity F1 score from 69.34 to 75.95, indicating significant performance gains from attention-based projection.
- Using a 2D convolutional block instead of a 1D block degraded performance, likely due to reduced frequency resolution and incoherent spectral-temporal feature aggregation.
- The optimal loss coefficient pair was found to be (α₁=1.0, α₂=1.0), as it yielded the highest F1 scores and fastest convergence; omitting the first-stage loss (α₁=0.0) led to training failure with near-zero F1 scores.
- The stride-halving inference technique effectively reduced boundary-related accuracy fluctuations, improving overall robustness in chunked inference.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.