# A Scalogram-Based CNN Approach for Audio Classification in Construction Sites
## 5 Experimental Setup
### Model  
The literature is rich in well-performing and famous CNN architectures, as well as customized models for specific applications. Since the problem has been converted into a standard image classification task and the number of classes is limited, in this paper, we consider the well-known AlexNet [51] architecture. Specifically, AlexNet is composed of a cascade of five convolutional layers and three (dense) fully connected ones.  
With respect to the original version, we introduce three modifications:  
1. The number of channels of the input layer is reduced to only one since the network is fed by the scalogram, which is a single-channel image;  
\begin{table}
\begin{tabular}{c l l c c c} \hline \hline
**N.** & **Class** & **Equipment** & **Data** & **Chunks** & **Split** \\ \hline
1 & JD50D & Compact excavator John Deere 50D & 15.00 & 30,000 & 22,500/7500 \\
2 & IRCOM & Ingersoll Rand Compactor & 15.00 & 30,003 & 22,502/7501 \\
3 & Mixer & Concrete mixer Meredes-Benz Actors & 14:59 & 29,999 & 22,499/7500 \\
4 & CAT320E & Hydraulic excavator Caterpillar 320E & 15.00 & 30,001 & 22,500/7501 \\
5 & Hitach50U & Compact excavator Hitachi ZXS0U & 14:59 & 29,999 & 22,499/7500 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Details of the used dataset.  
Figure 3: Examples of some scalogram images: (**a**) Class 1, (**b**) Class 3, and (**c**) Class 4.  
2. We add, after the input layer, a Rescaling layer in order to transform the integer input into floating-point numbers inside the interval \([0,\ 1]\);
3. The number of output classes has been reduced to five (the original AlexNet works with 1000 classes).  
The details of the network organization, layers' shape, and number of parameters of the customized version of AlexNet are summarized in Table 2. Refer also to Figure 1 for a graphical representation.  
AlexNet has been trained by minimizing the categorical cross-entropy defined as:  
\[\mathcal{L}(y,\widehat{y},\boldsymbol{\theta})\triangleq-\frac{1}{B}\sum_{n=1 }^{B}\sum_{i=1}^{N_{\mathbb{C}}}y_{n}^{(i)}\log\widehat{y}_{n}^{(i)}, \tag{5}\]  
where \(\boldsymbol{\theta}\) is the vector collecting all of the network parameters, \(N_{\mathbb{C}}=5\) is the number of classes, \(B\) is the mini-batch size, \(y_{n}^{(i)}\) is the actual label of the \(n\)-th sample and \(i\)-th class, and \(\widehat{y}_{n}^{(i)}\) is the corresponding predicted label. The minimization is performed by the gradient descent algorithm:  
\[\boldsymbol{\theta}_{k}=\boldsymbol{\theta}_{k-1}-\eta\
abla_{\boldsymbol{ \theta}_{k}}\mathcal{L}(y,\widehat{y},\boldsymbol{\theta}_{k-1}), \tag{6}\]  
where \(\eta\) is the learning rate and \(k\) is the iteration index; the gradient \(\
abla_{\boldsymbol{\theta}}\mathcal{L}(\cdot)\) is computed over a mini-batch. In this work, the Adam optimizer, a variant of the gradient descent, has been used [52]. Specifically, the Adam algorithm incorporates an estimate of the first- and second-order moments of the gradient with a bias correction to speed up the convergence process. Details of the Adam algorithm can be found in [52]. The learning rate is set to \(\eta=10^{-4}\) (parameters \(\beta_{1}\), \(\beta_{2}\), and \(\varepsilon\) are left at their default values), and a batch size of \(B=32\) is used. The training is run for 10 epochs.