# An Unsupervised Deep Learning System for Acoustic Scene Analysis
## 2 The Proposed Method
### Spectral Clustering  
Spectral clustering first learns a new representation of the input data points by conducting Laplacian eigen-decomposition to the affinity matrix of the data, and then conducts clustering on the new representation [20]. Differently from common clustering algorithms that operate in the original data space, spectral clustering focuses on the correlation between the data points in a kernel-induced feature space. Therefore, it leads to good clustering accuracy and robustness to noise. We present its usage in our system as follows.  
Suppose that \(x_{n}\) denotes the feature of the \(n\)th audio recording, and \(X\) denotes the set of the feature vectors for spectral clustering; i.e., \(X=\{x_{1},...,x_{N}\}\), where \(N\) is the number of the audio recordings. In our system, we first use Gaussian kernel to construct an affinity matrix \(A\):  
\[A_{kl}=\exp\left(-\frac{d(x_{k},x_{l})^{2}}{2e\sigma_{k}\sigma_{l}}\right), \quad 1\leq k,l\leq N, \tag{2}\]  
where \(d(x_{k},x_{l})\) is the Euclidean distance between \(x_{k}\) and \(x_{l}\); \(\sigma_{k}\) and \(\sigma_{l}\) are two scaling factors for the feature vectors \(x_{k}\) and \(x_{l}\) respectively; and \(A_{kl}\) denotes an element of \(A\) at the \(k\)th row and \(l\)th column. The scaling factor \(\sigma_{k}\) is defined in a nonparametric way:  
\[\sigma_{k}=\Sigma_{x_{l}\in X_{l+k}}d(x_{k},x_{l})/(N-1), \tag{3}\]  
\begin{table}
\begin{tabular}{l l} \hline \hline \multicolumn{2}{c}{**Input: Original Features-576**} \\ \hline \multirow{2}{*}{Encoder} & Dense-500-BN-Mish \\  & Dense-500-BN-Mish \\  & Dense-40-Sigmoid \\ \hline \multirow{2}{*}{Decoder} & Dense-500-BN-Mish \\  & Dense-500-BN-Mish \\  & Dense-576 \\ \hline \multicolumn{2}{l}{**Output:** Reconstructed features} \\ \hline \hline \end{tabular}
\end{table}
Table 1: Architecture of the deep auto-encoder network. Dense refers to fully connected layers. The numbers 576, 500, and 40 are the numbers of neurons. BN refers to batch normalization layer. Mish and sigmoid are activation functions.  
Figure 2: Block diagram of the auto-encoder network.  
which is the average distance between \(x_{k}\) and all remaining points. \(\varepsilon\) is a tunable global scaling factor to control radial ranges. We searched \(\varepsilon\) through a set of values and found the system has the best performance when it is set to 20 in this work.  
Subsequently, a standard procedure of spectral clustering is carried out. Specifically, we first create a normalized Laplacian matrix \(L\), as follows:  
\[L=D^{-1/2}AD^{1/2}, \tag{4}\]  
where \(D\) is a diagonal matrix in which \(D_{ii}\) equals to the sum of all elements of the \(i\)th column of \(A\). Decomposing the normalized Laplacian matrix \(L\) with eigenvalue decomposition produces the eigenvalues \(\{\lambda_{n}\}_{n=1}^{N}\) and their corresponding eigenvectors \(\{\
u_{n}\}_{n=1}^{N}\) of \(L\). We choose the eigenvectors that correspond to the largest \(N_{c}\) eigenvalues to form a matrix \(V=[\
u_{1},\
u_{2},...,\
u_{N_{c}}]\in R^{N\times N_{c}}\), where \(N_{c}\) is the number of clusters. Then, we generate a matrix \(Y\) by renormalizing each row of \(V\):  
\[Y_{ij}=\frac{V_{ij}}{(\Sigma_{j}V_{ij}^{2})^{1/2}},\quad 1\leq i\leq N,1\leq j \leq N_{c}. \tag{5}\]  
Finally, the \(j\)th row of \(Y\) is a new representation of the \(i\)th audio clip produced by spectral clustering, which is used as the input of the joint clustering.