A Comparative Study of In-Air Trajectories at Short and Long Distances in Online Handwriting

Existing literature about online handwriting analysis to support pathology diagnosis has taken advantage of in-air trajectories. A similar situation occurred in biometric security applications where the goal is to identify or verify an individual using his signature or handwriting. These studies do not consider the distance of the pen tip to the writing surface. This is due to the fact that current acquisition devices do not provide height formation. However, it is quite straightforward to differentiate movements at two different heights (a) short distance: height lower or equal to 1 cm above a surface of digitizer, the digitizer provides x and y coordinates; (b) long distance: height exceeding 1 cm, the only information available is a time stamp that indicates the time that a specific stroke has spent at long distance. Although short distance has been used in several papers, long distances have been ignored and will be investigated in this paper. In this paper, we will analyze a large set of databases (BIOSECUR-ID, EMOTHAW, PaHaW, OXYGEN-THERAPY, and SALT), which contain a total amount of 663 users and 17,951 files. We have specifically studied (a) the percentage of time spent on-surface, in-air at short distance, and in-air at long distance for different user profiles (pathological and healthy users) and different tasks; (b) the potential use of these signals to improve classification rates. Our experimental results reveal that long distance movements represent a very small portion of the total execution time (0.5% in the case of signatures and 10.4% for uppercase words of BIOSECUR-ID, which is the largest database). In addition, significant differences have been found in the comparison of pathological versus control group for letter “l” in PaHaW database (p = 0.0157) and crossed pentagons in SALT database (p = 0.0122).


Introduction
Speech and handwriting are probably the most difficult tasks performed by human beings, because they differentiate us from animals. Handwriting requires very fine motor skills, probably more so than speech, because some animals can imitate human sounds but no animal can write. In addition, we learn to speak first and then we learn how to read and write, when the brain is more mature.
Handwriting analysis is a good way to study the human brain in a non-invasive way. This knowledge, once acquired, can be applied to artificial systems that emulate the human brain. We consider that handwriting movements are more complex by far than what has been analyzed in the past. In fact, some parts of the movements have been neglected. With this paper, we will analyze this kind of movements, which will be defined in posterior sections as in-air at long distance. This kind of movements can be used to improve artificial intelligence for biometric applications such as health and security [1][2][3][4].
In the past, the analysis of handwriting had to be performed in an offline manner. Only the writing itself (strokes on a piece of paper) were available for analysis. Nowadays, moderncapturing devices like digitizing tablets and pens or online whiteboards can gather data without losing its temporal dimension. When spatiotemporal information is available, its analysis is referred to as online. A typical modern-digitizing tablet ( Fig. 1) not only gathers the x-y coordinates that describe the movement of the writing device as it changes its position, but it can also collect other data, mainly the pressure exerted by the writing device on the writing surface, the azimuth (the angle of the pen in the horizontal plane), and the altitude (the angle of the pen with respect to the vertical axis) (see (Fig. 2)). From now own, x-y coordinates, pressure, azimuth, and altitude will be referred to as features of the handwriting.
A very interesting aspect of the modern online analysis of handwriting is that it can consider information gathered when the writing device was not exerting pressure on the writing surface. Thus, the movements performed by the hand while writing a text can be split into two classes: 1. On-surface trajectories (pen-downs), corresponding to the movements executed while the writing device is touching the writing surface. Each of these trajectories produces a  visible stroke. We will call this kind of movement onsurface. 2. In-air trajectories (pen-ups), corresponding to the movements performed by the hand while transitioning from one stroke to the next one. During these movements, the writing device exerts no pressure on the surface. This class can be split into two subsets: a. In-air at short distances (in-air S ), when the distance from the tip of the pen to the writing surface is lower or equal to 1 cm. In this case, the digitizing device can track the (x, y) coordinates during the pen movement. b. In-air at long distances (in-air L ), when distances from the tip of the pen to the writing surface are higher than 1 cm. In this case, the digitizing device is not able to track the movements and we only know the time spent at high distance.
In our previous research, we have focused on on-surface and in-air S movements discarding in-air L movements because they do not provide the same amount of data as the previous ones. In fact, the unique parameters are just the number of strokes at long distance and time spent at long distance. For instance, in [5], we applied information theory to demonstrate that on-surface and in-air S contain almost the same amount of information and they are not redundant. This was an important milestone because in-air trajectories had received almost no attention at all, even in online approaches where spatiotemporal information is available. Figure 3 shows two examples of on-surface and in-air S trajectories taken from two executions of the pentagon test performed by two different writers from the Emothaw database.
In-air L can be detected looking at the time stamp provided by the digitizing tablet. During in-air L time, the tablet is  shows the difference of consecutive time stamps for an example file. For most of the samples (on-surface and in-air S ), this value is small (typically two units). However, there are some peaks, which correspond to in-air L movements. Figure 4 reveals 11 strokes of the type in-air L . Sometimes, this time is abnormally long. This is probably due to some acquisition problem, where the user started to speak with the database acquisition supervisor for minutes. We will label these cases and will not include them in the average computation of time spent at in-air L . We consider these cases when time in-air L is greater than 70% of the total time. In particular, we have found this phenomenon in 5 files from the analyzed databases (total amount of analyzed files is 17,951 files) (e.g. see Fig. 5).

Experimental Databases
In this paper, we have analyzed a set of different databases that contain different tasks and user profiles. The databases share the existence of handwritten tasks. In this section, we will summarize the main characteristics of the analyzed databases.

BIOSECUR-ID
This database is a multimodal biometric one and includes eight biometric traits: speech, iris, face (still images and videos), handwritten signature and handwritten text, fingerprints, hand, and keystroking. This database acquired inside the Biosecur-ID project was developed by a consortium of six Spanish Universities, more details can be found in [6]. With respect to handwriting and signatures, this database defines five different tasks: a Spanish text in lower-case, ten digits written separately, 16 Spanish words in upper-case, four genuine signatures, and one forgery of the three precedent subjects.

