# Augmentation Embedded Deep Convolutional Neural Network for Predominant Instrument Recognition
## 3 The Proposed AEDCN Methods
### AEDCN Model Details
The ACEVAE can be trained to maximize the conditional log-likelihood with an adversarial loss as a regularization term. The variational lower bound of the model is written as follows:  
\[\log p_{\theta}(y|x)\geq-KL\big{(}q_{\varphi}(z|x,y)\big{|}|p_{\theta}(z)\big{)} +E_{q_{\theta}(z|x,y)}[\log p_{\theta}(y|x,z)], \tag{2}\]  
and the empirical lower bound is written as:  
\[Loss(x,y;\theta;\varphi)=-KL\big{(}q_{\varphi}(z|x,y)\big{|}|p_{\theta}(z) \big{)}+\frac{1}{L}{\sum_{l=1}^{L}}\log p_{\theta}\big{(}y\big{|}x,z^{(l)} \big{)}, \tag{3}\] \begin{table}
\begin{tabular}{c c} \hline \hline
**Encoder** & **Decoder** \\ \hline
1024/fully connected & 1024/fully connected \\
2 \(\times\) 32 \(\times\) 32/3 \(\times\) 3 conv + BN + Dropout & 1 \(\times\) 32 \(\times\) 32/3 \(\times\) 3 conv + BN + Dropout \\
32 \(\times\) 16 \(\times\) 16/3 \(\times\) 3 conv + BN + Dropout & 32 \(\times\) 16 \(\times\) 16/3 \(\times\) 3 conv + BN + Dropout \\
64 \(\times\) 8 \(\times\) 8/3 \(\times\) 3 conv + BN + Dropout & 64 \(\times\) 8 \(\times\) 8/3 \(\times\) 3 conv + BN + Dropout \\
128 \(\times\) 4 \(\times\) 4/3 \(\times\) 3 conv + BN + Dropout & 128 \(\times\) 4 \(\times\) 4/3 \(\times\) 3 conv + BN + Dropout \\
256 \(\times\) 2 \(\times\) 2/3 \(\times\) 3 conv + BN + Dropout & 256 \(\times\) 2 \(\times\) 2/3 \(\times\) 3 conv + BN + Dropout \\
512 \(\times\) 1 \(\times\) 1/3 \(\times\) 3 conv + BN + Dropout & 512 \(\times\) 1 \(\times\) 1/3 \(\times\) 3 conv + BN + Dropout \\  & 256 mu k 256 var \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Structure of ACEVAE. where \(z^{(l)}=g_{\varphi}(x,y,\varepsilon),\varepsilon\sim N(0,1)\), \(q\) is the encoder defined in Table 2.  
To generate diverse features, we introduce adversarial loss as a regularization term to improve the generation ability; to construct an effective and simple adversarial loss term, we introduce an inverse \(KL\) divergence \(KL\big{(}p_{\theta}(z)\big{|}|q_{\varphi}(z|x,y)\big{)}\) to the empirical lower bound for building an adversarial loss, which is expressed as follows:  
\[ \begin{split} Loss_{ACEVAE}(x,y;\theta;\varphi)=\\ -KL\big{(}q_{\varphi}(z|x,y)\big{|}|p_{\theta}(z)\big{)}-KL\big{(} p_{\theta}(z)\big{|}|q_{\varphi}(z|x,y)\big{)}+\frac{1}{l}\sum_{l=1}^{L}\log p_{ \theta}\Big{(}y\Big{|}x,z^{(l)}\Big{)}\end{split}  \tag{4}\]  
In Formula (4), the \(KL\) divergence \(KL\big{(}q_{\varphi}(z|x,y)\big{|}|p_{\theta}(z)\big{)}\) and the inverse \(KL\) divergence \(KL\big{(}p_{\theta}(z)\big{|}|q_{\varphi}(z|x,y)\big{)}\) can be effectively calculated and they are combined as the adversarial loss term, which can be treated as an un-weighted JS divergence. ACEVAE is employed to introduce label-based data augmentation during the training process, and the whole training process is listed as follows:  
1. Transfer-based pre-training: AEDCN introduces a pre-training process based on added datasets as a transfer-learning approach to improve the adaptability of AEDCN for the predominant instrument recognition task. 2. Recognition training: Initially, the entire training dataset is used to train the multi-task deep instrument recognition backbone neural network. This step aims to learn the recognition capability of the model using the available training samples. 3. Imbalanced class addressing: After the initial recognition training, AEDCN focuses on addressing the issue of imbalanced classes in the dataset. Imbalanced classes refer to classes with a limited number of training samples, which can lead to imbalanced data representation. 4. Training the ACEVAE: To generate additional samples for the imbalanced classes, the fully connected features extracted from these samples during the training process are utilized. These features serve as the input to train the ACEVAE model, which is capable of generating synthetic samples based on specific labels. 5. Generating fully connected features: By training the ACEVAE, the model can generate fully connected features for the imbalanced class.