Manuscript Offprint
arXiv:2611.04476KeyWise: Efficient Video-Only Piano Transcription with a Lightweight Per-Key Architecture
Abstract
Audio-based piano transcription is hampered by the sustain pedal and by noisy or missing soundtracks, problems that video-only transcription avoids, since a top-view video shows directly when each key is pressed and released. Most visual transcription networks, however, describe the whole keyboard with one global feature vector and must learn where each key is. In this paper, we propose KeyWise, a lightweight per-key architecture that exploits the known geometry of the keyboard instead of learning it. The rectified keyboard is divided into 88 equal tiles that serve as regions of interest (ROIs), and one small recurrent network, shared by all keys, follows each key over time. On PianoVAM, KeyWise reaches the onset accuracy of the state-of-the-art V2N (95.0% vs. 94.7% onset F1 at 50 ms and 97.8% vs. 97.0% at 100 ms) with 1.3 M instead of 28.2 M parameters, and it runs 4.7 times faster on the same GPU. At 100 ms, it is also significantly more accurate when the key releases (97.0% vs. 95.5% F1) or the velocities (89.4% vs. 84.5% F1) must be correct as well. On PianoYT, KeyWise pre-trained on PianoVAM reaches 69.4% onset F1 at 100 ms, comparable to the best published result, although it needs fine-tuning for new recording conditions.
Keywords: Visual piano transcription, Automatic music transcription, Key detection, Regions of interest, Per-key network, Video analysis
1 Introduction
Automatic music transcription (AMT) is the process of (automatically) converting a music performance into a symbolic representation such as MIDI or a score [1]. Among all instruments, the piano is the most studied in AMT, both because of its central role in Western music and because large, precisely aligned datasets can be recorded on computer-controlled instruments such as the Yamaha Disklavier [2]. It is nevertheless a demanding case. Piano spans 88 pitches over more than seven octaves and is highly polyphonic,
with dense chords and both hands often playing at once. Its notes are rich in harmonics that overlap between simultaneous pitches, which causes octave and harmonic confusions. Each note begins with a sharp percussive attack and then decays, so the start of a note is well defined but its end is acoustically ambiguous. This is mainly why deep audio models built on the onsets-and-frames formulation have brought onset detection close to saturation on clean studio recordings [2, 3], while aspects such as offsets, velocities and robustness to unseen recording conditions remain open, and models trained on a single corpus generalize poorly to other pianos and rooms [4]. A further difficulty is specific to the piano, namely that the sustain pedal decouples sound from action. When the pedal is held, a string keeps sounding long after its key has been released. As a result, audio cannot reliably recover how long each key was held, which is the information a performer's score and fingering depend on. Audio transcription also degrades in noisy or reverberant rooms, in multi-instrument mixes, and when the soundtrack is missing or corrupted [5, 6].
Video, on the other hand, observes the keys directly and is unaffected by all three aforementioned problems, namely the sustain pedal, the acoustic conditions and a missing soundtrack. For example, the moment a key is released shows whether a note that keeps sounding is sustained by the pedal. Which hand plays each note can guide towards a more accurate assignment of notes to staves. Moreover, video is useful when the audio is missing or has low quality, for example in silent videos, in noisy rooms, or in videos where other instruments play at the same time. However, video-only music transcription brings its own challenges, since hands occlude the keys, low frame rates limit temporal precision, and camera viewpoints and lighting vary. Despite the benefits visual information can bring to music transcription, and the widespread use of video in every aspect of life, including music performance, visual AMT remains underexplored, although it has recently begun to attract growing research interest.
Most of the recent visual transcription networks [5-8] describe the whole keyboard image with a single global feature vector and predict all 88 keys from it. Some of them add a position prior to their features [5, 6], but every key is still decided from one vector that describes the whole keyboard. Such a network has to learn two things at the same time, namely what a pressed key looks like and where each key is located. The second, however, is already given by the geometry of the keyboard itself. After a perspective warp, the keyboard becomes a straight strip, and the position of each key within the strip is known and fixed. In other words, pitch becomes, to a good approximation, position.
In this work, we propose KeyWise, a new model that is built around this observation. The rectified strip is divided into 88 equal tiles, one
for each key, and each tile is used as the region of interest (ROI) of its key. The whole strip is processed by a convolutional encoder whose output has exactly one feature column per key ROI, so that the features of each key remain at the position of that key. A single small recurrent network, shared by all keys, then follows each key over time and decides, for every video frame, whether a note starts and whether the key is held. Since all 88 keys share the same weights, what the model learns from one key also benefits the others, including keys that are rarely played.
Our main contributions are summarized as follows:
- A new per-key model for video-only piano transcription, in which every key is a fixed ROI of the rectified keyboard and one shared network predicts the onset, the key state and the velocity of every key at every frame. The model has 1.3 M parameters, about 22 times fewer than the current state of the art, and runs 4.7 times faster on the same GPU.
- Evidence that the per-key design matters. On the PianoVAM test set, the model reaches the onset accuracy of V2N [6] and is significantly more accurate at 100 ms when the key releases or the velocities are also considered. When the key ROIs are replaced by one global feature vector, the same network loses accuracy, mainly at the two ends of the keyboard, even when that vector keeps one position per key.
The rest of the paper is organized as follows. The related literature on automatic music transcription from video is reviewed in Section 2. In Section 3 the proposed architecture is described. The experimental setup and the results are presented in Sections 4 and 5, respectively. Finally, Section 6 concludes the paper.
The first visual-only systems relied on classical computer vision, detecting pressed keys from differences between the current frame and a background image of the empty keyboard [14]. Such methods are sensitive to illumination changes, shadows and occlusion by the hands. Other systems relied on depth cameras [15, 16], or classified cropped images of individual keys with a CNN after extensive pre-processing [17].
More closely related to our work are the deep networks that transcribe the piano from video alone. Sight to Sound (S2S) [5] was the first end-to-end deep network for visual piano transcription. Given five consecutive grayscale frames of a registered keyboard crop (25 fps, 0.2 s), it predicts which of the 88 notes have an onset near the middle frame. Its ResNet-18 backbone adds a 3D convolution that averages the early features of the five frames with learned weights, and a slope module that feeds a fixed vector of 88 linearly spaced values into the network to restore the horizontal position information that a classification CNN tends to discard. The same paper introduced the PianoYT dataset, which is also used in this work and described in Section 4.1. S2S reached 66.6% onset F1 on the original PianoYT test split. However, S2S predicts onsets only, sees 0.2 s of context and supervises only the center frame. Video2Roll Net (V2R) [7], part of a system that generates audio for silent piano videos, is a similar ResNet-18 that predicts the pressed keys from 5-frame windows.
Pay Attention to the Keys [8], called PPAN in [6] and in this paper, replaces the CNN with a video Vision Transformer. It cuts six grayscale frames (0.2 s at 30 fps) of a keyboard crop into spatio-temporal tubelets with absolute positional embeddings and processes them with a ViT-small encoder initialized from distilled video-ViT weights [18], on which the results depend strongly. PPAN also introduced R3, about 31 hours of rehearsal recordings by two professional pianists on two silent-system upright pianos, with synchronized video, audio and real
MIDI. Trained on R3, PPAN outperforms S2S and V2R (onset F-score 0.87 vs. 0.84 on R3s) and is the only model with meaningful zero-shot transfer to PianoYT (0.40); after onset-only fine-tuning on PianoYT, it reaches 0.68, against 0.64 for both CNNs.
V2N [6] is the current state of the art and presents itself as the first complete visual transcription system, predicting onset, offset, key hold and velocity, with offsets defined as physical key releases. It clearly outperforms earlier systems on PianoVAM [12], as shown in Table 1, it is the first visual system to report note-level velocity, and on R3 it outperforms all baselines by a wide margin (on R3s, 78.8% vs. at most 44.0% onset F1 at 50 ms). This comes at the cost of a large model, with 28.2 M parameters and 125 GFLOPs per 1 s clip. V2N turns each grayscale frame (25 fps) into one vector with the S2S feature extractor, models 1 s windows with Conformer blocks, and predicts the four attributes with BiLSTM heads.
The aforementioned works differ from Key-Wise in where the keys are represented. S2S and V2N add a position prior (a slope vector and a learned spatial encoding, respectively), but all the deep networks above predict the 88 keys jointly from features of the whole keyboard. Akbari et al. [17], on the other hand, judged keys separately, but frame by frame and after hand-crafted preprocessing. KeyWise instead keeps one learned feature column per key from the encoder to the output and shares one temporal model over all keys, an idea related to the pitch-shared recurrent layers of the audio transcriber HPPNet [19]. As a result, it is much smaller than the state of the art.
3 KeyWise Architecture
In most visual recognition problems, the objects of interest may appear anywhere in the image, at any scale and in any number. The 88 keys of a piano, in contrast, form a fixed and fully known layout, so once the keyboard is rectified, the position of each key, and therefore its pitch, is known in advance. KeyWise exploits this with a well-known tool of image and video processing, the region of interest (ROI), as in video coding, where important regions receive more bits [20]. Here the ROIs are not detected but given by the instrument itself, as each key of the rectified keyboard is an ROI and the same decision process is applied to all 88 of them. Visual piano transcription thus becomes 88 identical per-key problems that share their parameters and differ only in where they look. Fig. 1 gives an overview of the model.
3.1 Keyboard rectification and key regions of interest
Each dataset gives the position of the keyboard, as four corner points per recording in PianoVAM and as a bounding box per video in PianoYT. The homography that maps these four corners to the corners of a strip of width and height pixels, with key A0 at the left and C8 at the right edge, gives the rectified color strip , where is the video frame, sampled with bilinear interpolation, and . PianoVAM videos are at 60 fps, and PianoYT videos mostly at 23.98–60 fps. We decode them at 720p, where the PianoVAM keyboard spans about 1150 pixels, and resample them to 30 fps by taking, for frame , the native frame closest to time s.
We then cut the strip into 88 equal tiles, so that the ROI of key , counted from A0, is , with pixels. The encoder reduces the width by a factor of 16, so it produces exactly one feature column per ROI, as illustrated in Fig. 2. On a real keyboard, however, the black keys sit between equal white keys, so an equal tile does not follow the exact outline of its key. On a standard keyboard, the center of a tile lies up to about 17 pixels from the center of its key, and the center of the receptive field of encoder column , which lies 7.5 pixels left of the tile center because of zero padding, up to about 20 pixels. Since the receptive field is 91 pixels wide, each key still lies well inside it, and the column can learn which pixels belong to its key. Indeed, as the analysis in Section 5.1 shows, the model almost never confuses neighboring keys.
3.2 Encoder and shared temporal model
The encoder E has four blocks, each with a convolution with stride 2 and a convolution with stride 1, both followed by batch normalization [21] and a ReLU. The blocks have 32, 64, 128 and 192 channels, and since each stride-2 convolution halves the height and the width, the strip becomes a feature map of 7 rows and 88 columns, i.e. one column per key ROI. We average each column over its 7 rows and apply a shared convolution with 64 output channels and a ReLU, which gives one vector per key and frame,
The same two-layer bidirectional GRU [22], with 128 units per direction and dropout 0.2, then runs over a clip of frames for each key separately, i.e. the 88 keys are 88 sequences with shared weights, and gives . Two linear heads give the onset and frame probabilities of key at frame ,
(2)
where is the logistic function and stops the gradient. As in Onsets and Frames [2], the frame head thus also receives the onset probability, without passing gradients to it. A third head, which predicts the velocity, is described in Section 3.3. The model has 1,299,491 parameters, and almost all of its computation, about multiply-accumulate operations (MACs) per frame or per second of video at 30 fps, is spent in the encoder.
3.3 Training objective and decoding
The targets are frame-level rolls. The onset target is 1 at the frame nearest to a note onset of key k and at the next frame, and the frame target is 1 from the onset to the offset of the note. Since positive targets are rare, we use a weighted binary cross-entropy
(3)
and the loss is . If two onsets of the same key fall in consecutive frames,