EMOTHAW
As described in [7], this database includes samples of 129 participants who are classified on the basis of their emotional states: anxiety, depression, and stress or health. This classification is assessed by the Depression-Anxiety-Stress Scales (DASS) questionnaire. Seven tasks are recorded through a digitizing tablet: pentagons and house drawing, words in capital letters copied in handprint, circles with left and right hand, clock drawing, and one sentence copied in cursive writing.

PAHAW
The Parkinson's Disease Handwriting Database (PaHaW) consists of multiple handwriting samples from 37 Parkinson's disease patients, and 38 gender and age matched controls. Eight different tasks were recorded through a digitizing tablet: spiral drawing, letters, words, and a sentence. The details about this database can be found in [8].

OXIGEN-THERAPY
This database described in [9] includes eight patients with hypoxemia who performed two tasks: house and clock drawing, before and after breathing 30 min with O 2 with the aim of evaluating changes in psychomotor functions.

Experimental Results
The first experiments consisted of analyzing the three kinds of time in absolute and relative values as well as the number of strokes in all the scenarios. Tables 1, 2, 3, 4, and 5 summarize the results for the analyzed databases. It is worth remarking that different databases contain different tasks described in the previous section. For a given user, the number of strokes is an integer number. However, the table shows the average number of strokes  T S time on-surface, T AS time in-air S , T AL time in-air L , Strokes S strokes on-surface, Strokes AS strokes in-air s , Strokes AL strokes in-air L for a specific database and task (in addition to the number of strokes done by the whole set of users split by the number of users). This number is not integer anymore. Experimental results of BIOSECUR-ID database, which is the largest one according to the number of users and files, reveal that in-air L is almost negligible in the case of signatures, but interestingly, it is three times larger for skilled forgeries than for genuine signatures. For uppercase words, the time in-air L is larger than for the other tasks but still quite modest (10.4%). Thus, this kind of movement is less important than the other two and can probably be ignored without sacrificing a lot of information. For the other databases, a statistical test will be performed after presenting the experimental results.
From all the databases related to diseases, we computed the Mann-Whitney U test between study and control groups to determine the existence of statistically significant difference (p < 0.05) in the studied features (time and strokes). The results are shown in Table 6.
We can observe in Table 6 (a. Depression/control) how in crossed pentagon task, the values are very close to the threshold for long distance time and strokes. In house draw, the near time and on-surface strokes show statistical significance. In Table 6 (b. Anxiety/control), house draw shows again that near-distance time is statistically signficant. Finally, in Table 6 (c. Stress/control), we obtain p < 0.05 for on-surface time in clock draw only.
As is shown in Table 7, for PaHaW database we obtain statistically significant results in letter l long distance time and in bigram le for near-distance time and on-surface strokes.
In OXYGEN THERAPY database, the times and number of strokes do not show statistical significance and do not seem to offer a valid classification pattern between pre-and post-O 2 results (Table 8).
In Table 9 (SALT, a. Alzheimer/control), we can observe how on crossed pentagons draw, statistical significance can be found in on-surface time and long distance time. Also, onsurface time presents significance on the sentence copied. No results with p < 0.05 were obtained for mild cognitive impairment (MCI)/control (Table 9, b).

Discussion
Although most of the results in previous tables are not significant, even for on-surface and in-air S information, we should  T S time on-surface, T AS time in-air S , T AL time in-air L , Strokes S strokes on-surface, Strokes AS strokes in-air s , Strokes AL strokes in-air L point out that this kind of measurements offers a large set of features that can be extracted, such as speed and acceleration of trajectories and complexity measurements extracted from coordinates x, y. In fact, a classifier would not be based on a single measurement. It will take advantage of a set of measurements. Thus, high p values for on-surface and in-air S do not imply the impossibility to perform a classification. These values are provided just for comparison purpose with in-air L values. In-air L extracted features are limited to time and number of strokes. Thus, the analysis of relevance of this information is simpler. Nevertheless, this paper points out the tasks and pathologies where more potential improvements can be achieved, because in some tasks, p < 0.05 has been obtained.
Looking at the experimental results of pathologies, we can establish that in-air L movements are not relevant but there are some exceptions: crossed pentagon task for depression patients in EMOTHAW, which is near significance (p = 0.0589 for time and p = 0.0561 for strokes), letter l task for PaHaW database (p = 0.0157 for time), and crossed pentagons task for Alzheimer/control comparison (p = 0.0122 for time). We consider these results especially interesting because crossed pentagons are a very useful measurement in pathological analysis, in fact, it is the only drawing that subjects must perform in the well-established mini-mental state examination, also known as the Folstein test [11].

Conclusions
One of the main goals of this paper was to study if in-air L information can be discarded in handwritten tasks analysis. Looking at the experimental results, we can conclude that little time is spent by healthy writers at long distance so most of the information is contained on-surface and in-air S distances. This implies that the development of a new acquisition device able to track x and y coordinates and long distances will probably not be very useful, because few samples will be acquired in this condition. However, experimental results reveal that time spent at long distance is more than three times higher for skilled forgeries than for genuine signatures. This opens a possible research line in security biometrics. A similar consideration can be established for the number of strokes, which is doubled in the case of skilled forgeries with respect to short distance in-air movements. Thus, the existence of long distance movements can be indicative of a signature forgery.
On the other hand, when looking at pathologies, we have found statistically significant differences in the pentagon tasks for Alzheimer/control comparison. This result opens the possibility of investigating in-air at long distance movements further.