# An Adaptive Multitask Network for Detecting the Region of Water Leakage in Tunnels
## 2 Methods
### The Adaptive Multitask Decoder  
Due to no obvious boundary between the wet stain in the water leakage edge area and the water seepage, it will be challenging to divide the edge area if only 1 decoder is used to deal with it. To solve this problem, some researchers have used the manual label-making method to separate the difficult-to-segment and easily-segmented areas [29]; this method has been proven to work well. However, this method is inefficient. Therefore, this paper proposes an adaptive multitask decoder, through which the decoder composed of 3 network branches adaptively generates labels with water seepage and wet stains.  
Each of the adaptive network branches has the same structure and is composed of general convolution. However, the labels for supervising the training of the adaptive network branches are distinct, enabling adaptive multitask training for the network branches. The labels for supervising network training can adaptively generate different labels in accordance with a threshold value. Figure 6 illustrates the process of automatically generating labels. Input undergoes calculation by the Sigmoid function, yielding a matrix of probability values. The network was divided into 2 branches to generate the labels of water seepage and wet stains. In the first branch, if a probability value in the matrix is less than the threshold value R, the corresponding probability value is set to 0, resulting in a new matrix. This new matrix is then combined with an all-1 matrix, and the resulting matrix and the original label are subjected to an inner product mathematical operation, automatically generating a feature map of 0 and 1, which is the label of water seepage.  
In the second branch, if a probability value in the matrix is greater than the threshold value R, the corresponding probability value is set to 0. resulting in a new matrix. This new matrix is then combined with an all-1 matrix; the resulting matrix and the original label are subjected to an inner product mathematical operation, automatically generating a feature map of 0 and 1, which is the label of wet stains. At this point, the different labels individually supervise the decoder's network branches for training, thereby achieving the objective of adaptive multitasking.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Stage** & **Stride** & **Layer** & **Parameter** \\ \hline \multirow{3}{*}{1} & \multirow{3}{*}{1} & Patch Embed & \(P_{1}=2\) \\  & & & \(C_{1}=64\) \\ \cline{3-4}  & & Transformer Block & \(\begin{bmatrix}H_{1}=1\\ R_{1}=4\end{bmatrix}\times 2\) \\ \hline \multirow{3}{*}{2} & \multirow{3}{*}{2} & Patch Embed & \(P_{2}=2\) \\  & & & \(C_{2}=128\) \\ \cline{3-4}  & & Transformer Block & \(\begin{bmatrix}H_{2}=2\\ R_{2}=4\end{bmatrix}\times 2\) \\ \hline \multirow{3}{*}{3} & \multirow{3}{*}{2} & Patch Embed & \(P_{3}=2\) \\  & & & \(C_{3}=256\) \\ \cline{3-4}  & & Transformer Block & \(\begin{bmatrix}H_{3}=4\\ R_{3}=4\end{bmatrix}\times 2\) \\ \hline \multirow{3}{*}{4} & \multirow{3}{*}{2} & Patch Embed & \(P_{4}=2\) \\  & & & \(C_{4}=512\) \\ \cline{3-4}  & & Transformer Block & \(\begin{bmatrix}H_{4}=8\\ R_{4}=4\end{bmatrix}\times 2\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Parameter configuration table of the multilevel Transformer.