Fig. 1 Overview of KeyWise. On the left, the keyboard is rectified from its four corners and cut into 88 equal key ROIs. In the middle, a CNN encoder gives one feature column per key ROI, and a BiGRU shared by all 88 keys feeds the onset, frame and velocity heads of every key at every frame. On the right, an encoder block and the per-key temporal model are shown in more detail.

Fig. 2 Key ROIs through the encoder, for five keys around C4. Each block halves the width, so the 16-pixel ROI of key becomes exactly one column of the final feature map, which is averaged into the key vector of Eq. (1).
their onset targets merge, and only one note can be decoded. For velocity, a third linear head with a sigmoid output on (257 parameters) predicts the MIDI velocity divided by 127. As in [2], it is trained with the squared error at the onset frames only, added to with weight 1, and a decoded note takes the velocity of its onset frame.
At test time, each video is processed in windows of 512 frames (about 17 s) that start every 448 frames, so consecutive windows overlap by 64
frames. In this overlap, we average the probabilities of the two windows, so that frames near the edge of a window, where the BiGRU sees little context, also benefit from the neighboring window. A note of key starts at frame when the onset probability crosses a threshold , i.e. , and it ends at the first frame with or with a new onset of the same key. The predicted onset is placed at the time stamp s of frame , and onset frames also count as active, so every note lasts at least one frame. The two thresholds are chosen on validation data, as described in Section 4.2.
4 Experimental setup
4.1 Datasets
PianoVAM. We use the official v1.1 split of PianoVAM [12], the same as V2N [6], with 81 training recordings (we use 80, as recording 2024-09-05_21-37-08 could not be decoded), 9 validation and 9 test recordings (42,241 test notes). As note offset we use the key release, which a camera can see, while the sound can last longer because of the sustain pedal. With our labels, the predictions released by V2N reproduce its published onset scores exactly and its other scores within 0.4 points.
PianoYT. PianoYT [5] consists of top-view YouTube piano videos, mostly by a single pianist, whose labels were obtained by running Onsets and Frames [2] on the audio of each video. These pseudo-labels carry the errors of the audio transcriber and pedal-extended offsets. The dataset lists 228 videos, 207 for training and 21 for testing. We removed seven unusable training videos (no camera view, a wrong keyboard box, or a duplicate) and kept 21 others for validation, which leaves 179 for training. We use all 21 test videos (33,535 notes), as in [8]; one of them is no longer on YouTube, and we evaluated it from an earlier copy. PPAN used all training videos still available (two were missing), so our training sets differ.
4.2 Training and threshold selection
KeyWise is implemented in PyTorch and trained on one NVIDIA RTX 3090 GPU, on clips of frames (1.07 s) in batches of 8. We use AdamW [23] with learning rate and weight decay , a linear warm-up over 3% of the steps and a cosine decay [24] to 2% of the peak learning rate, 25 epochs, gradient clipping at 3.0 and mixed precision. On 80% of the clips, we apply random augmentation, namely horizontal scaling (), horizontal and vertical shifts ( pixels), rotation (), brightness and contrast changes (), conversion to grayscale (probability 0.1) and Gaussian noise (standard deviation 0.02, probability 0.3). We keep the epoch with the best frame-level onset F1 on the validation split. For fine-tuning on PianoYT, we start from a PianoVAM model and train for 12 epochs with learning rate and 5% warm-up. Each setting (PianoVAM, PianoVAM with the velocity head, PianoYT, and PianoYT after PianoVAM pre-training) is trained three times with different random seeds, which change the initial weights, the order of the training clips and the augmentation.
The thresholds and are chosen on the validation split in three steps. We first search (from 0.05 to 0.98) with , then (from 0.1 to 0.9) with the best , and finally again with the best . On PianoVAM we maximize the note F1 with onsets and offsets (with the default offset rule of mir_eval [25], for this choice only),
and on PianoYT the onset F1, because its offsets are unreliable, in both cases at 50 ms onset tolerance. The test split is never used for any choice. The selected onset threshold is 0.90 for all three PianoVAM runs and 0.50–0.60 on PianoYT, and the frame threshold is 0.50–0.70 on PianoVAM and 0.60–0.80 on PianoYT. With a positive weight in Eq. (3), the model outputs where an unweighted model would output 0.5, i.e. 0.89 for onsets and 0.67 for frames, so follows from the loss weight.
4.3 Evaluation
We evaluate all systems with the note metrics of mir_eval [25], which are used by all the works reviewed in Section 2; our own scorer, which matches the notes of each pitch separately for speed, gives exactly the same results. A predicted note counts as correct for the onset F1 if its pitch is correct and its onset lies within ms or ms of a reference note, and each reference note can be matched only once. The 50 ms tolerance is the standard in audio transcription, but at video frame rates a frame already lasts 33–40 ms, which is why visual works also report results at 100 ms. Following V2N [6], we also report the onset-and-offset F1 (“+Off”), in which the offset must also lie within the tolerance, and the frame F1 on a 60 Hz grid. The velocity metrics “+Vel” and “+Off+Vel” additionally require a correct velocity, which, following the code of V2N, means a velocity within 12.7 MIDI steps of the reference. This rule is lenient, since even a constant velocity scores 62.7–64.2% +Vel at 50 ms. All scores are averaged over the recordings.
For KeyWise, we report the mean and standard deviation of three runs. To compare two systems, we average the score of each recording over the runs and apply the exact two-sided Wilcoxon signed-rank test [26] to the paired recordings; with only 9 test recordings, the smallest possible -value is 0.004. As several metrics are compared, we also correct the -values with the Holm–Bonferroni method [27], separately for the five note and the four velocity metrics, and we compute 95% bootstrap confidence intervals over the recordings. The MIDI files released by V2N for the PianoVAM test set are scored with exactly the same code as our own predictions, although the two systems receive different inputs (a color strip at 30 fps vs. an 800 × 144 grayscale image at 25 fps), which we regard as part of each design. For all other systems, we copy the numbers reported in [6] for PianoVAM and in [8] for PianoYT, on the same 21 test videos.
4.4 Ablation variants
To measure the effect of the key ROIs, we also train a global variant, which follows the conventional design. It uses the same encoder, but its feature map is pooled to 16 horizontal bins, flattened (3072 values) and projected to one 256-dimensional vector per frame, which is followed by a two-layer bidirectional GRU with 256 units per direction and two linear heads with 88 outputs. The global variant has 3,698,128 parameters and about the same computation as KeyWise (1.83 × 10⁹ MACs per frame). To separate the effect of the horizontal resolution from that of the shared weights, we also build Global-88, which pools the feature map to 88 bins, i.e. one feature column per key as in KeyWise, but then flattens them (16,896 values) and continues like the global variant, so that every key keeps its own weights (7,237,072 parameters, about the same computation). Both variants are trained three times, with the same data, training and decoding as KeyWise.
5 Results
In this section, we evaluate KeyWise from several aspects. First, in Section 5.1, KeyWise is compared against the state of the art on PianoVAM and on PianoYT, and we also take a closer look at how accurately it locates the keys and times their onsets and releases. Then, in Section 5.2, an ablation study replaces the key ROIs by a global feature vector, in order to assess the contribution of the per-key design. Finally, Section 5.3 discusses our main findings.
5.1 Comparison with the state of the art
Table 1 summarizes the results on the PianoVAM test set. KeyWise reaches the onset accuracy of V2N with 22 times fewer parameters. At 50 ms, the two systems score 95.0% and 94.7% onset F1, and the difference is not significant (p = 1.0). At 100 ms, KeyWise scores 97.8% against 97.0% and
is better on 8 of the 9 recordings (Fig. 3; mean difference 0.8 points, 95% confidence interval 0.3–1.4), but after the Holm–Bonferroni correction this difference is not significant either (p_Holm = 0.11). The advantage of KeyWise becomes clear when the key release must also be found. With the offset inside the tolerance, KeyWise is better on all 9 recordings at 100 ms (97.0% vs. 95.5%, p_Holm = 0.020), while at 50 ms and in frame F1 the differences are not significant.
Adding the velocity head changes the note scores of KeyWise by less than 0.6 points. This head, with only 257 parameters, estimates velocities more accurately than V2N. At 100 ms, KeyWise is better on all 9 recordings in both +Vel (89.4% vs. 84.5%) and +Off+Vel (88.6% vs. 83.2%), with p_Holm = 0.016 in both cases, while at 50 ms it is ahead but not significantly. Its predicted velocities also correlate better with the reference ones (r = 0.83–0.85 in the three runs vs. 0.77 for V2N). Finally, the video branch of Li et al. reaches 97.4% onset F1 at 100 ms [6], only 0.4 points below KeyWise, but its notes have almost no duration.
Unlike V2N, which uses a fixed threshold of 0.5, we choose the thresholds on the validation split, where a threshold of 0.5 would lower the onset F1 of KeyWise at 50 ms by 2.4–5.3 points. On the test set, however, the effect on onsets is small. For two of the three runs, a threshold of 0.5 gives 94.1% and 97.7% onset F1 at 50 and 100 ms, instead of 95.0% and 97.8%, while the +Off F1 at 50 ms drops from 89.6% to 84.6%. The thresholds λ/(1 + λ) give practically the same scores, and keeping the last instead of the best epoch lowers only the onset F1 at 50 ms, by 1.4 points.
Key localization and timing. Here we analyze the first run, the median of the three. Wrong keys are very rare, since only 15 missed and 5 extra notes are confused with a key one or two semitones or an octave away, so the rectification and the key ROIs locate the keys correctly. The recall of a key falls slightly as its tile center moves away from its real center, but so does the recall of V2N, which has no tiles, so this effect follows the layout of the keys rather than the tiles. More than half of the errors at 50 ms are timing errors. Black keys are detected later (median onset error +15.6 vs. +3.9 ms) and slightly less often than white keys (recall 92.8% vs. 97.3%), probably because their movement is smaller and harder to see from
Table 1 F1 (%) on the PianoVAM test set (9 recordings, 42,241 notes) at 50 and 100 ms onset tolerance. The last five rows are scored with the same code, and for KeyWise the mean ± standard deviation over three runs is given.
| Model | Params | Frame | Onset | +Off | +Vel | +Off+Vel | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| 50 | 100 | 50 | 100 | 50 | 100 | 50 | 100 | |||
| S2S [5]^a | – | 41.7 | 60.1 | 94.5 | 21.8 | 49.6 | – | – | – | – |
| V2R [7]^a | – | 82.2 | 86.5 | 89.8 | 55.4 | 81.8 | – | – | – | – |
| Li et al. [13]^a,b | – | (25.2) | 94.2 | 97.4 | (21.0) | (40.0) | – | – | – | – |
| PPAN [8]^a | – | 80.4 | 84.9 | 94.1 | 45.9 | 82.8 | – | – | – | – |
| V2N [6], published | 28.2 M | 90.9 | 94.7 | 97.0 | 89.5 | 95.5 | 82.8 | 84.5 | 78.3 | 83.2 |
| V2N, released MIDI | 28.2 M | 90.5 | 94.7 | 97.0 | 89.6 | 95.5 | 82.8 | 84.5 | 78.4 | 83.2 |
| Global variant | 3.7 M | 90.0±0.2 | 94.1±0.5 | 95.6±0.4 | 86.9±0.3 | 93.9±0.2 | – | – | – | – |
| Global-88 | 7.2 M | 89.1±0.5 | 92.4±1.5 | 95.2±0.4 | 83.9±2.1 | 93.3±0.5 | – | – | – | – |
| KeyWise | 1.3 M | 91.4±0.3 | 95.0±0.9 | 97.8±0.2 | 89.9±1.1 | 97.0±0.2 | – | – | – | – |
| KeyWise + velocity | 1.3 M | 91.5±0.1 | 95.0±0.2 | 98.0±0.1 | 89.3±0.3 | 97.2±0.1 | 86.8±0.6 | 89.4±0.5 | 81.7±0.5 | 88.6±0.6 |
^a Retrained and reported by [6]; values in parentheses come from heads that [6] marks as degenerate. ^b Video branch. +Vel requires a correct onset and velocity, and +Off+Vel also a correct offset, as defined in Section 4.3. Bold values are significantly better than V2N (released MIDI) after the Holm-Bonferroni correction.

