Analysis of Handwriting Velocity to Identify Handwriting Process from Electromyographic Signals

: Problem statement: Handwriting movement is one of the most complex activities of human motions. It’s a blend of kinesthetic, cognitive, perceptual and motor components. The study of this biological process shows that a bell-shaped velocity profiles are generally observed in the handwriting motion. We, therefore, assume that the handwriting speed has an important role in control and generation of this human process and that the control nervous system might take this information into account to reconstruct the pen-tip trace. The Electromyography (EMG) signals measured on the skin surface of a writing forearm contain the adequate information to present the motor commands of the handwriting process. Approach: In this study, an identification technique, based on Recursive Least Square algorithm (RLS), is proposed to identify the pen-tip movement in human handwriting process, by using input and output data which present EMG signals and velocities according to x and y coordinates. Results: The proposed approach of handwriting identification indicates that the pen-tip movement can be reconstruct from EMG signals of forearm muscles. The obtained results show better concordance with the experimental data than results obtained from other approach elaborated in the literature. Conclusion: The proposed handwriting model shows generally, good agreement with the real pen-tip movement. This method should be refined in monowriter and multiwriter case and independently of the size or the direction of the writing shape.


INTRODUCTION
The recognation of humain handwriting has attracted the attention of many investigators (Shalabi et al., 2005;Al-Omari et al., 2009), but the modeling of this complex biological process has attracted the interest of fewer researches.
The global generalized handwriting model, proposed in (Benrejeb et al., 2006), proved that the pen-tip position is detected by the means of the eyes and transmitted to the brain to be analyzed and compared with the desired position. Finally, a motor execution order is sent to the arm and the hand to perform the desired movement on the writing surface.
Handwriting speed has attracted the attention of other investigators who considered it as a means of distinguishing between the writing of one person and that of another. They proved that the handwriting speed is a fundamental characteristic for modeling the handwriting system. Plamondon confirmed that the velocity profiles of this process are approximately bell shaped (Plamondon, 1993;Boubaker et al., 2006) another method, based on beta-elliptical model for characterizing the velocity profile on line, was used. Other models based on the velocity profile were presented in (Plamondon, 1995a;1995b).
The experimental approach, presented in (Benrejeb et al., 2006), allows recording some cursive Arabic letters and basic geometric forms, the pressure of the pen tip on the writing surface and EMG signals, saved during the act of writing. This study is interested in the structural and parametric identification of the handwriting velocity using this experimental basis.
After a general introduction of the handwriting system, a description of a measuring device that allows obtaining an experimental basis used for modeling the handwriting system, will be presented. The identification of the bell-shaped velocity profile relative to the handwriting movement, is developped. Then simulation's results are applied to different Arabic letters and simple geometrical forms relative to many writers. A conclusion of this research is presented finally.

MATERIALS AND METHODS
Problem statement: Van Der Gon is the first to consider writing as the result of the wrist joints and fingers. He defined two degrees of freedom for this process (Gon et al., 1962). The first corresponds to the simultaneous flexion-extension of all joints of fingers. The second degree of freedom corresponds to the rotation of the hand around the wrist.
The study of handwriting movement according to (x, y) plane shows that this last one is mainly based on the interconnection of the electromyographic activity of four muscles of the forearm. Those responsible for the vertical movement are the "flexor digitorum superficialis" and the "extensor digitorum communis" and those responsible for the horizontal movement are the "abductor pollicis longus" and the "extensor carpi ulnaris" (Benrejeb et al., 2006).
To characterize this biological process, an experimental study has been carried out in (Benrejeb et al., 2006). In this experience, surface electrodes are used to record the positions of the pen-tip in (x, y) plane, the pressure exerted by the pen-tip on the writing digital table and EMG signals of two forearm muscles during the time of writing.
All individuals have preferred movement's directions. These preferences influence the production of the graphic form. (Meulenbroek and Thomassen, 1991), proved that there is a preference to produce vertical traces, from up to down and horizontal traces to the right, for the Latin script and to the left, for the Arabic script. He also showed that vertical lines are faster and more accurate than horizontal lines.
In order to build an experimental basis, students from Hiroshima City University wrote three Arabic letters and eight basic geometric forms, Table 1 (Benrejeb et al., 2006). These Japanese students are aged between twenty-two and twenty-three years. It is important to note that when writer had to produce lines or shapes in no preferred directions the performance was less precise and more instable. The handwriting velocity increases in the less curved form and decreases in the most curved. For this, a variety of shapes is proposed to constitute the experimental basis. They write horizontal, vertical, complexes, rapid and slow movements.
EMG waveforms present transient phenomena and disruptive signals resulting from various sources, such as electromagnetic phenomenon sector and noise associated with electrodes and uncertainties of measures. A variety of signal processing techniques are used to make EMG waveforms easier to interpret. The fluctuation of EMG's magnitudes of pen-tip movements can be filtered by rectifying technique to obtain new curves called Integrated EMG (IEMG). In this study, the considered signals will be used with velocities of the handwriting movement according to x and y axes to identify this biological phenomenon (Benrejeb et al., 2006).

