## 3 Experiments
### Experimental Settings  
The proposed framework takes the spectrograms of CQT as input. The audio signal was segmented with a frame length of 100 ms and a hop-size of 10 ms. The CQTs cover 88 notes of piano, and there  
Figure 5: Attack templates of note C4 played at three dynamics: forte, mezzo-forte, and piano.  
are 36 bins per octave. Hence, a 267-dimensional CQT vector is extracted for each frame. A context window of nine frames was applied to the CQTs so that we could obtain a spectrogram slice.  
In the note recognition, architectures of these two CNNs were similar (as shown in Figure 3): two convolutional layers, two pooling layers, and two fully-connected layers. These two CNNs have the same structure, except for the final fully-connected layer. For the spectrogram slices of 267 dimensions by 9 frames, the first convolutional layer with 10 filters of size \(16\times 2\) computes 10 feature maps of size \(252\times 8\). The next layer performs max-pooling of \(2\times 2\), reducing the size of maps to \(126\times 4\). The second convolutional layer contains 20 filters of size \(11\times 3\), which generates 20 feature maps of \(116\times 2\). The max-pooling size of the second pooling layer was also set to \(2\times 2\), resulting in 20 maps of \(58\times 1\). The first fully-connected layer contains 256 units, and the number of units in the final layer changes with the task. In the CNN for onset detection, the final fully-connected layer has a single output unit. In the CNN for MPE, the final fully-connected layer has 88 output units. The two convolutional layers and the first fully-connected layer use the rectified linear unit (ReLU) activation function, and the final fully-connected layers use the sigmoid function. Appendix A shows more details about the CNNs.  
The CNNs were trained using mini-batch gradient descent, and the size of a mini-batch was 256. The [PERSON] algorithm [39] was also used in the training. An initial learning rate of 0.01 was decreased to 0 over 100 epochs. To prevent over-fitting, a dropout of 0.5 was applied to each network. We also used the method of early stopping, in which training was stopped if the cost (cross entropy) did not decrease for 20 epochs. The training of two CNNs was independent, whereas the CNNs were concatenated in the testing procedure. For the testing data, the first CNN estimates the candidate onset and the input of the second CNN is a spectrogram slice centered at the candidate onset.  
During the note verification, we trained one attack template per pitch using the forte notes. The attack template was obtained by calculating the average of first 5-frame spectrogram followed by the onset. Each spectrum to be factorised is 267 dimension by 9 frames, and the central frame is the candidate onset detected by the first CNN.  
Note-based metrics were employed to assess the performance of the proposed system [40]. A note event is regarded as right if its pitch is correct and its onset is within a \(\pm\)50 ms range of the ground truth onset. These measures are defined as:  
\[P=\frac{N_{TP}}{N_{TP}+N_{FP}} \tag{4}\]  
\[R=\frac{N_{TP}}{N_{TP}+N_{FN}} \tag{5}\]  
\[F=\frac{2\times P\times R}{P+R} \tag{6}\]  
where \(P\), \(R\), \(F\) correspond to precision, recall, and F-measure, respectively, and \(N_{TP}\), \(N_{FP}\), and \(N_{FN}\) are the numbers of true positives, false positives, false negatives respectively.