# Intelligent Diagnosis of Concrete Defects Based on Improved Mask R-CNN
## 2 Methods
### Improvement on Mask-RCNN  
The original Mask R-CNN adopts ResNet101 as the backbone network, which has too many convolution layers and only one feature layer. With the increasing depth of the convolution layer, it has a lower ability to extract features for smaller targets in concrete defects, such as cracks and voids, and the large number of parameters leads to slow training speed of the model. In this paper, MobileNetV2 was used instead of ResNet101 in Mask-RCNN which is elaborated in Section 2.1. MobileNet is a lightweight network launched by Google, which was first proposed in 2017, aiming to greatly reduce the size of the model and speed up the computing speed of the model without sacrificing too much network performance. It is widely used because of its lightweight structure and excellent performance. MobileNet has three series, MobileNetV1, MobileNetV2 and MobileNetV3. MobileNet V1 replaces standard convolutions with depthwise Separable Convolutions; it contains channel-to-channel convolution (depthwise convolution) and point-to-point convolution (pointwise convolution). In standard convolution, as shown in Figure 3, if the image is input, which has a size of \(5\times 5\times 3\), and wants to obtain the output which has a size of \(3\times 3\times 4\), then it needs four filters, and every filter contains three convolution kernels (size is \(3\times 3\)). After each position in the three channels of each convolution kernel and each position in the three channels of the input image is element-wise multiplied, the three convolution kernels in every filter are merged to obtain feature maps. In this  
Figure 2: FPN structure and flow chart. calculation, the number of parameters calculated is \(3\times 3\times 3\times 4\). As shown in Figure 4, in Depthwise Separable Convolutions, each convolution kernel operates on only one channel of feature input, so the number of convolution kernels is equal to the number of channels for input features; for the example mentioned earlier, if the image is input, with a size of \(5\times 5\times 3\), and want to obtain the output which has a size of \(3\times 3\times 4\), then it needs three filters, every filter contains one convolution kernel (size is \(3\times 3\)), to obtain three maps (size is \(3\times 3\)). Through dimensionality reduction and point-to-point convolution to fuse the information of three maps to obtain filters, every filter contains three convolution kernels (size is \(1\times 1\)), merging the three convolution kernels in every filter to obtain feature maps. In this calculation, the number of parameters calculated is \(3\times 3\times 1\times 3+1\times 1\times 3\times 4\); compared with the number of standard convolution parameters, the number of depthwise separable convolution parameters is greatly reduced. MobileNet V2 replaces the residual block with the inverted residual block on the basis of MobileNet V1. Figure 5 shows the computation process of the residual block in ResNet; first, dimensionality reduction is conducted for the input feature map by the convolution which has the size \(1\times 1\), then the convolution is used which is the size \(3\times 3\) to extract features and finally, the convolution is used which is the size \(1\times 1\) to conduct dimensionality ascension. It can reduce the calculation amount when the convolution conducts the feature extraction, so the computing speed of the network can be improved. However, if dimensionality reduction is conducted for the input feature map before feature extraction, it will lose some feature information. Figure 6 shows the computation process of the inverted residual block in MobileNet V2; first, dimensionality ascension by the convolution is conducted for the input feature map which is the size \(1\times 1\); then, the depthwise convolution is used, which is the size \(3\times 3\), to extract features, so such operation can extract more feature information; finally, the convolution of the size \(1\times 1\) is used to conduct dimensionality reduction.