{'fraction_non_alphanumeric': 0.03813531887342182, 'fraction_numerical': 0.013013920362576885, 'mean_word_length': 4.598405219282348, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Adaptive DCTNet for Audio Signal Classification

In this paper, we investigate DCTNet for audio signal classification. Its output feature is related to Cohen's class of time-frequency distributions. We introduce the use of adaptive DCTNet (A-DCTNet) for audio signals feature extraction. The A-DCTNet applies the idea of constant-Q transform, with its center frequencies of filterbanks geometrically spaced. The A-DCTNet is adaptive to different acoustic scales, and it can better capture low frequency acoustic information that is sensitive to human audio perception than features such as Mel-frequency spectral coefficients (MFSC). We use features extracted by the A-DCTNet as input for classifiers. Experimental results show that the A-DCTNet and Recurrent Neural Networks (RNN) achieve state-of-the-art performance in bird song classification rate, and improve artist identification accuracy in music data. They demonstrate A-DCTNet's applicability to signal processing problems.


INTRODUCTION
Learning feature representation of audio signals is one of the key interests for audio classification. Audio signals are rich in physical characteristics, such as energy, fundamental frequency, and formant, as well as in perceptual characteristics, such as pitch, timbre and rhythm [1], while they are usually contaminated by various kinds of noise. A good feature representation should represent those characteristics in compact forms, while robust to various kinds of noise. Traditional audio signal features, such as Mel-Frequency Cepstral Coefficients (MFCC) and ERB-rate scale features can reveal the intrinsic attributes of audio signals. They are proposed based on auditory and physiological evidence of how humans perceive audio signals [2], and are closely related to the short time Fourier transform or the constant-Q transform [3]. They are almost invariant under local scaling and frequency shift. However, the major drawback of these feature is that they are sensitive to noise [4].
Recently, Convolutional Neural Networks (CNNs) have demonstrated great success in audio signal classification [5,6,7]. CNNs are able to carry out accurate parameter estimation [8] even in the presence of significant noise. They employ learned filters, typically obtained through stochastic gradient descent (SGD) methods, and convolve them with signals to obtain features for classification [5]. However, they depend heavily on expert parameter tuning, and it is computationally expensive to learn the coefficients of the filters. It is also hard to physically interpret the learned coefficients, although we note that some studies found similarities of mel-filter banks and learned filter banks [9].
On the other hand, the scattering transform, proposed by Mallat [10], employs a pre-specified collection of wavelets as filters, have obtained state-of-the-art results on some music and speech datasets [11]. The structure of the scattering transform is similar to a cascade of constant-Q or mel-filter banks, and the scattering transform can capture useful spectral content of acoustic signals. The scattering coefficients can illustrate chord and attack interferences [11]. A similar approach was proposed in the form of PCANet [12], which uses eigenfunctions from eigen-decomposition as filters. PCANet has achieved competing results in image classification. Compared with CNNs, the filters of these two models are more interpretable, easier to learn, or learned for free.
Inspired by the scattering transform and PCANet, DCT-Net was proposed in [13,14,15]. DCTNet uses a prefix cosine function as filter; this is an approximation of the eigenfunction used in PCANet. DCTNet performs multilayer short time Discrete Cosine Transform (DCT). We investigate specially a two-layer DCTNet: a first DCT of the signal, and then a second DCT on each frequency level output of the first transform. Typical spectral feature representation for acoustic feature such as short time Fourier transform, spectrogram and linear frequency spectral coefficients (LFSC) can be related to each layer's output. As seen in [14], DCTNet output can improve classification accuracy on whale vocalizations.
In this paper, we further investigate the theoretical properties of DCTNet. One useful feature that can be computed from DCTNet is the sum over layers of the absolute value square of the DCTNet output. We show that this feature function is of Cohen's class of time-frequency distributions.
We also introduce two new extensions of the DCTNet framework which lead to state-of-the-art results for audio classification. Firstly, inspired by constant-Q transforms, we use geometrically spaced center frequencies, in order to make DCTNet adaptive to different acoustic perception scales. We developed A-DCTNet for audio signals classification, it can better capture low frequency acoustic signal components that are sensitive to human than DCTNet and MFCC. Experiments on Artist20 [16] music data and bird song data show that, with a standard linear SVM classifier, features obtained from A-DCTNet improve classification rate over other features, including Mel-Frequency Spectral Coefficients (MFSC) and features obtained from the scattering transform.
Secondly, in order to make use of the sequential information of audio signals, and extract the higher level audio feature, we apply the Recurrent Neural Network (RNN) for further audio feature exaction and classification. State of the art classification accuracy is achieved in bird song data. This shows that the modified DCTNet is a simple flexible and effective feature extractor for audio signal processing.

DCTNET
DCTNet is essentially a multilayer short time DCT [13,14]. Similar to the short time Fourier transform, the short time DCT can be expressed as [17]: where x is an input audio signal, h is a window function, and c k are cosine functions. When c k are DCT-II functions, where N is the length of window, and k = 0, · · · , N − 1. The process of short time DCT can be viewed as a modulation of bandpass filters to a signal. A multilayer short time DCT can be expressed as: where r is the number of layers. Note that the whole operation is still linear. Choosing different window length in each layer can highlight detailed energy distribution of signals in the time-frequency plane, as shown in Figure 1. Because the center frequencies in filterbanks are linearly spaced, the output of a two-layer short time DCT is closely related to the Linear Frequency Spectral Coefficients (LFSC) in acoustics. DCTNet has been shown in [14] to improve classification accuracy of underwater acoustic signals. A simple illustration of a two-layer DCTNet is shown in Figure 1. A DCTNet variant is used for image feature extraction, applying 2D convolution, histograming and binary hashing [15]. In contrast, we adopt DCTNet for acoustic signals, using an entirely different post-processing strategy [13,14]. The input is an oscillogram of an acoustic signal. After convolving the signal with DCT filterbanks, we have a short time DCT of the signal, which is a two-dimensional representation. Each row of the short time DCT is also a time series, convolving it with another DCT filterbanks, then we have a short time DCT inside a short time DCT. Summing the absolute value square of the second layer's outputs, we have a LFSC like feature of the signal, and we use it for classification.

TIME-FREQUENCY ANALYSIS IN DCTNET
We first show that the output of the two-layer DCTNet is a time-frequency distribution of Cohen's class. From Section 2, the two-layer DCTNet output is: Summing the absolute value square of the second layer's output, the DCTNet feature function F is: If we want to express a similar expansion in the continuous domain, for ω 1 , ω 2 ∈ R d , we pick h 1 , h 2 ∈ S(R d ), x ∈ S (R d ). S(R d ) is the Schwartz class, and elements in the dual space S (R d ) of S(R d ) are called tempered distribution [18].
x, h 1 , h 2 are real, and h 1 , h 2 are even functions. The process can be expressed as where c ω (t) = cos(2πωt). c ω1 and c ω2 are cosine functions of the first layer and second layer respectively, and h 1 and h 2 are window functions of the first layer and second layer respectively. Expanding the above expression, the cosine function integrates to a delta function. Since a cosine function can be expressed as a summation of two exponential terms, the above expression can be simplified as where φ(u, u ) = C · R d (h 1 (τ )) 2 h 2 (u − τ )h 2 (u + τ )dτ is a kernel function, and C is some constant.
Applying a change of variables to the right hand side in the above formula: t 1 = t − u and t 2 = t − u, we have where the kernel function is ψ(t 1 , t 2 ) = φ( −t1−t2 2 , t 1 − t 2 ) [19]. Eq. (2) is of Cohen's class of time-frequency distributions [20]. The Cohen's class of time-frequency distributions are shift covariant. This means that they are especially amenable to building invariant features by means of pooling.
Note that, given the linearity of scale of DCT filterbank, the output of the second layer of DCTNet gives a linear frequency spectrogram like feature [14].

ADAPTIVE DCTNET (A-DCTNET)
We extend DCTNet by making it adaptive to different acoustic perception scales. In the constant-Q transform [21], the center frequencies are logarithmically spaced. Such spacing is similar to the human auditory perception system [22,23]. The constant-Q transform has shown to be useful in audio signal processing [24].
We define the adaptive short time DCT as where f s is the sampling frequency, f k is a geometrically spaced centered frequency given by b is the number of filters per octave, and K is the overall number of frequency bins. In the constant-Q transform, the Q factor, namely the ratio of center frequency to bandwidth, is constant. The modified DCTNet is a multilayer modified short time DCT. With the frequency bins geometrically spaced, the twolayer adaptive DCTNet has the output shown in Fig 2. We use as an example a piece of classical music by Bach. Choosing b = 12 for the first layer, and b = 6 for the second layer. By adjusting the window function, the low frequency signal components in A-DCTNet can be better captured than that of MFSC in the plots.

RECURRENT NEURAL NETWORKS
We further extend A-DCTNet by combining it with Recurrent Neural Networks (RNN) [25,26] in audio classification task. RNN are known to be powerful models for capturing features of sequential data. The process of RNN is shown in Figure 3. In the figure, x = (x 1 , x 2 , · · · , x T ) is an input Fig. 3. Process of RNN. x is the input sequential data, h is the hidden units, and y is the label.
sequence, x t is an input at time step t. h = (h 1 , h 2 , · · · , h T ) is a hidden unit, h t is a hidden state at time step t, and y = y T is the output. We recursively update the hidden unit state by h t = g(h t−1 , x t ), where g(·) is an activation function. We predict y from x through h: p((y|x) = p(y T |h T )). Feature labels are then determined by p(y) = softmax(V · h T ).

Datasets
We use the Artist20 music data [16] and bird song data collected by the Nowicki Lab at Duke University for experiments. Artist20 is a database of six albums by 20 artists. Different artists have their own styles of performing and singing. Artist20 has 1413 tracks, and each track is 30 seconds in length. The sampling frequency of the original data is 44kHz. Our goal is to identify the artists from the music.
For the bird song data, there are four types of bird songs, and there are 200 tracks in total. The sampling frequency of the data is 44kHz. Each piece of bird song lasts about 2-3 seconds. Our goal this time is to classify this bird songs.

Classification results
We use features obtained from the two-layer A-DCTNet and the scattering transform, and we make a comparison with MFSC, LFSC and ERB-rate scale features, applying the linear SVM and RNN to classify the data. In the two-layer A-DCTNet, we let the first layer and the second layer maximum frequency be 5500Hz, and minimum frequency be 40Hz. The major signal energy components are distributed in the 40Hz to 5500Hz region. For the scattering transform feature, we use the MATLAB toolbox [27] with time frame duration T = 125ms (or window size 256), and set Q 1 = 8, Q 2 = 1 to best capture the acoustic signal information [11]. For MFSC, LFSC and ERB rate scale features, we use a Hamming window of length 256, and step size 128 to create the spectrogram, then multiply the spectrogram with the filter bank function [28]. We extract 40 coefficients from each time frame, and concatenate the coefficients along the time axis.
We use 80% of the music data and bird song data for training, and the rest for testing. The accuracy of different features sets for classification of the Artist20 and bird song data are shown in Table 1 and Table 2, respectively. The baseline accuracy for the Artist20 identification is 54.49% [16], which uses MFCC as features, and applies a Hidden Markov Model (HMM) and a Gaussian Mixture Model (GMM) for classification.
With linear SVM, A-DCTNet features improve classification rate over other features. However, without using the sequential information of audio signals, the overall classification performance is not desirable for music data. In order to improve classification accuracy, we incorporate the use of RNN.
We use RNN with one hidden layer, and initialize all recurrent matrices with orthogonal initialization. Nonrecurrent weights are initialized from a uniform distribution in [−0.01, 0.01]. The experiments are implemented with Theano [29]. When applying RNN, we divide each track of music and bird song into small chunks. For music data, the length of each chunk is 60, with overlap size 30. For the bird song data, the length is 40 with overlap size 20.
The A-DCTNet achieves state-of-the-art results for bird song classification, and improves identification accuracy for the music Artist20 dataset. The two-layer A-DCTNet outperforms all other methods using both classifiers, due to its increase ability to capture low-frequency acoustic information. The main reason for the improved performance with the RNN classifier is the capturing of sequential information inherent in the signals. One possible further explanation for the improve performance over the scattering transform is that phase information is preserved in each layer of A-DCTNet. In contrast, in the scattering transform, absolute values are taken after each convolution in order to achieve translation invariance.

CONCLUSION
In this paper, we analyze the time-frequency characteristics of DCTNet, and show that the output of a two-layer DCT-Net is of Cohen's class of time-frequency distributions. We propose an A-DCTNet which uses the idea of the constant-Q transform, to make it adaptive for different acoustic perception scales. With a standard linear SVM classifier, the A-DCTNet improves classification accuracy over other features, including MFSC and the scattering transform. The classification accuracy can be further improved by using RNN, which takes audio sequential information into consideration. With the use of RNN, A-DCTNet achieves state-of-the-art in bird song classification, and significantly improves classification accuracy in music artist identification. Our results demonstrate that A-DCTNet is a simple, flexible and effective feature extractor for audio signal processing.