Neural Computing and Applications manuscript No.
(will be inserted by the editor)

On Usage of Autoencoders and Siamese Networks for Online
Handwritten Signature Verification

arXiv:1712.02781v2 [] 29 Dec 2017

Kian Ahrabian · Bagher Babaali

Submitted: December 2017

Abstract In this paper, we propose a novel writerindependent global feature extraction framework for
the task of automatic signature verification which aims
to make robust systems for automatically distinguishing negative and positive samples. Our method consists of an autoencoder for modeling the sample space
into a fixed length latent space and a Siamese Network for classifying the fixed-length samples obtained
from the autoencoder based on the reference samples of a subject as being Genuine or Forged. During our experiments, usage of Attention Mechanism
and applying Downsampling significantly improved
the accuracy of the proposed framework. We evaluated our proposed framework using SigWiComp2013
Japanese and GPDSsyntheticOnLineOffLineSignature
datasets. On the SigWiComp2013 Japanese dataset,
we achieved 8.65% EER1 that means 1.2% relative improvement compared to the best-reported result. Furthermore, on the GPDSsyntheticOnLineOffLineSignature dataset, we achieved average EERs of 0.13%,
0.12%, 0.21% and 0.25% respectively for 150, 300, 1000
and 2000 test subjects which indicates improvement of
relative EER on the best-reported result by 95.67%,
95.26%, 92.9% and 91.52% respectively. Apart from the
Kian Ahrabian
School of Mathematics, Statistics, and Computer Science,
University of Tehran, Tehran, Iran
Tel.: +98-9125482934
E-mail: kahrabian@ut.ac.ir
Bagher Babaali
School of Mathematics, Statistics, and Computer Science,
University of Tehran, Tehran, Iran
Tel.: +98-9125248895
E-mail: babaali@ut.ac.ir

accuracy gain, because of the nature of our proposed
framework which is based on neural networks and consequently is as simple as some consecutive matrix multiplications, it has less computational cost than conventional methods such as DTW2 and could be used
concurrently on devices such as GPU3 , TPU4 , etc.
Keywords Online Handwritten Signature Verification · Siamese Networks · Autoencoders · Sequence to
Sequence Learning · Attention Mechanism

1 Introduction
The handwritten signature is the most widely accepted
biometric measure for authentication in governments,
legal systems, banks, etc. Therefore it is of the utmost
importance to have robust methods for verifying the
identity of people based on their signatures. The task
of ASV5 aims to address this problem by making robust
systems that automatically classify a signature sample
as being Genuine or Forged compared to some previously acquired signatures from the claimed subject. By
doing so, we might be able to verify the identity of a
person at a speed and accuracy which exceeds the human performance.
In online signature verification, the signatures are
acquired directly from a capturing device that records
the dynamic information of the pen at a constant rate
which usually includes coordinates, pressure, velocity,
azimuth, etc. Consequently creating a sequence of data
points that might also embed some other hidden dynamic information of the signature in itself too. These
2
3
4

1

Equal Error Rate

5

Dynamic Time Warping
Graphics Processing Unit
Tensor Processing Unit
Automatic Signature Verification

2

Kian Ahrabian, Bagher Babaali

obscure pieces of information could be further exploited
to discriminate the positive and negative samples. This
method is in contrast with offline signature verification
in which we acquire the sample after the signing process is complete, leaving us with only a picture of the
signature. Due to saving the dynamic information of
the sample instead of saving just an image, it becomes
more difficult to forge a signature while trying to simulate these features. Hence the online methods for signature verification are considered to be more reliable and
accurate than the offline forms.
The previous studies on online signature verification
could be grouped into two main categories based on
their approaches for feature extraction [53]:

use it in the test time to classify the input signature by comparing it to reference samples. DTW
method is the most well-known method in this subcategory, and it has been widely used in many studies [24, 32, 43, 49]. In the second subcategory, the
algorithms train a probabilistic model using the signatures in the reference set and later use this model
to classify the test signatures as being forged or genuine by calculating the probability of them being
genuine and comparing it with a threshold. These
methods usually use likelihoods for scoring and decision making. HMM7 [8, 11, 41, 48, 51] and GMM8
[21, 33, 39] are the most common methods in this
subcategory.

– Global Feature Extraction methods: The primary focus of these methods is to derive a fixed
length feature vector from the signature as a whole
to make them comparable. We divide this category
into two subcategories. The first subcategory consists of algorithms that try to extract the features
from the totality of signature. For example, in [23]
the number of strokes is used as a global feature.
There also exist many other characteristics such as
average velocity, average pressure, and the number
of times the pen is lifted during the signing [27].
An excellent example of the extent of these features
could be found in [12], in which 100 global elements
have been sorted by their discrimination power, a
subset of these features has been used in other studies [28, 35–37, 40]. The second subcategory consists
of algorithms that obtain a fixed length feature vector of elements by applying a transformation on the
signature. For example, in [29] a wavelet transform
has been used to extract a feature vector from the
entire sample. Other study [30], use DCT6 transform to obtain the fixed length feature vector [30].
Also, in a recent work [53], a fixed length vector,
called i-vector, is extracted from each signature sample. The low-dimensional fixed length i-vector representation was originally proposed for speaker verification, and in [53] it has been adopted for the
application of online signature verification.
– Functional methods: These methods are more focused on calculating a distance between two signatures which are represented by a sequence of extracted features (Data Points) and comparing them
based on the estimated distance. Like the previous one, this category also could be divided into
two subcategories. In the first subcategory, the algorithms do not perform any modeling, and these
methods keep a reference set for each subject and

