## 3 Proposed Algorithmic Procedure
### Image Processing for the Laser-Box Image
#### 3.3.1 Detecting Structured Edge Map
The total cross-entropy loss in HED is updated via standard stochastic gradient descent by the sum of the loss function at the side outputs and the fusion layer, as shown in the following equation:  
\[(\text{W},\text{w})^{*}=\text{argmin}(\text{L}_{\text{side}}(\text{W},\text{w} ),\ +\text{L}_{\text{fuse}}(\text{W},\text{w},\text{h}),\text{ }) \tag{13}\]  
where L (W,w,h) fuse denotes the loss function at the fusion layer and the L (W,w) side denotes the loss function at the side-output layer. W denotes the standard network layer parameters, w denotes the parameters of the side-output layers, and h indicates the fusion coefficient of each side output layer. The entire network in HED was trained with weighted-fusion supervision and side-output layer supervision. Compared with the train with weighted-fusion supervision only, the edge map predictions are progressively coarse-to-fine, local-to-global when train both. However, in trimmed-HED, the train with weighted-fusion supervision only exhibits complete structural information, and the network can learn from the image. Therefore, our loss function in trimmed-HED becomes:  
\[(\text{W},\text{w})^{*}=\text{argmin}\ (\text{L}_{\text{fuse}}(\text{W},\text{w},\text{h}),\text{ }) \tag{14}\]  
The final edge map predictions (Youtput) can be computed by further aggregating these edge maps of the side-output layers and the weighted-fusion layer:  
\[\hat{\text{Y}}_{\text{output}}=\text{Average}\left(\hat{\text{Y}}_{\text{ fuse}}\hat{\text{Y}}_{\text{side}}^{(3)}\hat{\text{Y}}_{\text{side}}^{(4)} \hat{\text{Y}}_{\text{side}}^{(5)}\right) \tag{15}\]  
Figure 9: Trimmed-HED network architecture. The green cubes represent the convolution layer, and the blue cubes represent the pooling layer. The prediction stage is a feed-forward network for generating initial predictions, and its architecture is divided into three stages. The final prediction output (a) is obtained by the weighted fusion of the side-output (3), side-output (4), and side-output (5). where the Y(3), Y(4), and Y(5) sides are the output of the side-output layer(3), the side-output layer(4), and the side-output layer(5), respectively. The parameters of our networks include the mini-batch size (10), the learning rate (1e-3), the loss weight for each side-output (1), the weight decay (0.0002), and the number of training iterations (1e+5 divides learning rate by 10 after 1000). The performance of the structured edge detection algorithm was evaluated using three standard measures: a fixed scale of the best F-measure on the data set (ODS), the best threshold for each image (OIS), and the average precision (AP). The trimmed-HED method was compared with the original HED method and the trimmed-HED (with/without deep supervision). The detailed experimental results are shown in Table 3. The results shown by original HED in Table 3 are unsatisfactory and are expected because a dataset not specifically designed to solve the problem in this study was used. Compared with the results shown in the first two rows of Table 3, creating a standard dataset has an advantage on the success of this study. Thus, compared with the original HED and original HED with our dataset, ODS increased by 0.131, OIS increased by 0.096, and AP increased by 0.109. The trimmed-HED without deep supervision achieved the best result in detecting the structured edge map as shown in the experiment. The ODS of our model is 0.803, OIS is 0.816, and AP is 0.809. \begin{table}
\begin{tabular}{l c c c} \hline \hline  & **ODS** & **OIS** & **AP** \\ \hline Original HED & 0.490 & 0.566 & 0.539 \\ \hline Original HED (with our data set) & 0.621 & 0.662 & 0.648 \\ \hline Trimmed-HED (with deep supervision) & 0.753 & 0.783 & 0.776 \\ \hline Trimmed-HED (without deep supervision) & 0.803 & 0.816 & 0.809 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Performance of network alternative architectures. The “without deep supervision” result is trained using Equation (14). The “with deep supervision” result is trained by Equation (13).