Correspondence between trajectory and speed of the pen-tip:
In order to prove the invariance of these profiles which occurs as bell-shaped, the velocity profiles relative to different measurements of pen-tip displacements are presentes to prove the invariance of these profiles which occurs as bell-shaped. The correspondence between the velocity profile, V (k), represented by Eq. 1 and the trajectory of the pen-tip according to x and y axes is then analyzed.
The velocity of pen-tip movement is calculated as follow:  (Benrejeb et al., 2006) With: V = Pen-tip speed V x ,V y = Pen-tip speeds according to x and y axis respectively x, y = Pen-tip displacement according to x and y axis respectively t (k) = Time of handwriting movement This study requires, initially an analysis of velocity profiles of simple movements according to x and y axix, Eq. 2 and 3, the same analysis is presented in the case of geometric shapes and finally in the case of cursive Arabic letters.
An example of experimental recordings of the Arabic letter "HA" is shown in Fig. 1. This figure shows the Pentip movements according to x and y directions, Fig. 1a, electromyographic signals of the forearm muscle, EMG 1 and EMG 2 , recorded during the handwriting process and the Integrated EMG signals, IEMG 1 and IEMG 2 , Fig. 1b.

Case of simple movements:
The considered movements that are proposed for this study are vertical and horizontal lines in Fig. 2a and c. These traces present movements of go and back of the pen-tip according to (x, y) plane. The velocity profiles of these movements are shown in Fig. 2b and d.
The first form to study is a horizontal line relative to go and back movement (left/right/left). Figure 2b shows that the handwriting velocity presents two separate bells shapes with different amplitudes and nearly equal during. The first bell shape is the result of left/right movement while the second bell is relative to the right/left movement. The velocity is equal to zero at the beginning, the end of the movement and when the x movement changes direction.
The second displacement is a vertical go and back movement. In Fig. 2d, two bell shapes are shown. The first one is relative to the down/up movement and the second one to the up/down movement. These bell shapes have almost the same amplitudes and different during and show that in the beginning and the end of the movement and in the y movement direction's change the velocity is zero.

Case of simple geometric movements:
The experimental basis, presented previously allows the study of two simples graphic forms namely "circle" and "triangle", Fig. 3a and c. The Fig. 3b shows that the velocity shape of the geometric form "circle" corresponds to a superposition of bell-shapes and the velocity profile of the geometric form "triangle" includes three bell shapes corresponding to the three segments of the triangle, Fig. 3d.