From another perspective, it is also possible to divide previous studies on online signature verification
into two main groups based on their approach to training the classifier [18]. In a Writer-Dependent method,
for each subject, a binary classifier is trained based on
a training set which only consists of signatures from
the specific subject. In a Writer-Independent approach,
a single global classifier is trained based on the whole
training set. In both methods, the negative samples are
obtained from the forgery samples of the specific subject which is provided in the training set. The main benefit of a writer-independent approach is that it needs
much less computation power compared to the other
method. Also, because these methods do not require
to train a new model for each new user, they are considered easier to deploy and use in different scenarios.
Note that it is also possible to use other subjects signatures as negative samples, but due to the nature of this
method, it could lead to poor results and degraded generalization ability. At the test time, we use a classifier
which is trained with one of the mentioned approaches
to classify the query signature as being Forged or Genuine compared to reference signatures of the claimed
individual. Some comprehensive reviews on the problem could be found in [22] and [17].
In this paper, we propose a Writer-Independent
Global Feature Extraction method which is based on
a Recurrent Autoencoder, sometimes called a Diabolo
Network [2], as the global feature extractor and a
Siamese Network as the global classifier. Our approach
for training the Recurrent Autoencoder is based on the
proposed technique in [4] which is called Sequence to
Sequence Learning. In this method, a model is trained
to learn a mapping between samples space where every
sample is a sequence of data points and a fixed length
latent space. By doing so, we obtain a mapping that
7

6

Discrete Cosine Transform

8

Hidden Markov Model
Gaussian Mixture Model

On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification

could be used to extract a fixed length feature vector
that captures the most crucial attributes of each sample. We expect that these feature vectors could be further used to distinguish the forged and genuine samples.
As for the classification part, we train a Siamese Neural Network. Characteristically, siamese networks are a
perfect solution for verification tasks, as has been previously studied in [3, 6, 7, 9, 26], because their objective
is to learn a discriminative similarity measure between
two or more inputs that classifies the inputs as being
the same or not. So we expect to achieve a promising
solution with this combination for the task of Online
Signature Verification.
It is important to note that the proposed method
has a relatively low cost of computation which is mostly
during the training time and it reduces to just a few
matrix multiplications at the test time. This is a crucial
advantage because it could lead to faster verification
systems which can respond quickly to the queries by
concurrently computing the results on devices such as
GPU, TPU, etc.
We organize the rest of the paper as follows: In Sect.
2 we describe the architecture and attributes of the
models we used along with a detailed description of
their structure. Sect. 3 and Sect. 4 presents our experiments and its comparison to the state-of-the-art algorithms. Finally, in Sect. 5, we conclude our paper with
possible future directions.

2 The Proposed Framework
In this section, at first, the preprocessing performed on
samples is explained in Sect. 2.1. This is followed by an
overview of the proposed Autoencoder architecture in
Sect. 2.2. Finally, a detailed description of the proposed
Siamese Network architecture is given in Sect. 2.3.

2.1 Preprocessing
At first, we extract a set of 12 local features from the
provided coordinates of the pen for each data point.
These features are among the local features that have
been introduced in [40,53]. These locally extracted features are listed in Table 1. After obtaining the local features, we normalize each sample individually by applying the Standard Normalization method on each local
feature of each sample independently. Then a threshold
is applied to the length of samples to filter out very long
samples.
At this stage, we apply a downsampling procedure
to each sample. To perform this process with a sampling rate of K, we traverse the data points concerning

3

Table 1 List of extracted local features for each data point.
1. Horizontal position xt
3. Path-tangent angle
5. Log curvature radius

2. Vertical position yt
4. Path velocity magnitude
6. Total acceleration magnitude
7-12. First order derivatives of 1-6

the chronological order and do the following steps repeatedly until we reach the end of the sequence:
1. Select a data point
2. Skip K − 1 data points
By applying this method to a given sample with the
length of L, we obtain a downsampled sample with the
L
length of [ K
].
Finally, since batch training in neural networks requires samples to possess the same shape, we must apply a padding procedure to obtain samples with equal
length. To do this, for each sample, we use pre-padding
with zero to produce a sample that has a length equal to
the length of the most extended sample in the dataset.

2.2 Autoencoder
The RNN9 is a generalization of feedforward neural networks that make it possible to process sequences sequentially by maintaining a hidden state h which works
as a memory containing the previously observed context. Given a sequence of inputs (x1 , ..., xt ), a standard RNN generates a sequence of outputs (y1 , ..., yt )
in which the output at timestep t is computed by
ht = f (ht−1 , xt ),

(1)

yt = Wh ht ,

(2)

where f is a non-linear activation function [4].
It is possible to train an RNN to learn a probability
distribution over a set of sequences to predict the next
symbol in a sequence given the previous symbols. By
doing so, the output at each time step t could be formulated as the conditional distribution p(xt |xt1 , ..., x1 ).
Thus the probability of the sequence x is calculated using
p(x) =

T
Y

p(xt |xt−1 , ..., x1 ).

(3)

t=1

After learning the distribution, we could iteratively predict a symbol at each time step to obtain a whole sequence from a sample in the learned distribution [46].
9

Recurrent Neural Network

4

Kian Ahrabian, Bagher Babaali