Fig. 3 Onset F1 per PianoVAM test recording at 50 ms (a) and 100 ms (b). For KeyWise, the mean and the range of three runs are shown, for the global variant the mean of three runs, and for V2N its released predictions. The x-axis starts at 82%.
above. The timing error is almost constant within a recording but varies between recordings, from −5.5 to +30.5 ms, while V2N places its onsets early, by a median of 7–12 ms. Compared with V2N, KeyWise misses fewer notes with no prediction nearby (916 vs. 1,333) and adds fewer spurious ones (268 vs. 644), with a similar number of timing errors (826 vs. 910 missed notes). It also finds the key releases well, since counting only the offsets gives an F1 similar to that of V2N at 50 ms (91.5–92.8% in the three runs vs. 92.1%) and higher at 100 ms (97.0–97.4% vs. 95.7%). Finally, KeyWise finds 72.1% of the notes that repeat the same key within 150 ms, against 62.1% for V2N.
PianoYT. The results on PianoYT are given in Table 2. Trained on PianoYT only, KeyWise reaches 66.7% onset F1 at 100 ms, whereas Key-Wise trained only on PianoVAM and applied to PianoYT without further training reaches
only 15.3%, even with thresholds chosen on the PianoYT validation split. V2N reports a similar collapse between PianoVAM and R3 [6], while the zero-shot result of PPAN (0.40) starts from R3 and from large-scale video pre-training. When KeyWise is pre-trained on PianoVAM and then fine-tuned on PianoYT, it reaches 69.4%. Pre-training thus raises the onset F1 by 2.8 and 2.6 points at 50 and 100 ms, and every fine-tuned run is above every run trained on PianoYT only, although the per-video difference is not significant (p = 0.065 and p = 0.060). The fine-tuned runs (68.4% to 69.9%) are comparable to the best published result, 68% by PPAN [8], which is reported with two digits, although this comparison is not paired and the training data differ. All scores at 50 ms are much lower, partly because the labels of PianoYT come from an audio transcriber and their timing is less reliable.
Table 2 Onset F1 (%) on the PianoYT test set (21 videos, 33,535 notes). For KeyWise trained on PianoYT, the mean ± standard deviation over three runs is given.
| Model | Extra data | 50 ms | 100 ms |
|---|---|---|---|
| S2S [5]ª | R3 | – | 64 |
| V2R [7]ª | R3 | – | 64 |
| PPAN [8] | video + R3 | – | 68 |
| KeyWise | none | 41.9±1.6 | 66.7±1.4 |
| KeyWise, zero-shotᵇ | PianoVAM | 6.5 | 15.3 |
| KeyWise, fine-tuned | PianoVAM | 44.7±0.9 | 69.4±0.9 |
ªRetrained and reported by [8] on the same 21 test videos. ᵇNo training on PianoYT; one run. “Video” refers to VideoMAE V2 pre-training [18].
5.2 Ablation study: key ROIs versus a global feature vector
Table 3 compares KeyWise with the two ablation variants described in Section 4.4. We first consider the global variant, which uses the same encoder, data, training and decoding as KeyWise, but merges the features into one global vector and has 2.8 times more parameters. At 50 ms, the difference between the two is not significant, but at 100 ms KeyWise is better on all 9 recordings (97.8% vs. 95.6%, ) and in each of the three pairs of runs. It is also worth noting that the global variant falls below V2N at 100 ms on all 9 recordings, which shows that keeping the features per key ROI is what lifts the same encoder above V2N.
The errors at 50 ms illustrate where this difference comes from. As the lower part of Table 3 shows, both models make about the same number of timing errors, but the global variant misses about twice as many notes with no prediction nearby and predicts 3.7 times more notes where no note was played. As Fig. 4 shows, these losses are concentrated at the two ends of the keyboard. In the lowest register (A0–B1, 15 keys), the global variant finds 72% of the notes, against 91% for KeyWise (difference 19 points, 95% confidence interval 9–23), and in the highest octaves (C6–C8) 80% against 91%. This is to be expected, since in the global variant every key has its own output weights, and the keys at the two ends are played rarely (the lowest register has about 1% of the test notes), so their weights get little training. In Key-Wise, on the other hand, all key ROIs share the same weights, so the lowest key also learns from
Table 3 KeyWise, the global variant and Global-88 (G-88) on PianoVAM. The upper part gives the mean F1 (%) of three runs and the Holm–Bonferroni corrected Wilcoxon p-values against the global variant () and Global-88 (), and the lower part the notes found and the errors at 50 ms of the first run, out of the 42,241 reference notes of the test set.
| KeyWise | Global | G-88 | |||
|---|---|---|---|---|---|
| Parameters | 1.3 M | 3.7 M | 7.2 M | ||
| Onset F1, 50 ms | 95.0 | 94.1 | 92.4 | 0.250 | 0.078 |
| Onset F1, 100 ms | 97.8 | 95.6 | 95.2 | 0.020 | 0.020 |
| +Off F1, 50 ms | 89.9 | 86.9 | 83.9 | 0.148 | 0.078 |
| +Off F1, 100 ms | 97.0 | 93.9 | 93.3 | 0.020 | 0.020 |
| Frame F1 | 91.4 | 90.0 | 89.1 | 0.117 | 0.059 |
| Notes found | 40,484 | 39,568 | 39,203 | ||
| Missed, timing | 826 | 877 | 1,284 | ||
| Missed, wrong key | 15 | 43 | 44 | ||
| Missed, no note nearby | 916 | 1,753 | 1,710 | ||
| Extra, timing | 824 | 887 | 1,285 | ||
| Extra, wrong key | 5 | 23 | 30 | ||
| Extra, no note nearby | 268 | 980 | 1,078 |
the notes played in the middle of the keyboard. Indeed, the gain of KeyWise over the global variant grows as the number of training notes of a key falls (Spearman over the 73 keys with test notes).
Global-88 tests whether this gain comes from the 88 positions or from the shared weights. Although it keeps one feature column per key, it is slightly worse than the global variant on all five metrics, and KeyWise is better than Global-88 at 100 ms on all 9 recordings (). Global-88 also loses most at the two ends of the keyboard, where it finds 71% and 78% of the notes against 91% for KeyWise, and its gap to KeyWise also grows as the number of training notes of a key falls (). Therefore, the finer resolution alone does not explain the gain of KeyWise, which points to the weights shared by all key ROIs as its source.
5.3 Discussion
Summarizing our findings, using the geometry of the keyboard instead of learning it clearly pays off. The network only needs to find a key within a known neighborhood, and sharing one temporal model between all key ROIs helps the rarely played keys while keeping the model small.
As far as computation is concerned, the gain of KeyWise is smaller than its reduction in parameters, because almost all of its computation is spent in the encoder. At test time, V2N processes every

