## 3 Feature Extraction  
The procedure for deriving a vascular pattern is based on the identification of vein centroids in each of the B-mode images collected along the y-direction. These centroids are then linked on the base of the minimum distance criterion. Figure 2 shows a collected B-mode image. As the user's hand and the probe are both immersed in water, the image shows a very dark layer corresponding to water. As is known, ultrasound images are strongly affected by speckle noise, which is generated when an ultrasonic wave hits an acoustic interface smaller than its wavelength: soft tissue cells act as independent sources of ultrasound waves, scattering the gained energy in all directions. Depending on other scatterers' positions, diffuse ultrasonic waves may undergo constructive or destructive interference (based on the wave phase), resulting in an increase or decrease in ultrasonic energy returning to the probe [31; 32]. Several techniques have been proposed in the literature to reduce speckle noise without destroying important image information [33; 34]. In this work, a speckle-reducing anisotropic diffusion (SRAD) filter, which is effective and has been successfully used in a previous work with similar images [35], has been adopted based on the following iterative formula [36]:  
\[I_{i,j}^{n+1}=I_{i,j}^{n}+\frac{\Delta_{t}}{4}+q_{i,j}^{n} \tag{1}\]  
where \(I_{i,j}^{n}\) indicatesthe pixel at position \((i,j)\) at step \(n\), \(\Delta_{t}\) is time step size and \(q_{i,j}^{n}\) identifies the edge structure of pixels adjacent to the one considered. SRAD is sensitive to filter window shape and size: according to Ref. [31], a square window is typically applied, and its size depends on the scale of interest. The choice of the parameters \(n\) and \(\Delta_{t}\), as well as window dimension, is crucial to optimize image quality. In this work, the optimum set of parameters for the SRAD filter was determined in a heuristic way, i.e., by maximizing recognition results, which has been achieved with a 50 \(\times\) 50 window, number of iterations \(n\) = 40, and time step \(\Delta_{t}\) = 0.1. Figure 3a shows the achieved results. For comparison, the image obtained by setting a 60 \(\times\) 60 window, \(\Delta_{t}\) = 0.5, and \(n\) = 60 is reported in Figure 3b. As can be seen, in this latter case, over-smoothing occurs, and edges are blurred, damaging image quality. Figure 3: (**a**) Image obtained by applying an SRAD filter with a 50 \(\times\) 50 window, \(\Delta_{t}\) = 0.1, \(n\) = 40 (used in this work). (**b**) Image obtained by applying an SRAD filter with a 60 \(\times\) 60 window, \(\Delta_{t}\) = 0.5, \(n\) = 60, which produces excessive smoothing and blurred edges. Figure 2: A B-mode image used for vein centroid identification. The next operation is binarization. In previous works [37; 38], a global threshold was set based on heuristic considerations. However, this approach is suitable only if images under analysis have more or less the same characteristics in terms of illumination and contrast. For better accuracy, an adaptive threshold is preferable: it is chosen according to the grey tones of each image based on some local statistics. Several binarization methods can be found in the literature [39]. In this work, two well-established types of adaptive threshold binarizations have been experimented with: mean value and Ridler's threshold [40; 41]. Mean binarization provides that, for each B-mode image, the threshold is given by the arithmetic mean (\(\mu\)) of all its pixels, as follows:  
\[\mu=\frac{1}{N}\sum_{i=1}^{N}A_{i} \tag{2}\]  
where \(A_{i}\) is the \(i\)-th pixel value, and \(N\) = 542 \(\times\) 238 is the number of pixels in the image. An example of pixel value distribution in a B-mode image is shown in Figure 4.  
[PERSON]'s threshold is calculated by the following iterative algorithm: [42]:  
1. An initial threshold \(T_{0}\) is established according to Equation (2);
2. All pixels below \(T_{0}\) are placed in a set, called \(A\) for simplicity; the others are placed in a set \(B\). 3.