BRNN10 [44] is an extension to the vanilla RNN.
The idea behind these networks is to have two separate RNN and feed each training sequence forward and
backward to them, note that both of these RNNs are
connected to the same output layer. At each point in
a given sequence, this structure provides the network
with information about all points before and after it,
and this means that the BRNN has complete sequential
details of the sequence in each step of the computation.
Online signature verification, along with some other online tasks, requires an output after the end of the whole
sequence. Therefore it is plausible to use BRNNs to gain
improved performance on these tasks.
The main difficulty of training RNNs is to learn a
model that captures the long-term dependencies. This
problem usually appears when we are dealing with long
sequences that have dependencies between distant data
points. Intuitively it seems that the RNNs are unable
to remember the information that is embedded in previously visited distant data points. In theory, RNNs are
entirely capable of handling this problem, but unfortunately, in practice, RNNs dont seem to be able to learn
them [1, 19]. To address this issue, we use a particular kind of RNN called LSTM11 [20]. These networks
are explicitly designed to deal with the long-term dependency problem and have proven their capability of
learning long-term dependencies by showing excellent
performance on a large variety of problems.
Since the length of signature samples could be as
high as thousands of data points, even with the use
of LSTM networks the problem of long-term dependencies remains. To improve the performance we use a
technique called Attention Mechanism [16,50,52]. Intuitively the model tries to learn what to attend to based
on the input sequence and the output sequence of the
network. By doing so, each output yt of the decoder depends on a weighted combination of all the input states
instead of only relying on the last hidden state of the
network. Beside the attention mechanism, to improve
the performance of the model, we feed the input backward to the encoder. This trick has been introduced
in [46] and has shown a positive effect on the performance of the model by introducing many short-term
dependencies, making the optimization problem more
straightforward to solve.
Because of their structure, LSTM networks are more
prone to overfitting which is a result of memorizing
the training set samples. This problem will lead to a
degraded performance and the inability of the model
to generalize to new signatures. We use a regularization method called Dropout which has been introduced
10
11

Bidirectional Recurrent Neural Networks
Long Short-Term Memory

Table 2 Detailed information of configuration used to train
autoencoder.
Attribute
Initializer Function
Activation Function
Mini Batch Size
Loss Function
Optimizer
Early Stopping
Epochs

Used Value
Glorot Uniform
ReLU
128
MAPE
ADAM, α = 0.001,
β1 = 0.9, β2 = 0.999,
 = 1e−8
P atience = 10, M in∆ = 0
1000

in [14, 45] to overcome this problem. The intuition behind this approach is that if we randomly drop units
of the network with a probability of p in the training
phase, creating a somewhat sparse network, we can prevent the co-adapting of the units and as a result obtaining a model with good generalization ability.
We used an Autoencoder architecture that closely
follows the work of [4] except applying Bidirectional
LSTM with Attention Mechanism instead of Vanilla
RNN because of the previously mentioned benefits in
boosting the performance. This architecture is illustrated in Fig. 1. As for the other parameters, we used a
combination of Glorot Uniform initializer function [15],
ReLU12 activation function [34], ADAM optimizer [25],
Mini Batch Size of 128, MAPE13 loss function and
Early Stopping on loss value [38] to achieve improved
performance and training speed. The details of our configuration are illustrated in Table 2. For the training
phase, we used the preprocessed sequences which were
obtained by the previously described method from the
raw coordinate samples.
The encoder part of the trained autoencoder will be
further used to map each of the given sequences to the
fixed-length vector space.

2.3 Siamese Network
Siamese networks are a particular kind of neural networks that are made of two input fields followed by
two identical neural network called legs with shared
weights. These two-legged architecture are eventually
merged into a single layer by applying a discriminative function to the resulting output of the legs. These
networks are designed to compare two inputs, and as
a result, they are a reasonable pick when it comes to
verification tasks.
We used a Siamese Network which consisted of one
fully connected layer before and after the merge pro12
13

Rectified Linear Units
Mean Absolute Percentage Error

On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification

5

Fig. 1 Autoencoder architecture. The red rectangles show the parts that could be repeated. The dots boxes show the optional
components.

Table 3 Detailed information of configuration used to train
siamese network.
Attribute
Initializer Function
Activation Function
Mini Batch Size
Loss Function
Optimizer
Early Stopping
Epochs

Used Value
Glorot Uniform
ReLU
128
Binary Cross Entropy
ADAM, α = 0.001,
β1 = 0.9, β2 = 0.999,
 = 1e−8
P atience = 10, M in∆ = 0
1000

cedure followed by a single neuron with sigmoid activation function. The goal of this network is to calculate the probability of two inputs being in the same
class. This network enables us to make a decision in the
classification step based on the calculated probabilities
concerning different reference samples which makes our
classifier more accurate than the classic direct classification method. This architecture is depicted in Fig.
2.
To prevent the network from overfitting, we used
the Dropout method for regularization. As for the other
parameters, similar to the autoencoder, we used a combination of Glorot Uniform initializer function, ReLU
activation function, ADAM optimizer, Mini Batch Size
of 128, Binary Cross Entropy loss function and Early
Stopping on loss value to achieve improved performance
and training speed. The details of our configuration are
illustrated in Table 3. In training phase, we used the
fixed length vectors obtained from the encoder part of
the previously described autoencoder. A mean normalization method was applied before feeding the samples
to the network by calculating a mean vector from the
feature vectors of reference signatures of each subject
and subtracting it from the feature vectors of each signature of the corresponding subject independently.
In the test phase, first, we feed the extracted feature vector of the given sample with every extracted

