# Automatic Bridge Crack Detection Using a Convolutional Neural Network
## 2 Materials and Methods
### Proposed Model
#### 2.2.2 Depthwise Separable Convolution  
The depthwise separable convolution was originally proposed by [PERSON] [28]. After that, it was widely known and applied in models such as Inception [29], Xception [30], and MobileNets [31]. The depthwise separable convolution resolves the standard convolution into a depthwise convolution and a pointwise convolution. The spatial depthwise convolution is used independently on each channel of the input feature map, and then the outputs of the depthwise convolution are combined using a pointwise convolution. The Depthwise separable convolution can greatly reduce the model parameters and computational complexity, while maintaining a similar or better performance [32]. Figure 5 shows how the standard convolution (Figure 5a) is decomposed into a depthwise convolution (Figure 5b) and a \(1\times 1\) pointwise convolution (Figure 5c). The standard convolutional layer takes the feature map F of size \(D_{f}\times D_{f}\times M\) as an input and produces a feature map G of size \(D_{p}\times D_{p}\times N\), where \(D_{f}\) is the spatial width and height of the input square feature map, M is the number of input channels, \(D_{p}\) is the spatial width and height of the output square feature map, and N is the number of output channels [31]. The standard convolutional layer is convolved by a convolution kernel K of size \(D_{k}\times D_{k}\times M\times N\), where \(D_{K}\) is the spatial width and height of the convolution kernel (which is assumed to be squared), M is the number of input channels, and N is the number of output channels. Figure 5: (a) The standard convolution is decomposed into (b) a depthwise convolution and (c) a \(1\times 1\) pointwise convolution. The calculation cost of the standard convolution is shown in Equation (4):  
\[D_{k}\cdot D_{k}\cdot M\cdot N\cdot D_{p}\cdot D_{p} \tag{4}\]  
In Equation (4), the computational cost of the standard convolution increases exponentially with the output feature map size \(D_{p}\times D_{p}\) and the convolution kernel size \(D_{k}\times D_{k}\), the number of input channels \(M\), and the number of output channels \(N\). The depthwise separable convolution integrates the traditional convolution into two layers; the first layer is the filter layer, and the spatial convolution is performed on each channel of the input feature map by a depthwise convolution; the second layer is the combined layer, using a \(1\times 1\) pointwise convolution to combine the outputs of the depthwise convolution. The computational cost of the depthwise convolution is shown in Equation (5):  
\[D_{k}\cdot D_{k}\cdot M\cdot D_{p}\cdot D_{p} \tag{5}\]  
The computational cost of the \(1\times 1\) pointwise convolution is shown in Equation (6):  
\[M\cdot N\cdot D_{p}\cdot D_{p} \tag{6}\]  
The computational cost of the depthwise separable convolution is shown in Equation (7), which is the sum of the depthwise convolution and the pointwise convolution:  
\[D_{k}\cdot D_{k}\cdot M\cdot D_{p}\cdot D_{p}+M\cdot N\cdot D_{p}\cdot D_{p} \tag{7}\]  
By decomposing the standard convolution into the filter layer and the combined layer, we get a reduction in the amount of computation, as shown in Equation (8):  
\[ \begin{array}{l}\frac{D_{k}\cdot D_{k}\cdot M\cdot D_{p}\cdot D_{p}+M\cdot N \cdot D_{p}\cdot D_{p}}{D_{k}\cdot D_{k}\cdot M\cdot N\cdot D_{p}\cdot D_{p}} \\ =\frac{1}{N}+\frac{1}{D_{k}^{2}}\end{array}  \tag{8}\]  
The standard convolution simultaneously learns spatial information and the correlation between channels, while the depthwise separable convolution first performs a depthwise convolution, broadens the network so that it can extract more network features, and then performs a \(1\times 1\) pointwise convolution, by which the outputs of the depthwise convolution are linearly combined to generate new features.