# A Waste Classification Method Based on a Multilayer Hybrid Convolution Neural Network
## 3 Methodology
### The Initial Network Modules  
In this paper, the convolution layer and the batch normalization (BN) layer are mainly used to extract image features. The BN [34] layer is used to improve the generalization ability of the network, disturb the training data, and accelerate the convergence speed of the model. During the process of training, BN is calculated based on each small batch. The mean and variance corresponding to each batch of data during training are recorded and used to calculate the mean and variance of the entire training set, which is performed as follows:  
\[\mu_{\beta}=\frac{1}{m}\sum_{i=0}^{m}x_{i},\beta^{2}=\frac{1}{m}\left(x_{i}- \mu_{\beta}\right)^{2} \tag{1}\]  
\[E[x]\gets E_{\beta}\left[\mu_{\beta}\right],Var[x]\leftarrow\frac{m}{m-1} E_{\beta}\left[\delta_{\beta}^{2}\right] \tag{2}\]  
where \(m\) refers to small batch size, \(\beta\) is a dataset with batch size \(m\), and \(x\) is the input of one layer. Batch standardization is carried out for each feature map, i.e., the same operation is taken for batch standardization in different positions of each feature map. Supposing the size of the feature map is \(p\times q\), BN for this feature map will be equivalent to normalizing the feature batch with size \(m^{\prime}=|\beta|=m\cdot pq\). BN is selected to effectively avoid gradient  
Figure 1: The overall process of the proposed waste classification method. disappearance and explosion, which has little to do with the initial values of the parameters and has a regularization effect. In VGGNet, it was pointed out that two 3 \(\times\) 3 convolution kernels have the same perceptual field of view as one 5 \(\times\) 5 convolution kernel. Therefore, using a 3 \(\times\) 3 convolution kernel does not only ensure the perceptual field of view, but also reduces the parameters of the convolution layer. Thus, the 3 \(\times\) 3 convolution kernels are used in the network structure of this paper. The structure of the proposed module is shown in Figure 2. Using such modules for mixing, the number of channels per module is 32, 64, 128, 256, etc. Supposing the input layer of the module is the \(l-1\) layer, its input feature map is \(X^{l-1}\), the corresponding feature convolution kernel is \(K^{l}\), the output of the convolution layer is \(Z^{l}\), and the bias unit of the output layer is \(b^{l}\); then, the output of the convolution layer will be as follows:  
\[Z^{l}_{u,v}=\sum_{i=-\infty}^{\infty}\sum_{j=-\infty}^{\infty}X^{l-1}_{i+u,j+v }\cdot K^{l}\cdot\chi(i,j)+b^{l} \tag{3}\]  
\[\chi(i,j)=\left\{ \begin{array}{cc}1,&0\leq i,j\leq n\\ 0,&\quad\text{others}\end{array} \right. \tag{4}\]  
The output feature of the convolution layer passes through the BN layer, and then through the maximum pooling layer for down-sampling. Now, the weight of each unit of convolution kernel is \(\beta^{l+1}\), and a bias unit \(b^{l+1}\) is added to the output. The output of the sampling layer is as follows:  
\[Z^{l+1}_{i,j}=\beta^{l+1}\cdot\sum_{u=ir}^{(i+1)r-1}\sum_{v=jr}^{(j+1)r-1}a^{l }_{u,v}+b^{l+1} \tag{5}\]  
\[a^{l}_{u,v}=f\left(Z^{l}_{u,v}\right) \tag{6}\]  
\[a^{l+1}_{i,j}=f\left(Z^{l+1}_{i,j}\right) \tag{7}\]  
The sampling layer is followed by the convolution layer; now, the output is the following:  
\[Z^{l+2}_{u,v}=\sum_{i=-\infty}^{\infty}\sum_{j=-\infty}^{\infty}a^{l+1}_{i+u, j+v}\cdot K^{l+2}_{i,j}\cdot\chi(i,j)+b^{l+2} \tag{8}\]  
where \(X\) is a matrix of order \(m\times m\), \(K\) is a matrix of order \(n\times n\), \(a^{l}_{u,v}\) is a function of \(Z^{l}_{u,v}\), and \(a^{l+1}_{i,j}\) is a function of \(Z^{l+1}_{i,j}\). The range of \((u,v)\) is \(0\leq u,v\leq n\). After the modules are mixed, a flattening layer is used, which is used for the transition between the convolution layer and the full connection layer, to \"flatten\" the data input into the full connection layer. Next, two full connection layers are used, and the number of channels in each full connection layer is 128 and 64. Compared with the large number of channels, the parameters and calculation amount are reduced.