## 4 Convolutional Neural Network
### Classification CNN
#### 4.1.2 Proposed Structure  
The proposed classification CNN model in this study comprises a total of 20 layers: layers 1 to 12 are dedicated to feature extraction, while layers 13 to 20 are focused on classification. Layer 20 serves as the output layer, comprising six components that represent the six corrosion types. The detailed information on each layer is summarized in Table 2. As shown in Table 2, the size of the filter in the convolution layer is selected to be (5 \(\times\) 5), which is a typical size for large filters [42]. The size of the filter in the maxpooling layer is (2 \(\times\) 2), consistent with those commonly used in the existing literature [43; 44]. Several dropout layers that randomly drop a certain percentage of neurons from the neural network during the training process are included in the model to avoid overfitting. The employed dropout rate is 0.2, i.e., 20% of the neurons in the neural network are randomly deactivated. Figure 7 depicts the architecture of the proposed classification model with the dimension of each layer, where the input, convolution layers, and max-pooling layers are depicted in pink, blue, and green, respectively. Note that the dropout layers are not shown in Figure 7 as they do not impact the data dimensionality. The thick white line represents the flattened layer, the fully connected layers are represented in orange, and the output layers are shown in yellow in Figure 7.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Part** & **Layer No.** & **Layer Name** & **Parameters** \\ \hline \multirow{8}{*}{Feature extraction} & 1 & Convolution & 64 filters with size equals to (5 \(\times\) 5) \\ \cline{2-3}  & 2 & Maxpooling & Pooling size equals to (2 \(\times\) 2) \\ \cline{2-3}  & 3 & Dropout & Rate = 0.2 \\ \cline{2-3}  & 4 & Convolution & 128 filters with size equals to (5 \(\times\) 5) \\ \cline{2-3}  & 5 & Maxpooling & Pooling size equals to (2 \(\times\) 2) \\ \cline{2-3}  & 6 & Dropout & Rate = 0.2 \\ \cline{2-3}  & 7 & Convolution & 256 filters with size equals to (5 \(\times\) 5) \\ \cline{2-3}  & 8 & Maxpooling & Pooling size equals to (2 \(\times\) 2) \\ \cline{2-3}  & 9 & Dropout & Rate = 0.2 \\ \cline{2-3}  & 10 & Convolution & 512 filters with size equals to (5 \(\times\) 5) \\ \cline{2-3}  & 11 & Maxpooling & Pooling size equals to (2 \(\times\) 2) \\ \cline{2-3}  & 12 & Dropout & Rate = 0.2 \\ \hline \multirow{8}{*}{Classification} & 13 & Flatten layer & Unit number equals to 51,200 \\ \cline{2-3}  & 14 & Fully connected layer & Unit number equals to 128 \\ \cline{2-3}  & 15 & Dropout & Rate = 0.2 \\ \cline{2-3}  & 16 & Fully connected layer & Unit number equals to 64 \\ \cline{2-3}  & 17 & Dropout & Rate = 0.2 \\ \cline{2-3}  & 18 & Fully connected layer & Unit number equals to 32 \\ \cline{2-3}  & 19 & Dropout & Rate = 0.2 \\ \cline{2-3}  & & Output 1 & Unit number equals to 1 \\ \cline{2-3}  & & Output 2 & Unit number equals to 1 \\ \cline{2-3}  & 20 & Output 3 & Unit number equals to 1 \\ \cline{2-3}  & & Output 4 & Unit number equals to 1 \\ \cline{2-3}  & & Output 5 & Unit number equals to 1 \\ \cline{2-3}  & & Output 6 & Unit number equals to 1 \\ \hline \hline \end{tabular}
\end{table}
Table 2: CNN classification model layer information.  
Figure 7: Proposed CNN classification model structure.