Case of Arabic letters:
The velocity profile of the Arabic letter "SIN" is shown in Fig. 4.
The handwriting speed of "SIN" has three main areas, different in durations and amplitudes, formed by a superposition of bell-shaped forms and corresponding to three primitives of the considered letter: two small half circles and a largest third one.
The velocity of handwriting trajectory shows some successions of maxima. Zero value indicates the begin, the end and the change of movement direction. In sum, the characteristic of the letter "AYN" allows to determine two areas formed by a superposition of bellshaped forms corresponding to the two existing primitives of the letter, consisting of two half of circles.
Therefore, the writing speed can be interpreted as a superposition of bells distributed by area with different durations and amplitudes. Each zone corresponds to a primitive of the written letter. Proposed handwriting velocity model: Parametric identification is an experimental approach of determining parameters of a mathematical model of a given process to generate output response as close as possible to the real system. This technique is based on the prediction error, which is the error between the output of the process and the output predicted by the model. In order to minimize the prediction error, the model parameters are modified at each sampling time by using an algorithm estimating the model parameters. In the literature several recursive and not-recursive algorithms are presented. The first type of algorithm has the advantage to be executed on real time and requires less memory resources in terms of calculations.
After the proposition of the handwriting model's structure, the recursive least square algorithm is used to identify the handwriting process, using velocity information, (Apley and Shi, 1999).

Proposed model:
The proposed mathematical model characterizing the handwriting velocity is a fourth order model inputsuofudelayed x and y velocities, V x and V y at k-1, k-2, k-3and k-4 instants, in addition to inputs related to EMG signals delayed at k, k-1, k-2 and k-3.
The outputs are V x and V y , which are calculated by the Eq. 2 and 3 at k instant, Fig. 5.
Eq. 4 and 5 characterize the proposed human handwriting velocity model: With: V ex ,V ye = Outputs vectors, relative to estimated velocities according to x and y movements respectively e 1 = EMG 1 signal e 2 = EMG 2 signal a ix ,b ix ,c ix, d ix x = Parameters relative to the estimated velocities V ex and V ye respectively a iy, b iy ,c iy ,d iy = Parameters relative to the estimated velocity k = Discrete time Identification technique: Starting from the mathematical structure proposed by the Eq. 4 and 5, the Recursive Least Squares algorithm (RLS) is used for the handwriting speed process identification (Chihi et al., 2011). Litterature presents several identification's technics, (Alabi et al., 2008). RLS identification technique is the must used, (Zermani et al., 2011;Gamoudi et al., 2008;Xion et al., 2007) istablesh form the developpement of the Eq. 6-8 and it offers a good convergence rate, especially for highly correlated input signals. The efficiency of this algorithm in terms of convergence rate, tracking and stability depends on the forgetting factor. In this study, we chose a fixed forgetting factor, equal, in this work, to 0.95. RLS algorithm performs the following operations to update the parameters of the researched model, (Tutunji et al., 2007): With: ˆ( k) θ = Vector of estimated parameters P (k) = Adaptation matrix Y (k) = Actual output of the system to identify ψ (k) = Observation matrix ε (k) = Estimated error The model structure used to identify the handwriting system dynamics for multi-inputs-multioutputs is given as follows: T ye y y y V = ψ θ + ε (10) ε x and ε y = Error vectors, relative to the velocities according to x and y movements respectively T x ψ and T y ψ = Matrices whish elements are the delayed inputs and outputs components, relative to the velocities according to x and y movements respectively: The outputs of the proposed velocityhand writing process depend on the estimation vector, errors according to x andd y displacement and the matrices of the delayed inputs and outputs, Eq. 9-16: ye ye T (k) y e (k) e (k 1) 1 1 e (k 2) e (k 3) 1 1 e (k) e (k 1) 2 2 e (k 2) e (k 3) 2 2 Variations of parameters in time show that they converge to constant values, characterizing the studied handwriting model, Fig. 6 and 7.
Using the estimated parameter's values, the new proposed handwriting speed model is as follows: The estimated parameters of velocities vectors x θ and ŷ θ accoding to x and y movements, respectively, will take the following forms: a a a b b b b c  1y 2y 3y 4y 1y 2y 3y 4y 1ŷ yˆˆˆˆĉ c c c d d d d d 5y 5y 2y 3y 4y 1y 2y 3y 4y With: ix, ix, ix, ix,â b c d = Estimated parameters relative to the estimated Velocities V ex and V ye respectively iy, iy, iy, iy,â b c d = Estimated parameters relative to the estimated velocity i = 1, 2, 3 or 4 Eq. 13 and 14 present a new linear, fourth order equation that can mimic the pen-tip moving on (x, y) plane. Figure 8 shows some examples of the comparison between the real trajectory of handwriting speed and the reconstructed speed trajectory with the same starting point. In addition, good concordances between the saved letters and the letters obtained from the proposed model are shown. The solid line presents the recorded experimental data and the dotted line is relative to the answer given by the estimated parameters of the obtained model. The first one is a prediction of the pen-tip trajectories in the case of monowriter. This means, integrating parameters of a model characterizing a letter or a geometric form with data saved from another example of the same type of drawing trace and of the same writer.