feature vector of the reference samples of the claimed
individual to the trained siamese network and calculate
the outputs which are probabilities of them being in the
same class. Then we apply a predefined threshold to the
estimated probabilities to classify them as being in the
same category or not. Eventually, we classify a sample
as Genuine if it was classified as being in the same class
with more than a predefined number of the reference
samples of the claimed individual. Otherwise, we classify the sample as being Forged. A complete illustration
of our proposed framework is shown in Fig. 3.

3 Experiments Setup
For evaluation we used the SigWiComp2013 Japanese
[31] and GPDSsyntheticOnLineOffLineSignature [10]
datasets. Our codebase is entirely implemented using
Keras [5] library with Theano [47] as the backend. We
trained the models using a K40 GPU, and it approximately took 1 to 24 hours to finish the training, depending on different datasets and different training settings.

3.1 Datasets
In this section, we describe the attributes of the
datasets we used for the evaluation.
3.1.1 SigWiComp2013 Japanese
The SigWiComp2013 Japanese dataset contains the signatures of 31 subjects, 11 for the training set and 20
for the test set. For each subject, 42 genuine and 36
forged samples are available. This results in 462 genuine and 396 forged signatures in the training set and
840 genuine and 720 forged signatures in the test set.
Each subject in the test set has a set of twelve reference
signatures. The exact description of autoencoder and

6

Kian Ahrabian, Bagher Babaali

Fig. 2 Siamese network architecture. The red rectangles show the parts that could be repeated. The dots boxes show the
optional components.

Table 4 Detailed information on Autoencoder structure for
SigWiComp2013 Japanese dataset.
Layer
Bidirectional LSTM
(Encoder)
Dropout
Attention Mechanism
Bidirectional LSTM
(Decoder)
Dropout
Dense

Description
64 units for each direction
With probability of 0.5
Follows the work of [52]
64 units for each direction
With probability of 0.5
12 units

Table 5 Detailed information on Siamese Network structure
for SigWiComp2013 Japanese dataset.
Layer
Dense (Before Merge)
Dropout
Merge

Dense (Before Merge)
Dropout
Dense

Description
128 units
With probability of 0.5
Subtract the output of the
second leg from the output
of the first leg
128 units
With probability of 0.5
One unit with sigmoid
activation

siamese network used for this dataset are illustrated in
Table 4 and Table 5 respectively.

3.1.2 GPDSsyntheticOnLineOffLineSignature
The GPDSsyntheticOnLineOffLineSignature dataset
was built based on the procedure in [10]. It contains
the signatures of 10000 subjects. For each subject, 24
genuine and 30 forged signatures are available. For evaluation, we used two non-intersecting subsets of signatures for the training set and the test set with different
sizes combination of 150, 300, 1000 and 2000 subjects.
Each subject in the test set had a set of five reference
signatures. The exact architectures of autoencoder and
siamese network used for this network are illustrated in
Table 6 and Table 7 respectively.

Table 6 Detailed information on Autoencoder structure for
GPDSsyntheticOnLineOffLineSignature dataset.
Layer
Bidirectional LSTM
(Encoder)
Dropout
Bidirectional LSTM
(Encoder)
Dropout
Attention Mechanism
Bidirectional LSTM
(Decoder)
Dropout
Bidirectional LSTM
(Decoder)
Dropout
Dense

Description
64 units for each direction
With probability of 0.65
64 units for each direction
With probability of 0.65
Follows the work of [52]
64 units for each direction
With probability of 0.65
64 units for each direction
With probability of 0.65
12 units

Table 7 Detailed information on Siamese Network structure
for GPDSsyntheticOnLineOffLineSignature dataset.
Layer
Dense (Before Merge)
Dropout
Merge

Dense (Before Merge)
Dropout
Dense

Description
128 units
With probability of 0.5
Subtract the output of the
second leg from the output
of the first leg
128 units
With probability of 0.5
One unit with sigmoid
activation

3.2 Experiment Scenarios
We evaluated our proposed method with two somewhat
different scenarios. In the first one, for training the Autoencoder we used every available sample in the training set, forged and genuine, along with the reference
samples from the test set. For the Siamese Network, we
used the cross product of forged and genuine feature
vectors of each subject in the training set as negative
samples. As for the positive samples, we used the union
of the following sets of elements:
1. Every combination of genuine signatures of each
subject in the training set

On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification

7

Fig. 3 The complete pipeline of our proposed method. The red rectangles show the parts that could be repeated. The dots
boxes show the optional components.

8

2. Every combination of forged signatures of each subject in the training set
3. Every combination of reference signatures of each
subject in the test set
In the second scenario, to train the Autoencoder,
we only used the available samples in the training set
and dropped the reference samples from the test set.
For the Siamese Network, similar to the first scenario,
we used the cross product of forged and genuine feature
vectors of each subject in the training set as negative
samples. As for the positive samples, we used the union
of the following sets of elements:
1. Every combination of genuine signatures of each
subject in the training set
2. Every combination of forged signatures of each subject in the training set
It is essential to discuss the plausibility of using the
reference samples in the test set for the training phase.
If we consider a real-world scenario, in each of the previously mentioned use-cases every subject has some reference signatures which has been taken for future references. Hence in a real-world situation, we have access
to the reference signatures of each subject at any time.
As a result, it is entirely plausible to use the reference
signatures of the test set during the training phase.
Another relevant discussion that could be argued is
about using skilled forgery samples provided in training
set for the training process. Since our proposed framework consists of two parts in which the second part,
siamese network, need negative samples as well as positive samples in the trained phase, it is essential for our
framework to use these negative samples for training
the network. This issue could be assumed as a disadvantage compared to other methods such as DTW which
does not need skilled forgery samples to be trained.
These methods usually try to find a threshold for discriminating the positive and negative samples. However, these other methods could also benefit from these
samples in the process of fine-tuning. These samples will
allow them to achieve a more accurate threshold which
leads to producing better models. All things considered,
since obtaining the skilled forgery samples for a small
number of subjects is a feasible possibility, this problem
could be overlooked, and thus our proposed framework
could also be a viable option in a real-world situation.

