2.1.3. Discrete Definition

In engineering applications, the expression of the curve is therefore difficult to obtain, and can only be represented by an implicit function. By sampling, a continuous curve can be represented by a set of discrete ordered points. In this way, it is a common problem to measure the similarity of the two curves, which is to determine the similarity between two discrete ordered sets. As a result, a discrete curve similarity definition is needed. Similarly, the definition of discrete curve similarity transformation is given by reference to planar image transformation.

**Definition 5.** *Given one discrete curve FA* = *{(x1, y1), (x2, y2)* ... *(xm, ym)}, and*

$$T = \begin{bmatrix} a & 0 & 0 \\ 0 & k & 0 \\ b & h & 1 \end{bmatrix} \tag{3}$$

*is the curve similarity transformation matrix, where the meanings of a, b, k, h are the same as those described in Formula (1), corresponding to the translation and scale transformation of the horizontal and translation directions, respectively*. *F*- *<sup>A</sup>* = *T*·*FA* = (*x*∗ <sup>1</sup>, *<sup>y</sup>*<sup>∗</sup> 1),(*x*<sup>∗</sup> <sup>2</sup>, *<sup>y</sup>*<sup>∗</sup> <sup>2</sup>), ··· ,(*x*<sup>∗</sup> *<sup>m</sup>*, *<sup>y</sup>*<sup>∗</sup> *m*) *is called the similarity transformation curve of FA, where:*

$$\begin{cases} \mathbf{x}\_i^\* = a \cdot \mathbf{x}\_i + b \\ \mathbf{y}\_i^\* = k \cdot \mathbf{y}\_i + h \end{cases} \tag{4}$$

Without any doubt, the transformation matrix *T* can be more complicated, such as rotation, mirroring and shearing transformation, and various combinations thereof. Moreover, the definition of discrete curve similarity distance under the condition of curve similarity transformation can be given.

**Definition 6.** *Given a discrete curve FA* = *{(x1, y1), (x2, y2)* ... *(xm, ym)} as a reference curve, another curve FB* = *{(x'1, y'1), (x'2, y'2)* ... *(x'n, y'n)} is considered as a comparison curve. F'A* = *T* • *FA is transformed by a similarity transformation matrix T from FA. Among all similarity transformation matrices T, the minimum distance of all the matching distances between F'A and FB is as follows:*

$$\begin{split} \operatorname{dis}(t,a,b,k,h) &= \frac{1}{m} \sum\_{i=1, i \neq i+l}^{m} \left| T(x\_i, y\_i) - (x'\_j, y'\_j) \right| \\ &= \frac{1}{m} \sum\_{i=1, i \neq i+l}^{m} \left| (x'\_i, y'\_i) - (x'\_j, y'\_j) \right| \\ &= \frac{1}{m} \sum\_{i=1, i \neq i+l}^{m} \left| (a \cdot x\_i + b, k \cdot y\_i + h) - (x'\_j, y'\_j) \right| \\ &= \frac{1}{m} \sum\_{i=1, i \neq i+l}^{m} \left| (a \cdot x\_i + b - x'\_j, k \cdot y\_i + h - y'\_j) \right| \\ &= \frac{1}{m} \sum\_{i=1, i \neq i+l}^{m} \sqrt{(a \cdot x\_i + b - x'\_j)^2 + (ky\_i + h - y'\_j)^2} \end{split} \tag{5}$$