Fig. 4 Reference notes found at 50 ms on the PianoVAM test set, by register and key color, with the 9 recordings pooled and the mean of three runs shown. Error bars show 95% bootstrap confidence intervals over the recordings.
frame twice in overlapping 1 s clips and KeyWise about 1.14 times in overlapping windows, so KeyWise needs 3.9 times fewer operations per second of video than V2N, and 2.2 times fewer without overlap in either system. On the same RTX 3090 GPU, in 32-bit precision, it needs 15 ms per second of video against 70 ms for V2N (13 and 35 ms without overlap), V2N is 3.6 and 5.3 times slower in bfloat16 and float16, and with video decoding and rectification the whole KeyWise pipeline runs 2.3 times faster than real time. Finally, KeyWise currently relies on the keyboard corners given by the datasets and on a fully visible 88-key keyboard, it needs fine-tuning for new recording conditions like earlier visual systems, and its keys exchange no information after the encoder, which leaves room for models that also take neighboring keys into account.
6 Conclusion
We proposed KeyWise, a video-only piano transcription model that exploits the fixed geometry of the keyboard, in which every key is a fixed ROI of the rectified keyboard and one small network, shared by all keys, predicts their onsets, states and velocities. With only 1.3 M parameters, KeyWise reaches the onset accuracy of the state-of-the-art V2N, is significantly more accurate at 100 ms when key releases or velocities are also considered, and runs 4.7 times faster. The ablation study clearly indicated that the per-key design is what makes the difference, since a global feature vector made the model worse, mostly at the rarely played ends of the keyboard, even when it kept one position per key. On PianoYT, whose YouTube
videos vary in recording conditions and carry audio-derived labels, pre-training on PianoVAM led to 69.4% onset F1 at 100 ms, comparable to the best published result. In future work, we plan to take advantage of more of the visual information in a performance video, such as the hands of the pianist, on our way towards a symbolic score.
Statements and Declarations
- Funding. The authors did not receive support from any organization for the submitted work.
- Competing interests. The authors declare no competing interests.
- Ethics approval and consent to participate. Not applicable.
- Consent for publication. Not applicable.
- Data availability. The PianoVAM [12] and PianoYT [5] datasets are publicly available from their authors. One PianoYT test video, no longer on YouTube, was evaluated from an earlier copy. The lists of removed and validation videos, the predicted MIDI files and the scores per recording are available from the corresponding author on reasonable request.
- Materials availability. Not applicable.
- Code availability. The code is available from the corresponding author on reasonable request.
- Use of AI tools. An AI assistant (Claude, Anthropic) was used to assist with code development and edit parts of the manuscript. The authors designed the method and experiments, verified all results and take full responsibility for the content.
- Author contribution. A.C.: conceptualization, methodology, software, experiments, formal analysis, writing of the original draft. N.P.: supervision, methodology, writing (review and editing). M.K.: supervision, writing (review and editing). All authors read and approved the final manuscript.
References
[1] Benetos, E., Dixon, S., Duan, Z., Ewert, S.: Automatic music transcription: an overview. IEEE Signal Processing Magazine 36(1), 20–30 (2019) https://doi.org/10.1109/MSP.2018.2869928
[2] Hawthorne, C., Elsen, E., Song, J., Roberts, A., Simon, I., Raffel, C., Engel, J., Oore, S., Eck, D.: Onsets and frames: dual-objective piano transcription. In: Proceedings of the 19th International Society for Music Information Retrieval Conference (ISMIR), pp. 50–57 (2018). https://doi.org/10.5281/zenodo.1492341
[3] Kong, Q., Li, B., Song, X., Wan, Y., Wang, Y.: High-resolution piano transcription with pedals by regressing onset and offset times. IEEE/ACM Transactions on Audio, Speech, and Language Processing 29, 3707–3717 (2021) https://doi.org/10.1109/TASLP.2021.3121991
[4] Marták, L.S., Hu, P., Widmer, G.: Quantifying the corpus bias problem in automatic music transcription systems. In: Proceedings of the 1st International Workshop on Sound Signal Processing Applications (IWSSPA) (2024). https://doi.org/10.48550/arXiv.2408.04737
[5] Koepke, A.S., Wiles, O., Moses, Y., Zisserman, A.: Sight to sound: an end-to-end approach for visual piano transcription. In: Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 1838–1842 (2020). https://doi.org/10.1109/ICASSP40776.2020.9053115
[6] Kim, Y., Sohn, H., Nam, J., Lerch, A.: Multi-task multi-frame visual piano transcription. In: Proceedings of the 27th International Society for Music Information Retrieval Conference (ISMIR) (2026, to appear). https://doi.org/10.48550/arXiv.2608.03419
[7] Su, K., Liu, X., Shlizerman, E.: Audeo: audio generation for a silent performance video. In: Advances in Neural Information Processing Systems 33 (NeurIPS) (2020). https://doi.org/10.48550/arXiv.2006.14348
[8] Zivanovic, U., Pilkov, I., Cancino-Chacón, C.: Pay attention to the keys: visual piano transcription using transformers. In: Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence
(IJCAI), pp. 10243–10251 (2025). https://doi.org/10.24963/ijcai.2025/1138
[9] Wan, Y., Wang, X., Zhou, R., Yan, Y.: Automatic piano music transcription using audiovisual features. Chinese Journal of Electronics 24(3), 596–603 (2015) https://doi.org/10.1049/cje.2015.07.027
[10] Lee, J., Doosti, B., Gu, Y., Cartledge, D., Crandall, D.J., Raphael, C.: Observing pianist accuracy and form with computer vision. In: Proceedings of the IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 1505–1513 (2019). http://doi.org/10.1109/WACV.2019.00165
[11] Wang, X., Xu, W., Liu, J., Yang, W., Cheng, W.: An audio-visual fusion piano transcription approach based on strategy. In: Proceedings of the 24th International Conference on Digital Audio Effects (DAFx20in21), pp. 308–315 (2021). https://dafx2020.mdw.ac.at/Proceedings/papers/DAFx20in21_paper_19.pdf
[12] Kim, Y., Park, J., Bae, J., Kim, K., Kwon, T., Lerch, A., Nam, J.: PianoVAM: a multimodal piano performance dataset. In: Proceedings of the 26th International Society for Music Information Retrieval Conference (ISMIR) (2025). https://doi.org/10.48550/arXiv.2509.08800
[13] Li, Y., Wang, X., Wu, R., Xu, W., Cheng, W.: A two-stage audio-visual fusion piano transcription model based on the attention mechanism. IEEE/ACM Transactions on Audio, Speech, and Language Processing 32, 3618–3630 (2024) https://doi.org/10.1109/TASLP.2024.3426303
[14] Suteparuk, P.: Detection of piano keys pressed in video. Technical report, Department of Computer Science, Stanford University (2014). https://stacks.stanford.edu/file/druid:bf950qp8995/Suteparuk.pdf
[15] Rho, S., Hwang, J.-I., Kim, J.: Automatic piano tutoring system using consumer-level depth camera. In: Proceedings of the IEEE
International Conference on Consumer Electronics (ICCE), pp. 3–4 (2014). https://doi.org/10.1109/ICCE.2014.6775884
[16] Nisbet, A., Green, R.: Capture of dynamic piano performance with depth vision. Department of Computer Science, University of Canterbury (2017). https://albertnis.com/resources/2017-05-10-piano-vision/Nisbet_Green_Capture_of_Dynamic_Piano%20Performance_with_Depth_Vision.pdf
[17] Akbari, M., Liang, J., Cheng, H.: A real-time system for online learning-based visual transcription of piano music. Multimedia Tools and Applications 77(19), 25513–25535 (2018) https://doi.org/10.1007/s11042-018-5803-1
[18] Wang, L., Huang, B., Zhao, Z., Tong, Z., He, Y., Wang, Y., Wang, Y., Qiao, Y.: VideoMAE V2: scaling video masked autoencoders with dual masking. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 14549–14560 (2023). https://doi.org/10.1109/CVPR52729.2023.01398
[19] Wei, W., Li, P., Yu, Y., Li, W.: HPPNet: modeling the harmonic structure and pitch invariance in piano transcription. In: Proceedings of the 23rd International Society for Music Information Retrieval Conference (ISMIR), pp. 709–716 (2022). https://doi.org/10.5281/zenodo.7316762
[20] Itti, L.: Automatic foveation for video compression using a neurobiological model of visual attention. IEEE Transactions on Image Processing 13(10), 1304–1318 (2004) https://doi.org/10.1109/TIP.2004.834657
[21] Ioffe, S., Szegedy, C.: Batch normalization: accelerating deep network training by reducing internal covariate shift. In: Proceedings of the 32nd International Conference on Machine Learning (ICML), pp. 448–456 (2015). https://doi.org/10.48550/arXiv.1502.03167
[22] Cho, K., van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., Bengio, Y.: Learning phrase representations
using RNN encoder–decoder for statistical machine translation. In: Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1724–1734 (2014). https://doi.org/10.3115/v1/D14-1179
[23] Loshchilov, I., Hutter, F.: Decoupled weight decay regularization. In: International Conference on Learning Representations (ICLR) (2019). https://doi.org/10.48550/arXiv.1711.05101
[24] Loshchilov, I., Hutter, F.: SGDR: stochastic gradient descent with warm restarts. In: International Conference on Learning Representations (ICLR) (2017). https://doi.org/10.48550/arXiv.1608.03983
[25] Raffel, C., McFee, B., Humphrey, E.J., Salamon, J., Nieto, O., Liang, D., Ellis, D.P.W.: mir_eval: a transparent implementation of common MIR metrics. In: Proceedings of the 15th International Society for Music Information Retrieval Conference (ISMIR), pp. 367–372 (2014). https://doi.org/10.5281/zenodo.1416528
[26] Wilcoxon, F.: Individual comparisons by ranking methods. Biometrics Bulletin 1(6), 80–83 (1945) https://doi.org/10.2307/3001968
[27] Holm, S.: A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics 6(2), 65–70 (1979). https://www.jstor.org/stable/4615733