RESULTS
The second is a prediction in multiwriter case. We applied the experimental recorded input data of an Arabic letter or a basic geometric form for a first writer with parameters of another model characterizing the same pen-tip trace of a second writer.
Validation of the proposed handwriting speed model: Monowriter case: Recorded data relative to one model of graphic trace are here applied to different models for the same writer and the same type of the trace. Figure 9 shows the predicted results of pen-tip speeds relative to x and y axis and trajectories for monowriter validation.
Compatibility between the prediction results of pen-tip speed and the experimental data are shown in Fig. 9. Dotted lines denote recorded results and solid lines represent predicted ones. Consequently, for many types of Arabic letters and geometric drawing by the same writer, our proposed model confirms the possibility of direct prediction on handwriting speeds and traces from EMG signals.

Multiwriter case:
The aim multiwriter validation is to propose one model for the same types of trace but for two different writers. This is obtained by applying EMG data recorded for a trace written by writer1 into a model of the same type of drawing relative to a writer2.
Predicted velocity profiles and pen-tip trajectories are shown in Fig. 10, which illustrate an agreement with experimental data in the case of geometric drawing and Arabic letter.
Hence, for many kinds of traces (Arabic letter or geometric forms), the proposed model can reconstruct pen-tip traces, from handwriting speed and EMG forms, with a not negligible error. This depends necessarily on the trace's form, the hand writer's speed and the writers. Indeed the same individual can have different handwriting velocities and evidently these velocities differ from one person to another. Kosaku et al. (2005), a new model is proposed to characterize the pen-tip speeds in handwriting motion. Mathematically, this model is linear, the number of EMG signals is increased from two to four and the order of the system is increased from three to ten. In this process, the system identification method is changed from the Recursive Least Square method to the correlation method, Eq. 17 and 18.

DISCUSSION
The proposed linear model based on the difference equations of observed input/output signals is expressed by the following formulas:  Figure 11 shows the predicted results of the pen-tip trace for the Arabic letter "HA" in one writer's data. The predicted results don't agree with the experimental data. Figure 12 shows an example of modeling by one writer's data and simulation results by the other writers' data, (Kosaku et al., 2005).
The model proposed by Kosaku, shows not a satisfactory concordance in the case of the same writer. In the case of different writer, an important error is observed in the case of some Arabic letters. Validity's results can't reconstruct the pen-tip traces by EMG signals.
In conclusion, our proposed handwriting model, based on the relationship between EMG signals and velocity of the pen-tip moving in (x, y) plane, shows quantitative compatibility in the case of the same writer and the same graphic trace. Contrary to the validities results obtained in (Kosaku et al., 2005), a good agreement is also shown in the case of different writer's validities and the same type of the Arabic letter or the geometric form.

CONCLUSION
In this study, the bell shapes shown in the handwriting velocity profile can contain information about the kind of the pen-tip movement. Indeed, a handwriting system is proposed by using of parametric identification technique based on the Recursive Least Square algorithm. The obtained model uses mainly the relationship between the electromyographic signals of the forearm muscles and the velocity profile of the pentip moving in (x, y) plane.
According to the results shown in this study, compatibility is observed in the case of the same writer and the same character. The proposed handwriting speed model can reconstruct the graphic trace for several Arabic letters and shapes written by the same or different writers, with a not negligible error.
An improvement of the predicted model results must be made not only in the monowriter case but also in the multiwriter case.