# Contactless Palm Vein Recognition Based on Attention-Gated Residual U-Net and ECA-ResNet
## 3 Attention-Gated Residual U-Net and ECA-ResNet
### Palm Vein Segmentation
#### 3.2.1 Ground-Truth Labeling  
Currently, there is no existing database that includes annotated labels for training and evaluating palm vein segmentation algorithms. As a result, we had to manually generate the ground-truth label for palm vein segmentation by employing an already-existing handcrafted vein enhancement algorithm. This approach allowed us to create a reliable and accurate set of labeled data for use in the training and evaluation of our algorithm. In this study, the Jerman filtering method [43] was used to measure the eigenvalues of the Hessian, the results of which are almost accurate and similar to the actual palm vein based on a careful selection of parameters such as the kernel size. The Jerman filtering method is widely used to strengthen the intensity of the vessels in contrast to non-vein areas. Denoting \(I(X)\) as the 2-D input at coordinate \(X=[x1,x2]\), the Hessian value of \(I(X)\) at X and scale s is then represented as Equation (3):  
\[\mathbf{H_{ij}}\left(X,s\right)=s^{2}I(X)*\frac{\partial^{2}}{\partial x_{i} \partial x_{j}}G(X,s)\quad\text{ for }i,j=1,2, \tag{3}\]  
where G is a bivariate Gaussian filter. Then, the Jerman filtering algorithm is computed as Equation (4):  
\[v=\begin{cases}0&\text{ if }\lambda_{2}\leq 0\vee\lambda_{\rho}\leq 0,\\ 1&\text{ if }\lambda_{2}\geq\lambda_{\rho}/2>0,\\ \lambda_{2}^{2}\big{(}\lambda_{\rho}-\lambda_{2}\big{)}\Big{(}\frac{3}{ \lambda_{2}+\lambda_{\rho}}\Big{)}^{3}&\text{ otherwise}\end{cases} \tag{4}\]  
where:  
\[\lambda_{p}=\left\{\begin{array}{ll}\lambda_{3}&\text{ if }\lambda_{3}> \tau\max_{x}\lambda_{3}(X,s),\\ \tau\max_{x}\lambda_{3}(X,s)&\text{ if }0<\lambda_{3}\leq\tau\max_{x}\lambda_{3}(X,s), \\ 0&\text{ otherwise}\end{array}\right. \tag{5}\]  
The kernel size for the Gaussian size and the parameter value \(\tau\) is the crucial factor when using a handcrafted method such as the Jerman filter, as it can result in different responses ranging from a simple vessel output to complex and sensitive textures, which is also the practical reason behind the need for deep-learning-based segmentation. Depending on the variations in the light, texture, size, and shape of collected vein images via different devices and setups, the arbitrarily chosen parameters of the algorithm may become inconsistent and lack versatility. The image processing method called Jerman is used for extracting the vascular shape palm vessel from the ROI in the manner shown in Figure 4b. This method has involved experimenting with different Gaussian kernels, and a kernel size of three is selected as the optimal value for extracting, as smaller kernels cause the palm image to be more responsive to image noise, and the larger kernels can create an unnecessary and complicated texture in the image. It is crucial to obtain near-accurate ground-truth labels for palm vein segmentation. The extracted images are then applied with a specific threshold for removing the weak and unclear responses, and the pixel values are set to 0 for the palm vessel and 255 for the background in a proper labeling.