3.3 t-SNE visualization
The best vector representation of samples for the task
of signature verification is the one that flawlessly discriminates between genuine and skilled forgery samples.

Kian Ahrabian, Bagher Babaali

Fig. 4 shows t-SNE plots for the genuine and forged
signatures of ten individuals in the test set of SigWiComp2013 Japanese dataset using the vectors obtained from the first layer of the siamese network. This
representation discriminates between positive and negative samples accurately for almost all of the subjects
as clearly shown in Fig. 4. Therefore, we anticipate that
using a suitable classifier an acceptable performance is
achievable.

4 Experiments Results
First, we present the results obtained on SigWiComp2013 Japanese dataset in Sect. 4.1. This is followed by discussions on the effect of attention mechanism and downsampling rate in Sect. 4.2 and Sect. 4.3,
respectively. Sect. 4.4 explains the effect of the samples lengths on the achieved result in Sect. 4.1. Then
we have the results acquired on GPDSsyntheticOnLineOffLineSignature dataset presented in Sect. 4.5. In
the end, we discuss the effect of the reference set size
in Sect. 4.6.

4.1 Results on SigWiComp2013 Japanese dataset
Table 8 shows the accuracies, false acceptance rates and
false rejection rates of our proposed method along with
the state-of-the-art techniques on previously discussed
SigWiComp2013 Japanese dataset in Sect. 3.1. Because
of the low number of subjects in this dataset, 11 for the
training set and 20 for the test set, we used the first
scenario described in Sect. 3.2 to obtain more samples
for the training phase. As shown in Table 8, our method
outperformed all of the previously proposed state-ofthe-art methods on this dataset.

4.2 Effect of Attention Mechanism
An noticeable observation in our experiments was the
effect of the attention mechanism on the performance
of the proposed framework. As shown in the Table 8,
using this technique has improved the performance of
our model significantly. This observation is aligned with
other previous use cases of this method [50, 52]. Intuitively, by applying attention mechanism, we end up
with a model that has learned to attend to the more
critical features of a given sample which is the ultimate
goal of this technique.

On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification

40
20

75

40

150

50

20

100

0

50

−20

0

−50

−40

−50

−75

−60

−100

25

0

0
−25

−20
−40
−60
−50

0

50

−50

0

50

−50 0

50

9

75
50
25
0
−25
−50
−75

−100

0

100

−50

0

50

100
200

150

40

0

100

20

50

−200

0

0

−400

−20

−50

−600

−40

−100
−100 0

100

−100

0

100

−50

0

50

75

75

50

50

25

25

0

0

−25

−25

−50

−50
−75

−75

0

50

−100 0

100

Fig. 4 t-SNE plots for genuine and forged signatures for ten individuals in the test set of SigWiComp2013 Japanese dataset
using the vectors obtained from the first layer of the siamese network. The red crosses show the forged signatures, and the
green pluses show the genuine samples.

Table 8 Comparison of the proposed method with six other state-of-the-art methods on the SigWiComp2013 Japanese
dataset [53].
Dataset

SigWiComp2013
Japanese

State-of-the-art Methods
Qatar University
Sabanci University-1
Sabanci University-2
i-vector + NAP-2
i-vector + WCCN-2
i-vector + SVM-2
Autoencoder (No Attention) + Siamese
Autoencoder + Siamese

4.3 Effect of the downsampling rate
Since downsampling reduces the size of a sample by a
factor of K, it would have a significant impact on the
processing speed of the framework. But the effect of this
method on the performance should also be considered.
Because when a downsampling is applied on a sample,
many of its data points are removed, leaving us with
a sort of summarization of the signature which might
not have all of the information stored in the original
sample. From another perspective, it is also possible to
have a boost in performance by applying this method.
Because by employing this technique we remove many
of the data points that are very similar to other data

Subjects

31

Accuracy
70.55%
72.55%
72.47%
89.06%
89.37%
91.25%
84.31%
91.35%

FAR
30.22%
27.37%
27.50%
10.97%
10.69%
8.75%
15.65%
8.60%

FRR
29.56%
27.56%
27.56%
10.89%
10.56%
8.75%
15.73%
8.70%

Table 9 Accuracies, false acceptance rates and false rejection rates with respect to different downsampling rates. These
results are on SigWiComp2013 Japanese dataset.
Sampling Rate
3
4
5
6

Accuracy
79.06%
90.29%
91.35%
78.45%

FAR
20.92%
9.71%
8.60%
21.59%

FRR
20.96%
9.71%
8.70%
21.51%

points, making the problem easier to solve. As shown
by the results in Table 9, changing the downsampling
rate could result in both a better or worse performance.
In our experiments, a downsampling rate of five gave us
the best result.

Kian Ahrabian, Bagher Babaali

30.0%

22.8%

Test Misclassification Rate (%)

19.0%
15.2%
11.4%
7.6%
3.8%
0.0%

0

2000

4000

6000

8000

10000

Train Set Length Distribution (%)

Fig. 5 Length distribution of the samples in the test set.

22.8%

25.0%
20.0%
15.0%
10.0%
5.0%
0.0%

0

2000

19.0%

6000

8000

