# U-SSD: Improved SSD Based on U-Net Architecture for End-to-End Table Detection in Document Images
## 3 Proposed Method  
The model architecture proposed in this paper is based on SSD, and the original VGG model was improved by U-Net, which is called U-SSD, as shown in Figure 1. In the data input layer, the size of 300 \(\times\) 300 was maintained, and VGG16 was replaced by U-Net in the basic network layer. As the model architecture of VGG is highly similar to the feature extraction part of the contracting path (Encoder Part) of U-Net, feature extraction was carried out by the convolution layer. In the process of downsampling, some image edge information will be lost during the convolution operation. The other part of the U-Net network architecture is the expansive path (Decoder Part). In the decoder stage, the overlap-tile strategy was used to mirror the feature map, and the feature map, as generated by upsampling, was combined with the feature map of the same size, as generated in the encoder stage. In addition, in order to greatly reduce feature loss during feature transmission and complete the lost image edge information, multi-scale feature fusion was used to splice feature dimensions. Therefore, replacing VGG16 with U-Net improved the effect of feature map extraction. In the feature layer of the latter half of the original SSD, Conv4_3 and the output of the last layer in VGG16 are used as the starting point of the multi-scale feature map. In the latter part of the feature layer of U-SSD, as part of image information would be lost in the process of feature map scaling down and amplification in the U-Net encoder stage, this study added two additional convolutional layers, for a total of 8 convolutional layers (originally 6 in SSD), as shown in Figure 2. In addition, similar to the original SSD, this study maintained the last six layers of feature maps with different scales (38 \(\times\) 38, 19 \(\times\) 19, 10 \(\times\) 10, 5 \(\times\) 5, 3 \(\times\) 3, 1 \(\times\) 1) for detection of different scale targets and field of vision, and there was a L2 normalization layer after Conv13. The loss function and ground-truth matching optimization are based SSD. The loss function \(L\) is a weighted sum of the localization loss (loc) and the confidence loss (conf), seen in Equation (1). \(x_{ij}^{p}=\{1,0\}\) is an indicator for matching the \(i\)-th default box to the \(j\)-th ground truth box of category \(p\). N is the number of matched default boxes. The localization loss is a smooth L1 loss \(L_{loc}\) between the predicted box (\(l\)) and the ground truth box (\(g\)) parameters. The weight term \(\alpha\) is used for cross validation. The confidence loss \(L_{conf}\) is the softmax loss over multiple classes confidences (\(c\)). \[L(x,c,l,g)=\alpha L_{loc}(x,l,g)+\frac{1}{N}(L_{conf}(x,c)) \tag{1}\]Smooth L1 loss can avoid the gradient explosion caused by the wrong offset when the ground-truth and predicted box are too different. The \(L_{loc}\) is defined in Equation (2). We regress to offsets for the center \((cx,cy)\) of the default bounding box \((d)\) and for its width \((w)\) and height \((h)\). The confidence loss is defined in Equation (3). \[L_{loc}(x,l,g)=\sum_{i\in Pos}^{N}\sum_{m\in\{cx,cy,w\}}x_{ij}^{k} smooth_{L1}(l_{i}^{m}-\delta_{j}^{m}) \tag{2}\] \[\delta_{j}^{cx}=\frac{(\delta_{j}^{cx})-d_{i}^{cx}}{d_{i}^{w}} \delta_{j}^{cy}=\frac{(\delta_{j}^{cy})-d_{i}^{cy}}{d_{i}^{h}}\] \[\delta_{j}^{w}=\log(\frac{\delta_{j}^{y}}{d_{i}^{w}}) g_{j}^{h}=\log(\frac{\delta_{j}^{y}}{d_{i}^{h}})\]  
Figure 1: The proposed architecture of U-SSD. Figure 2: The detailed of multi-scale feature maps.