$$D(F\_A, F\_B) = D(F'\_A, F\_B) = \min \{ \operatorname{dis}(t, a, b, k, h) \}\_r \tag{6}$$

*which is called the curve similarity distance of FB to FA under the transformation T. The meanings of a, b, k, h are the same as those described in Formula (1) and Figure 2, corresponding to the translation and scale*

*transformation of the horizontal and translation directions, respectively. Meanwhile, t is the starting point position of the optimal matching of the reference curve on the comparison curve*.

Likewise, the definition of discrete curve similarity is as follows:

**Definition 7.** *Given a discrete reference curve FA and a comparison curve FB, for a given threshold* ε*, if D(FA, FB)* ≤ ε*, then the curve FB is called similar to curve FA, and vice versa*.

Finally, calculating the similarity distance of the comparison curve to the reference curve is equivalent to calculating the optimal matching of the reference curve in the sense of the average distance on the comparison curve after the transformation. Therefore, performing a similarity measure between two curves requires two steps, one is to calculate the optimal matching, and the other is to perform threshold discrimination.

In the classic curve matching algorithm DTW, once a curve of two curves is translated or stretched, the distance measurement between them will be modified. In the curve similarity measure process, the curve similarity distance calculation depends on a transformation matrix. The characteristics of the transformation matrix can well prevent the deformation process of the translation, stretching and rotation of the curve. However, the transformation matrix is sometimes difficult to solve directly.

Accordingly, an evolutionary computation (EC) [32] algorithm has been introduced to obtain the transformation matrix and the optimal matching interval between two curves by minimizing the matching distance. The specific search algorithm is introduced later.

## 2.1.4. Matching Calculation

It can be observed from the definition that the curve similarity distance is the optimal matching of the reference curve with the comparison curve under different similarity transformations. Therefore, the matching distance between two curves under different CSTs can be obtained by random search algorithm. EC is a very effective algorithm for intelligent random search, where the similarity transformation matrix *T* is the parameter space of random search.

The whole idea of EC is to generate *S* random populations *POP* = {*POP(*0*)*, *POP(*1*)*, ... , *POP(S* − 1*)*}, each of which corresponds to a set of parameters of CST *T* and a fitness value *fitness* = *D(FA, FB)* from Formula (6), where the *fitness* is smaller, the population is better. At the same time in each iteration search, each individual will generate new descendants near itself, and the best individuals can be chosen to enter the next iteration search.

The above process is repeated until the iterative search reaches the maximum number of iterations, at which point the optimal individual parameters and fitness will be regarded as CST and CSD, respectively.

At the same time, the parameters (*t*, *a, b, k, h)* should meet certain constraint conditions and adopt real coding for the signature curve matching. The boundary condition of the following system is 0 ≤ *t* < 2*n*, 0.90 ≤ *a* ≤ 1.10, 0.90 ≤ *k* ≤ 1.10, −100 ≤ *b* < 100*,* and −100 ≤ *h* ≤ 100, where *a* and *k* are elastic scales in the horizontal and vertical directions, and *b* and *h* are translations.

The Algorithm 1 process is as follows:

**Algorithm 1.** Optimal matching calculation by EC

*i* = 0 **For** *j* = 0: *S* − 1 **Do** //random generation of parameters *t*, *a, b, k, h* initial a population *POPi*(*j*) = (*t*, *a, b, k, h*) calculate fitness of each member in *POPi*(*j*) **End For While** *i* < *Iterations* **Do** *i* = *i* + 1 //sorting and classification order *POPi*<sup>−</sup><sup>1</sup> by fitness in ascending and divide them into 4 levels //acceleration search **For** *j* = 0:*S* − 1 **Do If** *POPi*−1(*j*) is at level *kind* //where*, kind* = 1, 2, 3, 4, indicating the classification level of each population //random generation of new parameters *t*, *a, b, k, h* in the neighborhood //i.e., *a* = rand(*POPi*−1(*j*).*a, kind*) generate new *kind*+1 subpopulations *nPOP* from *POPi*−1(*j*) calculate fitness of each member in *nPOP* //sorting subpopulations order *nPOP* by fitness in ascending //select best subpopulation *nPOP* as *POPi*−1(*j* + *S*) *POPi*−1(*j* + *S*) = *nPOP(0)* **End If End For** //global selection order *POPi*<sup>−</sup><sup>1</sup> by fitness in ascending, where there are 2*S* populations select the top *S* from *POPi*<sup>−</sup><sup>1</sup> as *POPi* **End While**

When generating new *kind* + 1 subpopulations from one population, each subpopulation has different parameter generation range at different level. Generally speaking, the *fitness* is smaller, the parameter generation range of each subpopulation is narrower.

Suppose that the *j*-th population *POP*(*j*) is at the *kind*-th level, on which parameter generation range is *GRkind* = *kind* • *GRmax*/*4*, *kind* + 1 subpopulations *nPOP* can be randomly generated, here:

$$nPOP = \left\{ nPOP(k) \left| \left| nPOP(k) - POP(j) \right| < \text{GR}\_{\text{kind}}, k = 0 \sim \text{kind} \right\} \right.\tag{7}$$

For example, for parameter *a*, *GRmax* = max(*a*) − min(*a*). When *kind* = 1 and a new random number *r* = −1 or 1 is generated, *anew* = *aold* + *r* • *GRkind* = *aold* + *r* • *GRmax*/4. At the same time, check whether *anew* satisfies the boundary condition.

The other parameters *t*, *b*, *k*, *h* all perform similar operations. Therefore, from the new subpopulation process generated by the parameters represented by each original population, the parameters of the generated subpopulations are determined according to the classification level of the original population. Although this parameter is also random, it varies randomly to the original population by its classification level.

#### *2.2. Proposed System*

Online signature verification system can be discriminated by the similarity distance of two signature curves, where one signature can be called as the reference signature and the other can be called as the comparison signature. For instance, two signature trajectories can be considered as plane curves which can be also divided into *X* curves and *Y* curves, as shown in Figure 3.

**Figure 3.** Two signature curves and their corresponding *X* and *Y* curves.

For a reference signature curve and a comparison signature curve, if the similarity distance between them is sufficiently small, it can be considered that the comparison signature is genuine one, otherwise it is a forged signature. A block diagram of the proposed system is illustrated in Figure 4.

**Figure 4.** Block diagram of the proposed system.

Given *SignR* = {(*x*1, *y*1), (*x*2, *y*2) ... (*xM*, *yM*)} and *SignC* = {(*x'*1, *y'*1), (*x'*2, *y'*2) ... (*x'N*, *y'N*)} as the reference curve and the comparison curve, respectively. For the calculation of the similarity distance of the signature curves, if the reference curve is calculated as a whole with the comparison signature, it will lead to greater errors. Segmentation curve matching can be used to better measure local differences between curves, which could be common in complex curve similarity measures.