10000

Train Writers Count

15.2%
11.4%
7.6%
3.8%
0.0%

4000

Fig. 7 Relative misclassification rate of the test samples
compared to the total available samples in the corresponding bin. Samples are put into separate bins based on their
lengths.

0

2000

4000

6000

8000

10000

Fig. 6 Length distribution of the samples in the train set.

4.4 Effect of the samples lengths
As demonstrated in Fig. 5, Fig. 6 and Fig. 7, the proposed framework perform well in situations that enough
samples with similar length are available in the train
set. Thus it can generalize well to new samples when
enough samples with a proper distribution in lengths
are provided in the train set. Another observation is
that even with a low number of very long train samples
the model has learned to model these very long samples better than the rather shorter samples. In conclusion, this framework tends to perform better in circumstances that either the samples are very long or enough
samples with similar lengths are provided in the train
set.

Test Writers Count

Test Set Length Distribution (%)

10

150

300

1000

2000

150

99.95%

99.94%

99.79%

99.83%

300

99.93%

99.93%

99.85%

99.83%

1000

99.89%

99.86%

99.76%

99.66%

2000

99.85%

99.83%

99.74%

99.69%

99.95
99.90
99.85
99.80
99.75
99.70

Fig. 8 Accuracies of the proposed method on the GPDSsyntheticOnLineOffLineSignature dataset with different sizes of
the training set and the test set.

with different sizes for the training set and test set. The
resulted accuracies of our models are illustrated in Fig.
8. Fig. 9 and Fig. 10 shows the produced false acceptance rates and false rejection rates of our proposed
method respectively.
Since our framework need some negative samples as
well as positive samples, the evaluation method used
for evaluating GPDSsyntheticOnLineOffLineSignature
dataset differs from the previously used process of evaluation for this dataset which only used reference samples of subjects for training phase. Table 10 presents the
comparison of the average EER of our proposed method
with obtained results using the techniques in [13, 42].

4.5 Results on GPDSsyntheticOnLineOffLineSignature
dataset
4.6 Effect of the reference set size
As for the previously discussed GPDSsyntheticOnLineOffLineSignature dataset, since there are many different subjects, 10000 to be exact, we used the second
scenario described in Sect. 3.2. We trained our model

Our model works well with even a low count of reference
samples, as shown by the results in Table 11. This property gives subjects and end-users a massive advantage

On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification

11

Table 10 Comparison of the proposed method with two other state-of-the-art methods on the GPDSsyntheticOnLineOffLineSignature dataset.
Dataset

State-of-the-art Methods
DTW
HMM
Autoencoder + Siamese
DTW
HMM
Autoencoder + Siamese
DTW
HMM
Autoencoder + Siamese
DTW
HMM
Autoencoder + Siamese

GPDSsyntheticOnLineOffLineSignature

Subjects
150

300

1000

2000

EER
4.59%
3.00%
0.13%
4.32%
2.53%
0.12%
5.09%
2.96%
0.21%
5.29%
2.95%
0.25%

Table 11 EERs on different test set sizes and different count of reference samples. These results are obtained on GPDSsyntheticOnLineOffLineSignature dataset with a training set size of 150.
Test Set Size

EER

150
2.50%
0.17%
0.11%
0.05%

1
3
5
7

Reference Samples
Count

300
2.17%
0.21%
0.09%
0.03%

1000
2.07%
0.24%
0.12%
0.10%

Train Writers Count

Test Writers Count

150

0.11%

300
0.11%

1000
0.3%

Train Writers Count

2000
0.33%

0.5
300

0.16%

0.15%

0.26%

0.34%

1000

0.21%

0.25%

0.35%

0.63%

2000

0.27%

0.3%

0.4%

0.59%

150

300

1000

2000

150

0.0%

0.02%

0.13%

0.04%

300

0.0%

0.01%

0.06%

0.02%

0.6

0.4
0.3
0.2

Test Writers Count

150

2000
1.90%
0.18%
0.10%
0.10%

because it requires less amount of storage and initialization. Another conclusion that could be drawn from
Table 11 is that it is possible to achieve better results
with a mid-range count of reference samples. In our
experiments, seven reference samples gave us the best
results.
5 Conclusion
In this paper, we presented a writer-independent global
feature extraction framework based on the autoencoder
models and the siamese networks for online handwritten
signature verification task. Our experiments showed the
significant effect of the usage of Attention Mechanism

0.12
0.10
0.08

1000

0.0%

0.04%

0.15%

0.09%

0.06
0.04

2000

Fig. 9 False Acceptance Rate (FAR) of the proposed method
on the GPDSsyntheticOnLineOffLineSignature dataset with
respect to different sizes of the training set and the test set.

0.14

0.04%

0.07%

0.14%

0.08%

0.02
0.00

Fig. 10 False Rejection Rate (FRR) of the proposed method
on the GPDSsyntheticOnLineOffLineSignature dataset with
respect to different sizes of the training set and the test set.

and applying Downsampling on performance of the proposed framework. Since our approach is based on the
deep models, long before running the experiments we
suspected that the performance of our method would
be more likely to be successful on bigger datasets. This
suspicion was proved to be true, as evidently shown in
Table 8 and Table 10. Nonetheless, in both datasets, our
method outperformed the state-of-the-art techniques.
Our experiments are possibly the first attempt to
use deep models on large-scale ASV tasks. Experiments
results on the GPDSsyntheticOnLineOffLineSignature
dataset showed the tremendous potent capability of
these models. Even when we had a shortage of training

12

