# Automatic Segmentation of Ethnomusicological Field Recordings
## 2 Materials and Methods
### Deep Neural Networks for Labelling
#### 2.1.2 Network Architecture and Training  
The basic architecture of the deep neural network for classification stems from our previous work [16], where we demonstrated their usability for the task. We chose convolutional deep networks as our main classification tool and focused specifically on residual networks [17], which demonstrated good performance for a variety of image, as well as audio-based tasks. The main feature of residual networks are their shortcut connections that implement identity mappings and enable convolutional blocks to learn residuals between the underlying mapping of features and the input. We augmented the first layer of the previously presented approach with music-specific feature filters and zero-mean convolutions, which together with data augmentation, improved the overall classification accuracy. To provide network input, all the audio excerpts were first downsampled to 22,050 Hz, mixed to a single channel, and normalized. The audio was then split into 46 ms frames with a 14.3 ms step size, and 80 bin mel-scale spectra (30-8000 Hz) computed for all frames. We log-scaled the mel values, adding 1e-5 before applying the logarithm and used 2 s long feature blocks (80 \(\times\) 140) as network inputs. The network architecture is shown in Figure 2. The input is processed by two sets of music-specific feature filters: frequency filters and temporal filters. Frequency filters model changes in the frequency domain regardless of time--we used 10-by-1 filters, corresponding to the average frequency range of 700 cents. Temporal filters, on the other hand, model temporal dependencies independent of frequency--we used 1-by-10 filters, which thus correlate with approximately 143 ms (10 frames) of audio. This type of filter specialization has been shown to be effective for various audio processing  
Figure 1: The annotation interface. tasks, such as genre classification and emotion prediction [18; 19]. Although each type of filters ignores one dimension (temporal or frequency), these dependencies are learned on higher network layers. Additionally, to make the first layer filters more robust to varying recording conditions, we enforced the filters to have a zero mean, thus effectively learning to recognize the differences in the signal and ignoring constant offsets. Zero-mean convolutions were introduced to singing voice detection by [PERSON] and [PERSON] [20] and were shown to be very robust to signal gain changes. Output feature maps of the initial layer are subsampled by a \(2\times 2\) max pooling layer, and followed by four resnet v2 blocks [17], where the size of the feature maps is halved (in each dimension) and the number of filters doubles between three consecutive blocks. Exponential linear units [21] are used as activation functions of the resnet layers. The batch normalized output of resnet blocks is gathered by \(1\times 1\) convolutions into a 2D feature map. The map is processed by a small fully connected layer with four outputs, and the softmax activation function calculates final class probabilities. The architecture and parameters of the higher layers are derived from our previous work [16], where we showed the efficiency of ELU and resnet layers for the task. Altogether the network contains 172,708 trainable parameters, which is relatively small in the deep learning world, where sizes of tens of millions of parameters are usual, we wanted to keep the network small due to the relatively small training set. Also, in our experiments, larger network sizes did not bring a significant increase in accuracy. The network was trained on a dataset of 7136 audio excerpts with minibatches of 128 examples. For each audio example, the block of input features was drawn from a random location within the five second audio excerpt, so that for each epoch, the feature blocks used to train the network differed in their location within training files. Such time translation diversifies the limited training data available and improves performance, as was also demonstrated elsewhere [22].