samples while experimenting with the SigWiComp2013
Japanese dataset, our method proved to be completely
capable of achieving excellent performance by surpassing the current state-of-the-art results. This might be
the very first step toward a robust large-scale global
system for the task of automatic signature verification.
Furthermore, our future work will consist of adapting our proposed method to other online verification
tasks such as speaker verification and further explore
different deep models for online verification tasks which
perform well under the constraint of the low count of
training sample.

Conflict of Interest Statement
The authors declare that there is no conflict of interest.

References
1. Bengio, Y., Simard, P., Frasconi, P.: Learning long-term
dependencies with gradient descent is difficult. IEEE
transactions on neural networks 5(2), 157–166 (1994)
2. Bengio, Y., et al.: Learning deep architectures for ai.
Foundations and trends R in Machine Learning 2(1), 1–
127 (2009)
3. Bromley, J., Guyon, I., LeCun, Y., Säckinger, E., Shah,
R.: Signature verification using a” siamese” time delay
neural network. In: Advances in Neural Information Processing Systems, pp. 737–744 (1994)
4. Cho, K., Van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., Bengio, Y.: Learning phrase representations using rnn encoder-decoder
for statistical machine translation.
arXiv preprint
arXiv:1406.1078 (2014)
5. Chollet, F., et al.: Keras.
https://github.com/
fchollet/keras (2015)
6. Chopra, S., Hadsell, R., LeCun, Y.: Learning a similarity
metric discriminatively, with application to face verification. In: Computer Vision and Pattern Recognition,
2005. CVPR 2005. IEEE Computer Society Conference
on, vol. 1, pp. 539–546. IEEE (2005)
7. Dey, S., Dutta, A., Toledo, J.I., Ghosh, S.K., Lladós, J.,
Pal, U.: Signet: Convolutional siamese network for writer
independent offline signature verification. arXiv preprint
arXiv:1707.02131 (2017)
8. Dolfing, J., Aarts, E.H., Van Oosterhout, J.: On-line signature verification with hidden markov models. In: Pattern Recognition, 1998. Proceedings. Fourteenth International Conference on, vol. 2, pp. 1309–1312. IEEE (1998)
9. Du, W., Fang, M., Shen, M.: Siamese convolutional neural networks for authorship verification
10. Ferrer, M.A., Diaz, M., Carmona-Duarte, C., Morales,
A.: A behavioral handwriting model for static and dynamic signature synthesis. IEEE transactions on pattern analysis and machine intelligence 39(6), 1041–1053
(2017)
11. Fierrez, J., Ortega-Garcia, J., Ramos, D., GonzalezRodriguez, J.: Hmm-based on-line signature verification:
Feature extraction and signature modeling. Pattern
recognition letters 28(16), 2325–2334 (2007)

Kian Ahrabian, Bagher Babaali
12. Fierrez-Aguilar, J., Nanni, L., Lopez-Peñalba, J., OrtegaGarcia, J., Maltoni, D.: An on-line signature verification
system based on fusion of local and global information.
In: AVBPA, vol. 5, pp. 523–532. Springer (2005)
13. Fischer, A., Diaz, M., Plamondon, R., Ferrer, M.A.: Robust score normalization for dtw-based on-line signature
verification. In: Document Analysis and Recognition (ICDAR), 2015 13th International Conference on, pp. 241–
245. IEEE (2015)
14. Gal, Y., Ghahramani, Z.: A theoretically grounded application of dropout in recurrent neural networks. In:
Advances in neural information processing systems, pp.
1019–1027 (2016)
15. Glorot, X., Bengio, Y.: Understanding the difficulty of
training deep feedforward neural networks. In: Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pp. 249–256 (2010)
16. Gregor, K., Danihelka, I., Graves, A., Rezende, D.J.,
Wierstra, D.: Draw: A recurrent neural network for image
generation. arXiv preprint arXiv:1502.04623 (2015)
17. Hafemann, L.G., Sabourin, R., Oliveira, L.S.: Offline handwritten signature verification-literature review.
arXiv preprint arXiv:1507.07909 (2015)
18. Hafemann, L.G., Sabourin, R., Oliveira, L.S.: Analyzing
features learned for offline signature verification using
deep cnns. In: Pattern Recognition (ICPR), 2016 23rd
International Conference on, pp. 2989–2994. IEEE (2016)
19. Hochreiter, S., Bengio, Y., Frasconi, P., Schmidhuber, J.,
et al.: Gradient flow in recurrent nets: the difficulty of
learning long-term dependencies (2001)
20. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural computation 9(8), 1735–1780 (1997)
21. Humm, A., Hennebert, J., Ingold, R.: Gaussian mixture
models for chasm signature verification. In: International
Workshop on Machine Learning for Multimodal Interaction, pp. 102–113. Springer (2006)
22. Impedovo, D., Pirlo, G.: Automatic signature verification: The state of the art. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and
Reviews) 38(5), 609–635 (2008)
23. Jain, A.K., Griess, F.D., Connell, S.D.: On-line signature verification. Pattern recognition 35(12), 2963–2972
(2002)
24. Kholmatov, A., Yanikoglu, B.: Identity authentication
using improved online signature verification method. Pattern recognition letters 26(15), 2400–2408 (2005)
25. Kingma, D., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
26. Koch, G., Zemel, R., Salakhutdinov, R.: Siamese neural
networks for one-shot image recognition. In: ICML Deep
Learning Workshop, vol. 2 (2015)
27. Lee, L.L., Berger, T., Aviczer, E.: Reliable online human signature verification systems. IEEE Transactions
on pattern analysis and machine intelligence 18(6), 643–
647 (1996)
28. Lei, H., Govindaraju, V.: A comparative study on the
consistency of features in on-line signature verification.
Pattern Recognition Letters 26(15), 2483–2489 (2005)
29. Lejtman, D.Z., George, S.E.: On-line handwritten signature verification using wavelets and back-propagation
neural networks. In: Document Analysis and Recognition, 2001. Proceedings. Sixth International Conference
on, pp. 992–996. IEEE (2001)
30. Liu, Y., Yang, Z., Yang, L.: Online signature verification
based on dct and sparse representation. IEEE transactions on cybernetics 45(11), 2498–2511 (2015)

On Usage of Autoencoders and Siamese Networks for Online Handwritten Signature Verification
31. Malik, M.I., Liwicki, M., Alewijnse, L., Ohyama, W., Blumenstein, M., Found, B.: Icdar 2013 competitions on signature verification and writer identification for on-and
offline skilled forgeries (sigwicomp 2013). In: Document
Analysis and Recognition (ICDAR), 2013 12th International Conference on, pp. 1477–1483. IEEE (2013)
32. Martens, R., Claesen, L.: Dynamic programming optimisation for on-line signature verification. In: Document Analysis and Recognition, 1997., Proceedings of the
Fourth International Conference on, vol. 2, pp. 653–656.
IEEE (1997)
33. Miguel-Hurtado, O., Mengibar-Pozo, L., Lorenz, M.G.,
Liu-Jimenez, J.: On-line signature verification by dynamic time warping and gaussian mixture models. In: Security Technology, 2007 41st Annual IEEE International
Carnahan Conference on, pp. 23–29. IEEE (2007)
34. Nair, V., Hinton, G.E.: Rectified linear units improve restricted boltzmann machines. In: Proceedings of the 27th
international conference on machine learning (ICML-10),
pp. 807–814 (2010)
35. Nanni, L.: An advanced multi-matcher method for online signature verification featuring global features and
tokenised random numbers. Neurocomputing 69(16),
2402–2406 (2006)
36. Nanni, L.: Experimental comparison of one-class classifiers for online signature verification. Neurocomputing
69(7), 869–873 (2006)
37. Nanni, L., Lumini, A.: Ensemble of parzen window classifiers for on-line signature verification. Neurocomputing
68, 217–224 (2005)
38. Prechelt, L.: Automatic early stopping using cross validation: quantifying the criteria. Neural Networks 11(4),
761–767 (1998)
39. Richiardi, J., Drygajlo, A.: Gaussian mixture models for
on-line signature verification. In: Proceedings of the 2003
ACM SIGMM workshop on Biometrics methods and applications, pp. 115–122. ACM (2003)
40. Richiardi, J., Ketabdar, H., Drygajlo, A.: Local and
global feature selection for on-line signature verification.
In: Document Analysis and Recognition, 2005. Proceedings. Eighth International Conference on, pp. 625–629.
IEEE (2005)
41. Rúa, E.A., Castro, J.L.A.: Online signature verification
based on generative models. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics) 42(4),
1231–1242 (2012)
42. Sae-Bae, N., Memon, N.: Online signature verification
on mobile devices. IEEE Transactions on Information
Forensics and Security 9(6), 933–947 (2014)
43. SATI, Y.: On-line signature verification based on shape,
motion and handwriting pressure. In: Proc. 6th Int. Conf.
on Pattern Recognition, vol. 2, pp. 823–826 (1982)
44. Schuster, M., Paliwal, K.K.: Bidirectional recurrent neural networks. IEEE Transactions on Signal Processing
45(11), 2673–2681 (1997)
45. Srivastava, N., Hinton, G.E., Krizhevsky, A., Sutskever,
I., Salakhutdinov, R.: Dropout: a simple way to prevent
neural networks from overfitting. Journal of machine
learning research 15(1), 1929–1958 (2014)
46. Sutskever, I., Vinyals, O., Le, Q.V.: Sequence to sequence
learning with neural networks. In: Advances in neural
information processing systems, pp. 3104–3112 (2014)
47. Theano Development Team: Theano: A Python framework for fast computation of mathematical expressions.
arXiv e-prints abs/1605.02688 (2016). URL http:
//arxiv.org/abs/1605.02688

13

48. Van, B.L., Garcia-Salicetti, S., Dorizzi, B.: On using the
viterbi path along with hmm likelihood information for
online signature verification. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics) 37(5),
1237–1247 (2007)
49. Vivaracho-Pascual, C., Faundez-Zanuy, M., Pascual,
J.M.: An efficient low cost approach for on-line signature
recognition based on length normalization and fractional
distances. Pattern Recognition 42(1), 183–193 (2009)
50. Xu, K., Ba, J., Kiros, R., Cho, K., Courville, A.,
Salakhudinov, R., Zemel, R., Bengio, Y.: Show, attend
and tell: Neural image caption generation with visual attention. In: International Conference on Machine Learning, pp. 2048–2057 (2015)
51. Yang, L., Widjaja, B., Prasad, R.: Application of hidden
markov models for signature verification. Pattern recognition 28(2), 161–170 (1995)
52. Yang, Z., Yang, D., Dyer, C., He, X., Smola, A.J., Hovy,
E.H.: Hierarchical attention networks for document classification. In: HLT-NAACL, pp. 1480–1489 (2016)
53. Zeinali, H., BabaAli, B., Hadian, H.: Online signature
verification using i-vector representation. Accepted in
IET Biometrics

