Handwriting recognition and judgment method and system based on knowledge transfer learning
By collecting and analyzing multiple handwriting data, calculating comprehensive indicators and feature indexes, the problem of poor identification results in the existing technology is solved, and more accurate and reliable handwriting recognition and authenticity judgment are achieved.
Patent Information
- Application Number
- CN202411781343.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing handwriting recognition technology is difficult to effectively adapt to the changes in different writing strokes and writing angles, and lacks the ability to transfer knowledge, resulting in poor recognition results.
By collecting multiple data of handwriting samples, a plane rectangular coordinate system is established, comprehensive indicators such as curvature, average curvature, vector angle, total length of handwriting, average acceleration, handwriting generation rate, pressure value and pressure variance are calculated, and the handwriting feature index and the writer's identity authenticity score are calculated.
It improves the accuracy and reliability of handwriting recognition, can more effectively judge the authenticity of handwriting, and prevent forgery.
Smart Images

Figure CN119649390A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of handwriting recognition, and in particular to a handwriting recognition judgment method and system based on knowledge transfer learning. Background Art
[0002] In the field of handwriting recognition, accurate identification of the authenticity of handwriting has always been an important requirement. With the development of the digital age, the security of various electronic document signatures has attracted much attention, and accurate analysis of handwriting has become particularly critical. However, due to the huge differences in writing styles and the fact that the writing process is affected by many factors, such as writing tools, writing speed, writing pressure, etc., handwriting recognition faces many challenges.
[0003] In the prior art, some handwriting recognition methods mainly analyze and judge by extracting the stroke shape, writing speed, writing pressure, etc. of the handwriting. For example, the stroke shape is determined by processing the handwriting image and analyzing the outline of the stroke.
[0004] However, existing handwriting recognition technology still has some shortcomings. Different writing strokes and writing angles will lead to large differences in handwriting features, and existing methods are difficult to fully adapt to such changes. When processing handwriting data from different sources, traditional methods lack effective knowledge transfer capabilities and cannot fully utilize existing handwriting knowledge to improve the recognition effect of new tasks. Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] In view of the deficiencies in the prior art, the present invention provides a handwriting recognition and judgment method and system based on knowledge transfer learning, which collects multiple data of handwriting samples; establishes a plane rectangular coordinate system, calculates the curvature and the average curvature, and compares them with a preset threshold to determine the stroke category; calculates the vector angle and the angle average; calculates the total length of the handwriting, the average acceleration and the handwriting generation rate, and then calculates the comprehensive index; calculates the average pressure value and the pressure variance respectively, and then calculates the comprehensive pressure index, and calculates the handwriting feature index and the writer's identity authenticity score based on this; further calculates the writer's identity authenticity score average and the score standard deviation, and obtains the handwriting authenticity index threshold; calculates the writer's identity authenticity score to be determined, and compares it with the handwriting authenticity index threshold to determine the handwriting authenticity; solves the problems of poor knowledge transfer effect and inaccurate judgment.
[0007] (II) Technical solution
[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions: a handwriting recognition and judgment method based on knowledge transfer learning, comprising:
[0009] Step 1: Collect real handwriting sample data and handwriting sample data to be determined;
[0010] Step 2: Establish a plane rectangular coordinate system based on the real handwriting sample data, and obtain the stroke contour coordinates (x t ,y t ), and calculate the curvature K of the stroke contour t ; Based on curvature K t Calculate the mean curvature K avg ; Preset the mean curvature threshold and set the mean curvature K avg Compare with the average curvature threshold, determine the stroke category based on the result, and count the number of strokes in each category and the total number of strokes NR;
[0011] Step 3: Based on the plane rectangular coordinate system, obtain the coordinates of the pen tip at different times (x i ,y i ); Based on the pen tip coordinates at different times (x i ,y i ), calculate the vector Further obtain the vector angle θ between two adjacent vectors i ; Based on the vector angle θ between two adjacent vectors i , calculate the average angle θ avg ; Based on the real handwriting sample data, calculate the total handwriting length L and the average acceleration a respectively avg ; According to the total length of the handwriting L and the average acceleration a avg , calculate the handwriting generation rate V; according to the average curvature K avg , angle average value θ avg and handwriting generation rate V, calculate the comprehensive index IC;
[0012] Step 4: Calculate the average pressure value P based on the real handwriting sample data avg ; According to the real handwriting sample data and the average pressure value P avg , calculate the pressure variance S 2 ; According to the total length of handwriting L, handwriting generation rate V, average pressure value P avg and pressure variance S 2 , calculate the comprehensive pressure index I;
[0013] Step 5: According to the total number of strokes in each stroke category NR, the straight line stroke combination ratio RS, the curved line stroke combination ratio RD and the broken line stroke combination ratio RV are calculated respectively; according to the straight line stroke combination ratio RS, the curved line stroke combination ratio RD and the broken line stroke combination ratio RV, the handwriting complexity index ZA is calculated; according to the handwriting generation rate V, the handwriting complexity index ZA and the average pressure value P avg , calculate the handwriting characteristic index SI;
[0014] Step 6: Calculate the writer's identity authenticity score LE based on the handwriting feature index SI, the comprehensive index IC and the comprehensive pressure index I; after obtaining multiple writer's identity authenticity scores LE based on the real handwriting sample data, calculate the average writer's identity authenticity score LE avg , and further obtain the scoring standard deviation σ; according to the writer's identity authenticity scoring average LE avg and the scoring standard deviation σ, we get the handwriting authenticity index threshold LEZ;
[0015] Step 7: Calculate the identity authenticity score CN of the writer to be determined based on the handwriting sample data to be determined, compare the identity authenticity score CN with the handwriting authenticity index threshold LEZ, and determine whether the handwriting is authentic based on the result.
[0016] In the preferred embodiment of the handwriting recognition and judgment method based on knowledge transfer learning, the method of establishing a plane rectangular coordinate system is:
[0017] The lower left corner vertex of the writing plane when collecting real handwriting sample data is taken as the origin (0, 0), the two mutually perpendicular sides are taken as the coordinate axis directions, the horizontal right direction is taken as the positive direction of the x-axis, and the vertical upward direction is taken as the positive direction of the y-axis, so as to establish a plane rectangular coordinate system.
[0018] In the preferred embodiment of the handwriting recognition and judgment method based on knowledge transfer learning, the method for judging the stroke category is:
[0019] Based on the plane rectangular coordinate system, the stroke contour coordinates (x t ,y t );
[0020] Based on the stroke outline coordinates (x t ,y t ), calculate the curvature K t , the formula based on is:
[0021]
[0022] Among them, Q(x t ,y t ) is the coordinate (x t ,y t ) at the first-order derivative; P(x t ,y t ) is the coordinate (x t ,y t ) at the second-order derivative; (x t ,y t ) is the coordinate of the tth point on the stroke contour;
[0023] Based on the curvature K t, calculate the mean curvature K avg , the calculation formula is:
[0024]
[0025] Among them, K t is the curvature of the tth point on the stroke contour, the value of t is [1, n], n is the total number of points on the stroke contour, and the value is a positive integer;
[0026] Preset mean curvature threshold;
[0027] The average curvature threshold includes an average curvature threshold 1 K1 and an average curvature threshold 2 K2;
[0028] When K avg When ≤K1, it is judged as a straight stroke;
[0029] When K1 <K avg When ≤K2, it is judged as a curved stroke;
[0030] When K avg >K2, it is judged as a broken line stroke;
[0031] Count the number of straight line strokes NL, the number of curved line strokes NM, the number of broken line strokes NC and the total number of strokes NR.
[0032] In the preferred embodiment of the handwriting recognition method based on knowledge transfer learning, the angle average value θ is calculated. avg The method is:
[0033] Based on the plane rectangular coordinate system, obtain the pen tip coordinates (x i ,y i );
[0034] Calculate the pen tip coordinates (x i ,y i ) and the pen tip coordinates (x i+1 ,y i+1 ) The formula is:
[0035]
[0036] Among them, x i is the x coordinate of the pen tip at the ith moment; y i is the y coordinate of the pen tip at the i-th moment; x i+1 is the x coordinate of the pen tip at the i+1th moment; y i+1 The y coordinate of the pen tip at the i+1th moment;
[0037] Vector-based Calculate the vector angle θ between two adjacent vectorsi , the formula based on is:
[0038]
[0039] in, It means (x i ,y i ) and (x i+1 ,y i+1 ) between the vectors; It means (x i+1 ,y i+1 ) and (x i+2 ,y i+2 ) between the vectors; It means (x i ,y i ) and (x i+1 ,y i+1 ) between the vectors; It means (x i+1 ,y i+1 ) and (x i+2 ,y i+2 ) between the vectors;
[0040] Based on the vector angle θ between two adjacent vectors i , calculate the average angle θ avg , the calculation formula is:
[0041]
[0042] Among them, θ i is the angle of the pen tip at the i-th moment, and the value of i is [1, m]; m is the total number of moments, and its value is a positive integer.
[0043] In the preferred embodiment of the handwriting recognition and judgment method based on knowledge transfer learning, the method for calculating the comprehensive index IC is:
[0044] The real handwriting sample data also includes the pen tip acceleration a k ;
[0045] According to (x i ,y i ) and (x i+1 ,y i+1 ), calculate the total length of the handwriting L, the calculation formula is:
[0046]
[0047] Based on the pen tip acceleration a k , calculate the average acceleration a avg , the calculation formula is:
[0048]
[0049] Among them, a k is the acceleration at the kth time interval, k is in the range [1, N]; N is the number of time intervals, which is a positive integer;
[0050] According to the total length L of the handwriting and the average acceleration a avg , calculate the handwriting generation rate V, the calculation formula is:
[0051]
[0052] Where, t is the total writing time;
[0053] According to the mean curvature K avg , angle average value θ avg and handwriting generation rate V, calculate the comprehensive index IC, the formula based on which is:
[0054] IC=μ×K avg +ε×θ avg +∈×V
[0055] Where μ is the mean curvature K avg The weight coefficient is 0.1 to 0.3; ε is the average angle θ avg , which takes a value of 0.3 to 0.4; ∈ is the weight coefficient of the handwriting generation rate V, which takes a value of 0.3 to 0.5; and μ+ε+∈=1.
[0056] In the preferred embodiment of the handwriting recognition and judgment method based on knowledge transfer learning, the method for calculating the comprehensive pressure index I is:
[0057] The real handwriting sample data also includes the writing pressure value P i ;
[0058] Based on the writing pressure value P i , calculate the average pressure value P avg , the calculation formula is:
[0059]
[0060] Among them, P i is the writing pressure value of the pen tip at the i-th moment;
[0061] According to the writing pressure value P i and the average pressure value P avg , calculate the pressure variance S 2 , the calculation formula is:
[0062]
[0063] According to the total length of handwriting L, handwriting generation rate V, average pressure value P avg and pressure variance S 2 , calculate the comprehensive pressure index I, the calculation formula is:
[0064]
[0065] Among them, α is the average pressure value P avg The weight coefficient is 0.1 to 0.4; β is the pressure variance S 2 The weight coefficient is 0.2~0.5; γ is The weight coefficient is between 0.3 and 0.4, and α+β+γ=1.
[0066] In the preferred embodiment of the handwriting recognition method based on knowledge transfer learning, the method for calculating the handwriting characteristic index SI is:
[0067] According to the number of straight strokes NL, the number of curved strokes NM, the number of broken line strokes NC and the total number of strokes NR, the straight stroke combination ratio RS, the curved stroke combination ratio RD and the broken line stroke combination ratio RV are calculated respectively, and the calculation formulas are:
[0068]
[0069] According to the straight line stroke combination ratio RS, the curve stroke combination ratio RD and the broken line stroke combination ratio RV, the handwriting complexity index ZA is calculated using the following formula:
[0070] ZA=a1×RS+a2×RD+a3×RV
[0071] Wherein, a1 is the weight coefficient of the straight stroke combination ratio RS, and its value is 0.3-0.5; a2 is the weight coefficient of the curved stroke combination ratio RD, and its value is 0.2-0.5; a3 is the weight coefficient of the broken line stroke combination ratio RV, and its value is 0.2-0.4; and a1+a2+a3=1;
[0072] According to the handwriting generation rate V, handwriting complexity index ZA and average pressure value P avg , the handwriting characteristic index SI is calculated based on the formula:
[0073] SI=ω1×V+ω2×ZA+ω3×P avg
[0074] Among them, ω1 is the weight coefficient of the note generation rate V, which is 0.2-0.4; ω2 is the weight coefficient of the handwriting complexity index ZA, which is 0.3-0.5; ω3 is the average pressure value P avgThe weight coefficient is between 0.1 and 0.5, and ω1+ω2+ω3=1.
[0075] In the preferred embodiment of the handwriting recognition method based on knowledge transfer learning, the method for calculating the handwriting authenticity index threshold LEZ is:
[0076] According to the handwriting feature index SI, the comprehensive index IC and the comprehensive pressure index I, the writer's identity authenticity score LE is calculated. The calculation formula is:
[0077]
[0078] Among them, ρ is the adjustment coefficient of the handwriting characteristic index SI; It is the adjustment coefficient of the comprehensive indicator IC;
[0079] After obtaining multiple writer's identity authenticity scores LE based on real handwriting sample data, calculate the average writer's identity authenticity score LE avg , the calculation formula is:
[0080]
[0081] Among them, LE b is the b-th writer’s identity authenticity score, and the value of b is [1, M]; M is the total number of times the writer’s identity authenticity score is obtained, and the value is a positive integer;
[0082] Score LE based on the authenticity of the writer b and the average LE of the writer's identity authenticity score avg , calculate the score standard deviation σ, the calculation formula is:
[0083]
[0084] According to the writer's authenticity score, the average LE avg And the scoring standard deviation σ, calculate the handwriting authenticity index threshold LEZ, the formula based on which is as follows:
[0085] LEZ=LE avg +σ.
[0086] In the preferred embodiment of the handwriting recognition and judgment method based on knowledge transfer learning, the method for judging whether the handwriting of the handwriting sample to be judged is authentic is:
[0087] Based on the handwriting sample data to be determined, the handwriting characteristic index SI, the comprehensive index IC and the comprehensive pressure index I of the handwriting sample to be determined are calculated by the methods of steps 1 to 6, and the identity authenticity score CN of the writer to be determined is further calculated;
[0088] When LEZ>CN≥LEavg When the handwriting sample is re-entered, a new identity authenticity score CN is calculated. new ; When CN new ≥LE avg When CN new <LE avg When the handwriting of the handwriting sample to be determined is judged to be untrue;
[0089] When CN≥LEZ, the handwriting of the handwriting sample to be judged is directly judged to be authentic;
[0090] When CN <LE avg When the handwriting of the handwriting sample to be determined is judged to be unauthentic.
[0091] The present invention also discloses a handwriting recognition and judgment system based on knowledge transfer learning, which is used to implement the handwriting recognition and judgment method based on knowledge transfer learning, including:
[0092] A data collection module, used for collecting real handwriting sample data and handwriting sample data to be determined;
[0093] The data analysis module is used to establish a plane rectangular coordinate system according to the real handwriting sample data, and obtain the stroke contour coordinates (x t ,y t ), and calculate the curvature K of the stroke contour t ; Based on curvature K t Calculate the mean curvature K avg ; Preset the mean curvature threshold and set the mean curvature K avg Compare with the average curvature threshold, determine the stroke category based on the result, and count the number of strokes in each category and the total number of strokes NR;
[0094] The data processing module is used to obtain the coordinates of the pen tip at different times (x i ,y i ); Based on the pen tip coordinates at different times (x i ,y i ), calculate the vector Further obtain the vector angle θ between two adjacent vectors i ; Based on the vector angle θ between two adjacent vectors i , calculate the average angle θ avg ; Based on the real handwriting sample data, calculate the total handwriting length L and the average acceleration a respectively avg ; According to the total length of the handwriting L and the average acceleration a avg , calculate the handwriting generation rate V; according to the average curvature K avg , angle average value θ avgand handwriting generation rate V, calculate the comprehensive index IC;
[0095] The pressure calculation module is used to calculate the average pressure value P based on the real handwriting sample data. avg ; According to the real handwriting sample data and the average pressure value P avg , calculate the pressure variance S 2 ; According to the total length of handwriting L, handwriting generation rate V, average pressure value P avg and pressure variance S 2 , calculate the comprehensive pressure index I;
[0096] The knowledge transfer learning module is used to calculate the straight-line stroke combination ratio RS, the curved-line stroke combination ratio RD and the broken-line stroke combination ratio RV according to the number of stroke categories and the total number of strokes NR; calculate the handwriting complexity index ZA according to the straight-line stroke combination ratio RS, the curved-line stroke combination ratio RD and the broken-line stroke combination ratio RV; calculate the handwriting complexity index ZA according to the handwriting generation rate V, the handwriting complexity index ZA and the average pressure value P avg , calculate the handwriting characteristic index SI;
[0097] The result generation module is used to calculate the writer's identity authenticity score LE according to the handwriting feature index SI, the comprehensive index IC and the comprehensive pressure index I; after obtaining multiple writer's identity authenticity scores LE according to the real handwriting sample data, the average writer's identity authenticity score LE is calculated. avg , and further obtain the scoring standard deviation σ; according to the writer's identity authenticity scoring average LE avg and the scoring standard deviation σ, we get the handwriting authenticity index threshold LEZ;
[0098] The result determination module is used to calculate the identity authenticity score CN of the writer to be determined based on the handwriting sample data to be determined, compare the identity authenticity score CN with the handwriting authenticity index threshold LEZ, and determine whether the handwriting is authentic according to the result.
[0099] (III) Beneficial effects
[0100] The present invention provides a handwriting recognition and judgment method and system based on knowledge transfer learning, which has the following features:
[0101] Beneficial effects:
[0102] (1) The real handwriting sample data can be used as a standard to accurately identify the writer by analyzing the writing features, such as stroke direction, pressure distribution, etc. The authenticity of the handwriting to be determined can be effectively determined by comparing and analyzing the handwriting sample data to be determined with the real sample data.
[0103] (2) Obtain the coordinates of a point on the handwriting contour in the coordinate system and calculate the curvature of the point, and calculate the average curvature K avg , can accurately describe the shape characteristics of handwriting. Presetting the average curvature threshold to judge the different shapes of handwriting strokes helps to classify complex handwriting forms, so that the system can more specifically analyze the characteristics of different shapes of strokes.
[0104] (3) Calculating the angle between two adjacent vectors can provide key information for further understanding the structure of handwriting. Calculating the total length and average acceleration of handwriting, and then deriving the handwriting generation rate, can reflect the writing rhythm and speed characteristics of the writer. By calculating comprehensive indicators, scientific and objective data can be provided for handwriting identification and writer identification.
[0105] (4) Calculate the average pressure value and pressure variance, and calculate the comprehensive pressure index by combining the total length of handwriting, handwriting generation rate and other parameters, so as to capture the force characteristics of the writer during the writing process. These pressure characteristics can serve as an important basis for distinguishing different writers.
[0106] (5) The linear stroke combination ratio based on the number of linear strokes and the total number of strokes can intuitively reflect the writer's preference for stroke shape. The handwriting feature index is calculated by combining the handwriting generation rate, linear stroke combination ratio and average pressure value, which can comprehensively consider various aspects of writing characteristics to quantify the similarity between different handwritings. This multi-dimensional consideration makes handwriting comparison more accurate.
[0107] (6) By analyzing the real handwriting sample data to obtain the average value and standard deviation, and then determining the threshold of the handwriting authenticity index, the judgment of the handwriting authenticity is more scientific and objective. At the same time, based on the handwriting sample data to be judged, the authenticity score of the writer to be judged is calculated and compared with the threshold, which can accurately and efficiently judge whether the handwriting is authentic, and effectively prevent the risks brought by handwriting forgery. BRIEF DESCRIPTION OF THE DRAWINGS
[0108] Figure 1 The figure is a schematic diagram of the steps of the handwriting recognition and judgment method based on knowledge transfer learning of the present invention. DETAILED DESCRIPTION
[0109] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0110] See also Figure 1The present invention provides a handwriting recognition and judgment method based on knowledge transfer learning, comprising:
[0111] Step 1: Collect real handwriting sample data and handwriting sample data to be determined.
[0112] Step 101: Use a digital writing board to write multiple times within a specified writing content and time range, record various characteristic information such as pressure changes, stroke trajectory, writing time, etc. during each writing process, and obtain real handwriting sample data and handwriting sample data to be determined.
[0113] The real handwriting sample data can be used as a standard to accurately identify the writer by analyzing the writing features, such as stroke direction, pressure distribution, etc. The handwriting sample data to be determined can be used to verify the accuracy of the writer's identity. By comparing and analyzing it with the real sample data, the authenticity of the handwriting to be determined can be effectively determined.
[0114] Step 2: Establish a plane rectangular coordinate system based on the real handwriting sample data, and obtain the stroke contour coordinates (x t ,y t ), and calculate the curvature K of the stroke contour t ; Based on curvature K t Calculate the mean curvature K avg ; Preset the mean curvature threshold and set the mean curvature K avg Compare with the average curvature threshold, determine the stroke category based on the result, and count the number of strokes in each category and the total number of strokes NR.
[0115] Step 201: The lower left corner vertex of the writing plane of the digitized writing board when collecting real handwriting sample data is used as the origin (0, 0), the two perpendicular sides are used as the coordinate axis directions, the horizontal right direction is used as the positive direction of the x-axis, and the vertical upward direction is used as the positive direction of the y-axis, so as to establish a plane rectangular coordinate system.
[0116] Step 202: When the pen tip contacts the surface of the digital writing board for writing, the digital writing board will record the coordinate data in real time according to the position of the pen tip. The sensing grid inside the digital writing board can accurately locate the position of the pen tip in the plane rectangular coordinate system, so as to obtain the coordinates corresponding to the pen tip at each moment, thereby obtaining the stroke outline coordinates (x t ,y t ).
[0117] Based on the stroke outline coordinates (x t ,y t ), calculate the curvature K t , the formula based on is:
[0118]
[0119] Among them, Q(x t ,y t ) is the coordinate (x t ,y t ) at the first-order derivative; P(x t ,y t ) is the coordinate (x t ,y t ) at the second-order derivative; (x t ,y t ) is the coordinate of the tth point on the stroke contour.
[0120] It should be noted that curvature is a quantity used to describe the degree of curvature of a curve. For a plane curve, the definition of curvature is based on the first and second derivatives of the curve. Suppose the curve y = f(x), the general definition formula of the curvature K at the point (x, y) is Among them, y ′ is the first derivative of the curve at that point, y ″ is the second derivative of the curve at that point. is a variation of the general curvature formula. In order to normalize and consider factors such as the bending direction of the curve, |Q(x t ,y t )| directly reflects the size of the second-order derivative, thus reflecting the curvature of the curve.
[0121] Step 203: Based on the curvature K t , calculate the mean curvature K avg , the calculation formula is:
[0122]
[0123] Among them, K t is the curvature of the tth point on the stroke contour, the value of t is [1, n], n is the total number of points on the stroke contour, and the value is a positive integer.
[0124] It should be noted that for each point on the stroke contour, there is a corresponding curvature value K t The average curvature of the entire stroke outline is obtained by adding the curvature values of all these points and then dividing by the total number of points n.
[0125] Step 204: Preset the average curvature threshold; the average curvature threshold includes the average curvature threshold 1 K1 and the average curvature threshold 2 K2; collect a large number of handwriting samples and calculate the curvature of the strokes in these samples. Statistically analyze the average curvature of the straight stroke samples to find the maximum value of the average curvature of these straight strokes and use it as the average curvature threshold 1 K1; for curved strokes, also collect a large number of samples; perform statistical analysis on the average curvature of the curved stroke samples to find the minimum and maximum range of the average curvature of the curved strokes. The minimum value of the average curvature of the curved strokes is used as the average curvature threshold 2 K2.
[0126] Step 205: When K avg When ≤K1, it is judged as a straight stroke;
[0127] When K1 <K avg When ≤K2, it is judged as a curved stroke;
[0128] When K avg >K2, it is judged as a broken line stroke.
[0129] Step 206: According to step 205, the number of straight-line strokes NL, the number of curved-line strokes NM, the number of broken-line strokes NC and the total number of strokes NR are counted respectively.
[0130] This method can accurately quantify the characteristics of strokes and determine the stroke category by calculating the curvature and average curvature, which helps to gain a deeper understanding of the writer's writing habits. Counting the number of straight strokes and the total number of strokes can provide objective data support for handwriting analysis.
[0131] Step 3: Based on the plane rectangular coordinate system, obtain the coordinates of the pen tip at different times (x i ,y i ); Based on the pen tip coordinates at different times (x i ,y i ), calculate the vector Further obtain the vector angle θ between two adjacent vectors i ; Based on the vector angle θ between two adjacent vectors i , calculate the average angle θ avg ; Based on the real handwriting sample data, calculate the total handwriting length L and the average acceleration a respectively avg ; According to the total length of the handwriting L and the average acceleration a avg , calculate the handwriting generation rate V; according to the average curvature K avg , angle average value θ avg and handwriting generation rate V, calculate the comprehensive index IC.
[0132] Step 301: According to the sensor system in the digital writing board device, when the pen tip moves on the device surface to write, the device can record the position information of the pen tip in real time, thereby obtaining the pen tip coordinates (x i ,y i ).
[0133] Step 302: Based on the pen tip coordinates (x i ,y i ), calculate the pen tip coordinates (x i ,y i ) and the pen tip coordinates (x i+1 ,y i+1 ) The formula is:
[0134]
[0135] Among them, x i is the x coordinate of the pen tip at the ith moment; y i is the y coordinate of the pen tip at the i-th moment; x i+1 is the x coordinate of the pen tip at the i+1th moment; y i+1 The y coordinate of the pen tip at the i+1th moment.
[0136] Step 303: Vector-based and Calculate the vector angle θ between two adjacent vectors i , the formula based on is:
[0137]
[0138] in, It means (x i ,y i ) and (x i+1 ,y i+1 ) between the vectors; It means (x i+1 ,y i+1 ) and (x i+2 ,y i+2 ) between the vectors; It means (x i ,y i ) and (x i+1 ,y i+1 ) between the vectors; It means (x i+1 ,y i+1 ) and (x i+2 ,y i+2 ) between .
[0139] It should be noted that this formula uses cosθi The arccosine function is based on cosθ. i The value of returns the corresponding angle θ i , its value range is between 0 and π.
[0140] Step 304: Based on the vector angle θ between two adjacent vectors i , calculate the average angle θ avg , the calculation formula is:
[0141]
[0142] Among them, θ i is the angle of the pen tip at the i-th moment, and the value of i is [1, m]; m is the total number of moments, and its value is a positive integer.
[0143] It should be noted that for each moment i, there is a corresponding angle θ i The average angle is obtained by adding the angles at all moments and dividing by the total number of moments.
[0144] Step 305: According to (x i ,y i ) and (x i+1 ,y i+1 ), calculate the total length of the handwriting L, the calculation formula is:
[0145]
[0146] It should be noted that for two adjacent points (x i ,y i ) and (x i+1 ,y i+1 ), calculate the distance between them; add the distances between all adjacent points, that is The total length of the handwriting is obtained.
[0147] Step 306: The real handwriting sample data also includes the pen tip acceleration a k The digital writing board is equipped with a high-precision sensor that can detect the pressure, position and movement of the pen tip during writing. The built-in accelerometer in the electronic pen or smart pen can directly measure the acceleration of the pen tip during writing. k .
[0148] Step 307: Based on the pen tip acceleration a k , calculate the average acceleration a avg , the calculation formula is:
[0149]
[0150] Among them, a k is the acceleration at the kth time interval, where k is [1, N]; N is the number of time intervals, which is a positive integer.
[0151] It should be noted that for each time interval k, there is a corresponding acceleration value a k The average acceleration is obtained by adding the acceleration values for all these time intervals and dividing by the total number of time intervals, N.
[0152] Step 308: When the pen tip contacts the surface of the digital writing board and writing begins, the device can automatically record the start time, and when writing ends, the device records the end time. The total writing time t can be obtained by subtracting the two.
[0153] According to the total writing time t, the total length of the handwriting L and the average acceleration a avg , calculate the handwriting generation rate V, the calculation formula is:
[0154]
[0155] It should be noted that It represents the average speed. In the case of uniform motion, the speed is equal to the length of the handwriting divided by the time. The speed change caused by acceleration during the writing process is taken into account. The influence of uniform motion and uniform accelerated motion on the handwriting generation rate is comprehensively considered. In the actual writing process, the writing speed is not constant, and the acceleration will affect the final writing speed. This formula obtains the handwriting generation rate by adding the average speed and the speed change caused by acceleration.
[0156] Step 309: According to the average curvature K avg , angle average value θ avg and handwriting generation rate V, calculate the comprehensive index IC, the formula based on which is:
[0157] IC=μ×K avg +ε×θ avg +∈×V
[0158] Where μ is the mean curvature K avg The weight coefficient is 0.1 to 0.3; ε is the average angle θ avg , which takes a value of 0.3 to 0.4; ∈ is the weight coefficient of the handwriting generation rate V, which takes a value of 0.3 to 0.5; and μ+ε+∈=1.
[0159] It should be noted that this formula takes into account the average curvature K avg , angle average value θavg And the handwriting generation rate V are three important parameters. Each parameter has a corresponding weight coefficient, which indicates the importance of different parameters when calculating the comprehensive index. By multiplying each parameter with its corresponding weight coefficient and then summing them, a value that can fully describe the comprehensive index IC is obtained.
[0160] By accurately obtaining the coordinates of the pen tip and calculating the vector angle and other data, the writer's stroke direction and writing habits can be analyzed in detail, which is of great significance for handwriting identification. Calculating the total length of handwriting and the average acceleration can reflect the changes in writing speed, which helps to understand the writer's rhythm and force during the writing process. The handwriting generation rate derived from the total length of handwriting and the average acceleration can quantify the writer's writing efficiency. By calculating comprehensive indicators, scientific and objective data basis can be provided for handwriting identification, writer identification, etc.
[0161] Step 4: Calculate the average pressure value P based on the real handwriting sample data avg ; According to the real handwriting sample data and the average pressure value P avg , calculate the pressure variance S 2 ; According to the total length of handwriting L, handwriting generation rate V, average pressure value P avg and pressure variance S 2 , calculate the comprehensive pressure index I.
[0162] Step 401: The real handwriting sample data also includes the writing pressure value P i When writing on a digital writing board using a pressure-sensitive pen, the digital writing board can convert the pressure signal into a digital signal according to the pressure of the pen tip on the board surface, thereby recording the writing pressure value P at different times. i .
[0163] Step 402: Based on the writing pressure value P i , calculate the average pressure value P avg , the calculation formula is:
[0164]
[0165] Among them, P i is the writing pressure value of the pen tip at the i-th moment.
[0166] It should be noted that for each moment i, there is a corresponding writing pressure value P i ; By adding up the pressure values at all these moments and dividing by the number of measurements m, the average pressure value can be obtained.
[0167] Step 403: According to the writing pressure value P i and the average pressure value P avg, calculate the pressure variance S 2 , the calculation formula is:
[0168]
[0169] It should be noted that for each writing pressure value P i , first calculate it and the average pressure value P avg The difference P i -P avg , this difference indicates how much the pressure value deviates from the average. Then add up all these squared differences Finally, divide the total squared deviation by the number of measurements m to get the average squared deviation, i.e., the pressure variance S. 2 .
[0170] Step 404: According to the total length of the handwriting L, the handwriting generation rate V, and the average pressure value P avg and pressure variance S 2 , calculate the comprehensive pressure index I, the calculation formula is:
[0171]
[0172] Among them, α is the average pressure value P avg The weight coefficient is 0.1 to 0.4; β is the pressure variance S 2 The weight coefficient is 0.2~0.5; γ is The weight coefficient is between 0.3 and 0.4, and α+β+γ=1.
[0173] It should be noted that this formula takes into account the total length of the handwriting L, the handwriting generation rate V, the average pressure value P avg and pressure variance S 2 These four important parameters. Each parameter has a corresponding weight coefficient, which indicates the importance of different parameters when calculating the comprehensive stress index. By multiplying each parameter with its corresponding weight coefficient and then summing them, a value that can fully describe the comprehensive stress index I is obtained.
[0174] The average pressure value can reflect the writer's force habits during the writing process, which helps to understand the writer's writing style. The pressure variance reflects the fluctuation of writing pressure and has a certain reference value for judging the writer's concentration when writing. The comprehensive pressure index takes into account the total length of handwriting, handwriting generation rate, average pressure value and pressure variance, and can comprehensively characterize the writer's writing characteristics, providing a strong basis for handwriting identification and writer identification, which helps to improve the accuracy and reliability of judgment.
[0175] Step 5: According to the number of strokes in each stroke category and the total number of strokes NR, the linear stroke combination ratio RS, the curved stroke combination ratio RD and the broken line stroke combination ratio RV are calculated respectively; according to the linear stroke combination ratio RS, the curved stroke combination ratio RD and the broken line stroke combination ratio RV, the handwriting complexity index ZA is calculated; according to the handwriting generation rate V, the handwriting complexity index ZA and the average pressure value P avg , calculate the handwriting feature index SI.
[0176] Step 501: Calculate the linear stroke combination ratio RS, the curved stroke combination ratio RD and the curved stroke combination ratio RV respectively according to the number of linear strokes NL, the number of curved strokes NM, the number of broken line strokes NC and the total number of strokes NR. The calculation formulas are:
[0177]
[0178] Step 502: Calculate the handwriting complexity index ZA according to the straight line stroke combination ratio RS, the curve stroke combination ratio RD and the broken line stroke combination ratio RV. The calculation formula is:
[0179] ZA=a1×RS+a2×RD+a3×RV
[0180] Among them, a1 is the weight coefficient of the straight line stroke combination ratio RS, and its value is 0.3~0.5; a2 is the weight coefficient of the curve stroke combination ratio RD, and its value is 0.2~0.5; a3 is the weight coefficient of the broken line stroke combination ratio RV, and its value is 0.2~0.4; and a1+a2+a3=1.
[0181] It should be noted that this formula comprehensively considers three important parameters: the linear stroke combination ratio RS, the curved stroke combination ratio RD, and the broken line stroke combination ratio RV. Each parameter has a corresponding weight coefficient, which indicates the importance of different parameters when calculating the handwriting complexity index. By multiplying each parameter with its corresponding weight coefficient and then summing them, a value that can fully describe the handwriting complexity index ZA is obtained.
[0182] Step 503: Based on the handwriting generation rate V, the handwriting complexity index ZA and the average pressure value P avg , the handwriting characteristic index SI is calculated based on the formula:
[0183] SI=ω1×V+ω2×ZA+ω3×P avg
[0184] Among them, ω1 is the weight coefficient of the note generation rate V, which is 0.2-0.4; ω2 is the weight coefficient of the handwriting complexity index ZA, which is 0.3-0.5; ω3 is the average pressure value P avg The weight coefficient is between 0.1 and 0.5, and ω1+ω2+ω3=1.
[0185] It should be noted that this formula comprehensively considers the handwriting generation rate V, the handwriting complexity index ZA and the average pressure value P avg These three important parameters. Each parameter has a corresponding weight coefficient, which indicates the importance of different parameters when calculating the handwriting feature index. By multiplying each parameter with its corresponding weight coefficient and then summing them, a value that can fully describe the handwriting feature index SI is obtained. Calculating the handwriting complexity index can reflect the writer's stroke usage habits and help to preliminarily identify the writing style. Calculating the handwriting feature index based on the handwriting generation rate, handwriting complexity index and average pressure value can more accurately quantify the similarity between different handwritings and provide a reliable basis for handwriting identification.
[0186] Step 6: Calculate the writer's identity authenticity score LE based on the handwriting feature index SI, the comprehensive index IC and the comprehensive pressure index I; after obtaining multiple writer's identity authenticity scores LE based on the real handwriting sample data, calculate the average writer's identity authenticity score LE avg , and further obtain the scoring standard deviation σ; according to the writer's identity authenticity scoring average LE avg And the scoring standard deviation σ, the handwriting authenticity index threshold LEZ is obtained.
[0187] Step 601: There are individual differences between different writers, including physiological differences and writing habits. These differences cannot well reflect the unique identity characteristics of the writer, ρ and It helps to make adjustments according to the characteristics of different writers, so that the calculation results can better reflect the identity of the writer. Through the analysis and experiments of a large number of samples of different writers, according to the differences in handwriting characteristics of different writers, an adjustment coefficient ρ with a value of 0 to 1 is determined for adjustment; according to the differences in comprehensive indicators of different writers, an adjustment coefficient with a value of 0 to 1 is determined To adjust hand strength, writing speed and other characteristics.
[0188] According to the handwriting feature index SI, the comprehensive index IC and the comprehensive pressure index I, the writer's identity authenticity score LE is calculated. The calculation formula is:
[0189]
[0190] Among them, ρ is the adjustment coefficient of the handwriting characteristic index SI, ranging from 0 to 1; It is the adjustment coefficient of the comprehensive indicator IC, and its value ranges from 0 to 1.
[0191] It should be noted that by combining (1-SI), ρ, IC, Multiplying by 1 and I, we get the writer's identity authenticity score LE. This index takes into account the handwriting feature index and the comprehensive pressure index. If the two handwritings are not similar and the comprehensive pressure index is large, then the LE value will be large, indicating that the writers are different; conversely, if the handwritings are similar and the comprehensive pressure index is similar, the LE value will be small, indicating that the writers are the same.
[0192] Step 602: After obtaining multiple writer identity authenticity scores LE based on the real handwriting sample data, calculate the average writer identity authenticity score LE avg , the calculation formula is:
[0193]
[0194] Among them, LE b is the b-th writer’s identity authenticity score, where b is [1, M]; M is the total number of times the writer’s identity authenticity score is obtained, and its value is a positive integer.
[0195] It should be noted that the authenticity scores of the writer’s identity were obtained M times through the real handwriting sample data, which are denoted as LE b ; To get the average of these scores, all LE b Add them together and divide by the total number of ratings M; For all LEs from b = 1 to b = M b Finally, the sum is divided by M to obtain the average value LE of the writer's identity authenticity score. avg .
[0196] Step 603: Score LE based on the authenticity of the writer's identity b and the average LE of the writer's identity authenticity score avg , calculate the score standard deviation σ, the calculation formula is:
[0197]
[0198] It should be noted that for each scoring LE b , calculate the difference between it and the mean value LE b -LE avg ; Then square this difference (LE b -LE avg ) 2The purpose of this is to eliminate the positive and negative effects of the difference and amplify the size of the difference so that the larger deviation contributes more to the standard deviation. b -LE avg ) 2 Summing, we get Divide the sum by the total number of ratings M to get the average sum of squared deviations. Then take the square root of this result to get the standard deviation σ of the rating.
[0199] Step 604: Score the writer's identity authenticity based on the average LE avg And the scoring standard deviation σ, calculate the handwriting authenticity index threshold LEZ, the formula based on which is as follows:
[0200] LEZ=LE avg +σ.
[0201] This method obtains the mean value and standard deviation by analyzing the real handwriting sample data, and then determines the threshold of the handwriting authenticity index, making the judgment of handwriting authenticity more scientific and objective.
[0202] Step 7: Calculate the identity authenticity score CN of the writer to be determined based on the handwriting sample data to be determined, compare the identity authenticity score CN with the handwriting authenticity index threshold LEZ, and determine whether the handwriting is authentic based on the result.
[0203] Step 701: Based on the handwriting sample data to be determined, the handwriting characteristic index SI, the comprehensive index IC and the comprehensive pressure index I of the handwriting sample to be determined are calculated by the methods of steps 1 to 6, and the identity authenticity score CN of the writer to be determined is further calculated;
[0204] Step 702: When LEZ>CN≥LE avg When the handwriting sample is re-entered, a new identity authenticity score CN is calculated. new ; When CN new ≥LE avg When CN new <LE avg When the handwriting of the handwriting sample to be determined is judged to be unauthentic.
[0205] When CN≥LEZ, the handwriting of the handwriting sample to be judged is directly judged to be authentic.
[0206] When CN <LE avg When the handwriting of the handwriting sample to be determined is judged to be unauthentic.
[0207] By calculating the score to be judged based on the handwriting sample data to be judged and comparing it with the threshold, it can accurately and efficiently determine whether the handwriting is authentic, and effectively prevent the risks brought by handwriting forgery.
[0208] On the other hand, the present invention also discloses a handwriting recognition and judgment system based on knowledge transfer learning, which is used to implement the handwriting recognition and judgment method based on knowledge transfer learning, including:
[0209] A data collection module, used for collecting real handwriting sample data and handwriting sample data to be determined;
[0210] The data analysis module is used to establish a plane rectangular coordinate system according to the real handwriting sample data, and obtain the stroke contour coordinates (x t ,y t ), and calculate the curvature K of the stroke contour t ; Based on curvature K t Calculate the mean curvature K avg ; Preset the mean curvature threshold and set the mean curvature K avg Compare with the average curvature threshold, determine the stroke category based on the result, and count the number of strokes in each category and the total number of strokes NR;
[0211] The data processing module is used to obtain the coordinates of the pen tip at different times (x i ,y i ); Based on the pen tip coordinates at different times (x i ,y i ), calculate the vector Further obtain the vector angle θ between two adjacent vectors i ; Based on the vector angle θ between two adjacent vectors i , calculate the average angle θ avg ; Based on the real handwriting sample data, calculate the total handwriting length L and the average acceleration a respectively avg ; According to the total length of the handwriting L and the average acceleration a avg , calculate the handwriting generation rate V; according to the average curvature K avg , angle average value θ avg and handwriting generation rate V, calculate the comprehensive index IC;
[0212] The pressure calculation module is used to calculate the average pressure value P based on the real handwriting sample data. avg ; According to the real handwriting sample data and the average pressure value P avg , calculate the pressure variance S 2 ; According to the total length of handwriting L, handwriting generation rate V, average pressure value P avg and pressure variance S 2 , calculate the comprehensive pressure index I;
[0213] The knowledge transfer learning module is used to calculate the straight-line stroke combination ratio RS, the curved-line stroke combination ratio RD and the broken-line stroke combination ratio RV according to the number of stroke categories and the total number of strokes NR; calculate the handwriting complexity index ZA according to the straight-line stroke combination ratio RS, the curved-line stroke combination ratio RD and the broken-line stroke combination ratio RV; calculate the handwriting complexity index ZA according to the handwriting generation rate V, the handwriting complexity index ZA and the average pressure value P avg , calculate the handwriting characteristic index SI;
[0214] The result generation module is used to calculate the writer's identity authenticity score LE according to the handwriting feature index SI, the comprehensive index IC and the comprehensive pressure index I; after obtaining multiple writer's identity authenticity scores LE according to the real handwriting sample data, the average writer's identity authenticity score LE is calculated. avg , and further obtain the scoring standard deviation σ; according to the writer's identity authenticity scoring average LE avg and the scoring standard deviation σ, we get the handwriting authenticity index threshold LEZ;
[0215] The result determination module is used to calculate the identity authenticity score CN of the writer to be determined based on the handwriting sample data to be determined, compare the identity authenticity score CN with the handwriting authenticity index threshold LEZ, and determine whether the handwriting is authentic according to the result.
[0216] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. A person of ordinary skill in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented in electronic hardware or in combination with computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution.
[0217] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0218] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A handwriting recognition and judgment method based on knowledge transfer learning, characterized in that: include: Step 1: Collect real handwriting sample data and handwriting sample data to be determined; Step 2: Establish a plane rectangular coordinate system based on the real handwriting sample data, and obtain the stroke contour coordinates (x t ,y t ), and calculate the curvature K of the stroke contour t ; Based on curvature K t Calculate the mean curvature K avg ; Presets The mean curvature threshold is the mean curvature K avg Compare with the average curvature threshold, determine the stroke category based on the result, and count the number of strokes in each category and the total number of strokes NR; Step 3: Based on the plane rectangular coordinate system, obtain the coordinates of the pen tip at different times (x i ,y i ); Based on the pen tip coordinates at different times (x i ,y i ), calculate the vector Further obtain the vector angle θ between two adjacent vectors i ; Based on the vector angle θ between two adjacent vectors i , calculate the average angle θ avg ; Based on the real handwriting sample data, calculate the total handwriting length L and the average acceleration a respectively avg ; According to the total length of the handwriting L and the average acceleration a avg , calculate the handwriting generation rate V; according to the average curvature K avg , angle average value θ avg and handwriting generation rate V, calculate the comprehensive index IC; Step 4: Calculate the average pressure value P based on the real handwriting sample data avg ; According to the real handwriting sample data and the average pressure value P avg , calculate the pressure variance S 2 ; According to the total length of handwriting L, handwriting generation rate V, average pressure value P avg and pressure variance S 2 , calculate the comprehensive pressure index I; Step 5: According to the number of strokes in each stroke category and the total number of strokes NR, the linear stroke combination ratio RS, the curved stroke combination ratio RD and the broken line stroke combination ratio RV are calculated respectively; according to the linear stroke combination ratio RS, the curved stroke combination ratio RD and the broken line stroke combination ratio RV, the handwriting complexity index ZA is calculated; according to the handwriting generation rate V, the handwriting complexity index ZA and the average pressure value P avg , calculate the handwriting characteristic index SI; Step 6: Calculate the writer's identity authenticity score LE based on the handwriting feature index SI, the comprehensive index IC and the comprehensive pressure index I; after obtaining multiple writer's identity authenticity scores LE based on the real handwriting sample data, calculate the average writer's identity authenticity score LE avg , and further obtain the scoring standard deviation σ; according to the writer's identity authenticity scoring average LE avg and the scoring standard deviation σ, we get the handwriting authenticity index threshold LEZ; Step 7: Calculate the identity authenticity score CN of the writer to be determined based on the handwriting sample data to be determined, compare the identity authenticity score CN with the handwriting authenticity index threshold LEZ, and determine whether the handwriting is authentic based on the result.
2. The handwriting recognition and judgment method based on knowledge transfer learning according to claim 1 is characterized in that: The method to establish a plane rectangular coordinate system is: The lower left corner vertex of the writing plane when collecting real handwriting sample data is taken as the origin (0, 0), the two mutually perpendicular sides are taken as the coordinate axis directions, the horizontal right direction is taken as the positive direction of the x-axis, and the vertical upward direction is taken as the positive direction of the y-axis, so as to establish a plane rectangular coordinate system.
3. The handwriting recognition and judgment method based on knowledge transfer learning according to claim 2 is characterized in that: The method for determining the stroke category is: Based on the plane rectangular coordinate system, the stroke contour coordinates (x t ,y t ); Based on the stroke outline coordinates (x t ,y t ), calculate the curvature K t , the formula based on is: Among them, Q(x t ,y t ) is the coordinate (x t ,y t ) at the first-order derivative; P(x t ,y t ) is the coordinate (x t ,y t ) at the second-order derivative; (x t ,y t ) is the coordinate of the tth point on the stroke contour; Based on the curvature K t , calculate the mean curvature K avg , the calculation formula is: Among them, K t is the curvature of the tth point on the stroke contour, the value of t is [1, n], n is the total number of points on the stroke contour, and the value is a positive integer; Preset mean curvature threshold; The average curvature threshold includes an average curvature threshold 1 K1 and an average curvature threshold 2 K2; When K avg When ≤K1, it is judged as a straight line stroke; When K1 <K avg When ≤K2, it is judged as a curved stroke; When K avg >K2, it is judged as a broken line stroke; Count the number of straight line strokes NL, the number of curved line strokes NM, the number of broken line strokes NC and the total number of strokes NR.
4. The handwriting recognition and judgment method based on knowledge transfer learning according to claim 3 is characterized in that: Calculate the average angle θ avg The method is: Based on the plane rectangular coordinate system, obtain the pen tip coordinates (x i ,y i ); Calculate the pen tip coordinates (x i ,y i ) and the pen tip coordinates (x i+1 ,y i+1 ) The formula is: Among them, x i is the x coordinate of the pen tip at the ith moment; y i is the y coordinate of the pen tip at the i-th moment; x i+1 is the x coordinate of the pen tip at the i+1th moment; y i+1 The y coordinate of the pen tip at the i+1th moment; Vector-based Calculate the vector angle θ between two adjacent vectors i , the formula based on is: in, It means (x i ,y i ) and (x i+1 ,y i+1 ) between the vectors; It means (x i+1 ,y i+1 ) and (x i+2 ,y i+2 ) between the vectors; It means (x i ,y i ) and (x i+1 ,y i+1 ) between the vectors; It means (x i+1 ,y i+1 ) and (x i+2 ,y i+2 ) between the vectors; Based on the vector angle θ between two adjacent vectors i , calculate the average angle θ avg , the calculation formula is: Among them, θ i is the angle of the pen tip at the i-th moment, and the value of i is [1, m]; m is the total number of moments, and its value is a positive integer.
5. The handwriting recognition and judgment method based on knowledge transfer learning according to claim 4 is characterized in that: The method for calculating the comprehensive indicator IC is: The real handwriting sample data also includes the pen tip acceleration a k ; According to (x i ,y i ) and (x i+1 ,y i+1 ), calculate the total length of the handwriting L, the calculation formula is: Based on the pen tip acceleration a k , calculate the average acceleration a avg , the calculation formula is: Among them, a k is the acceleration at the kth time interval, k is in the range [1, N]; N is the number of time intervals, which is a positive integer; According to the total length L of the handwriting and the average acceleration a avg , calculate the handwriting generation rate V, the calculation formula is: Where, t is the total writing time; According to the mean curvature K avg , angle average value θ avg and handwriting generation rate V, calculate the comprehensive index IC, the formula based on which is: IC=μ×K avg +ε×θ avg +∈×V Where μ is the mean curvature K avg The weight coefficient is 0.1 to 0.3; ε is the average angle θ avg , which takes a value of 0.3 to 0.4; ∈ is the weight coefficient of the handwriting generation rate V, which takes a value of 0.3 to 0.5; and μ+ε+∈=1.
6. The handwriting recognition and judgment method based on knowledge transfer learning according to claim 5 is characterized in that: The method for calculating the comprehensive pressure index I is: The real handwriting sample data also includes the writing pressure value P i ; Based on the writing pressure value P i , calculate the average pressure value P avg , the calculation formula is: Among them, P i is the writing pressure value of the pen tip at the i-th moment; According to the writing pressure value P i and the average pressure value P avg , calculate the pressure variance S 2 , the calculation formula is: According to the total length of handwriting L, handwriting generation rate V, average pressure value P avg and pressure variance S 2 , calculate the comprehensive pressure index I, the calculation formula is: Among them, α is the average pressure value P avg The weight coefficient is 0.1 to 0.4; β is the pressure variance S 2 The weight coefficient is 0.2~0.5; γ is The weight coefficient is between 0.3 and 0.4, and α+β+γ=1.
7. The handwriting recognition and judgment method based on knowledge transfer learning according to claim 6 is characterized in that: The method for calculating the handwriting characteristic index SI is: According to the number of straight strokes NL, the number of curved strokes NM, the number of broken line strokes NC and the total number of strokes NR, the straight stroke combination ratio RS, the curved stroke combination ratio RD and the broken line stroke combination ratio RV are calculated respectively, and the calculation formulas are: According to the straight line stroke combination ratio RS, the curve stroke combination ratio RD and the broken line stroke combination ratio RV, the handwriting complexity index ZA is calculated using the following formula: ZA=a1×RS+a2×RD+a3×RV Wherein, a1 is the weight coefficient of the straight stroke combination ratio RS, and its value is 0.3-0.5; a2 is the weight coefficient of the curved stroke combination ratio RD, and its value is 0.2-0.5; a3 is the weight coefficient of the broken line stroke combination ratio RV, and its value is 0.2-0.4; and a1+a2+a3=1; According to the handwriting generation rate V, handwriting complexity index ZA and average pressure value P avg , the handwriting characteristic index SI is calculated based on the formula: SI=ω1×V+ω2×ZA+ω3×P avg Among them, ω1 is the weight coefficient of the note generation rate V, which is 0.2-0.4; ω2 is the weight coefficient of the handwriting complexity index ZA, which is 0.3-0.5; ω3 is the average pressure value P avg The weight coefficient is between 0.1 and 0.5, and ω1+ω2+ω3=1.
8. The handwriting recognition and judgment method based on knowledge transfer learning according to claim 7 is characterized in that: The method for calculating the handwriting authenticity index threshold LEZ is: According to the handwriting feature index SI, the comprehensive index IC and the comprehensive pressure index I, the writer's identity authenticity score LE is calculated. The calculation formula is: LE=(1-SI)×ρ×IC×θ×I Among them, ρ is the adjustment coefficient of the handwriting characteristic index SI; θ is the adjustment coefficient of the comprehensive index IC; After obtaining multiple writer's identity authenticity scores LE based on real handwriting sample data, calculate the average writer's identity authenticity score LE avg , the calculation formula is: Among them, LE b is the b-th writer’s identity authenticity score, and the value of b is [1, M]; M is the total number of times the writer’s identity authenticity score is obtained, and the value is a positive integer; Score LE based on the authenticity of the writer b and the average LE of the writer's identity authenticity score avg , calculate the score standard deviation σ, the calculation formula is: According to the writer's authenticity score, the average LE avg And the scoring standard deviation σ, calculate the handwriting authenticity index threshold LEZ, the formula based on which is as follows: LEZ=LE avg +σ.
9. The handwriting recognition and judgment method based on knowledge transfer learning according to claim 8 is characterized in that: The method for judging whether the handwriting of the handwriting sample to be judged is authentic is: Based on the handwriting sample data to be determined, the handwriting characteristic index SI, the comprehensive index IC and the comprehensive pressure index I of the handwriting sample to be determined are calculated by the methods of steps 1 to 6, and the identity authenticity score CN of the writer to be determined is further calculated; When LEZ>CN≥LE avg When the handwriting sample is re-entered, a new identity authenticity score CN is calculated. new ; When CN new ≥LE avg When CN new <LE avg When the handwriting of the handwriting sample to be determined is judged to be untrue; When CN≥LEZ, the handwriting of the handwriting sample to be judged is directly judged to be authentic; When CN <LE avg When the handwriting of the handwriting sample to be determined is judged to be unauthentic.
10. A handwriting recognition and judgment system based on knowledge transfer learning, characterized by: A data collection module, used for collecting real handwriting sample data and handwriting sample data to be determined; The data analysis module is used to establish a plane rectangular coordinate system according to the real handwriting sample data, and obtain the stroke contour coordinates (x t ,y t ), and calculate the curvature K of the stroke contour t ; Based on curvature K t Calculate the mean curvature K avg ; Presets The mean curvature threshold is the mean curvature K avg Compare with the average curvature threshold, determine the stroke category based on the result, and count the number of strokes in each category and the total number of strokes NR; The data processing module is used to obtain the coordinates of the pen tip at different times (x i ,y i ); Based on the pen tip coordinates at different times (x i ,y i ), calculate the vector Further obtain the vector angle θ between two adjacent vectors i ; Based on the vector angle θ between two adjacent vectors i , calculate the average angle θ avg ; Based on the real handwriting sample data, calculate the total handwriting length L and the average acceleration a respectively avg ; According to the total length of the handwriting L and the average acceleration a avg , calculate the handwriting generation rate V; according to the average curvature K avg , angle average value θ avg and handwriting generation rate V, calculate the comprehensive index IC; The pressure calculation module is used to calculate the average pressure value P based on the real handwriting sample data. avg ; According to the real handwriting sample data and the average pressure value P avg , calculate the pressure variance S 2 ; According to the total length of handwriting L, handwriting generation rate V, average pressure value P avg and pressure variance S 2 , calculate the comprehensive pressure index I; The knowledge transfer learning module is used to calculate the straight-line stroke combination ratio RS, the curved-line stroke combination ratio RD and the broken-line stroke combination ratio RV according to the number of stroke categories and the total number of strokes NR; calculate the handwriting complexity index ZA according to the straight-line stroke combination ratio RS, the curved-line stroke combination ratio RD and the broken-line stroke combination ratio RV; calculate the handwriting complexity index ZA according to the handwriting generation rate V, the handwriting complexity index ZA and the average pressure value P avg , calculate the handwriting characteristic index SI; The result generation module is used to calculate the writer's identity authenticity score LE according to the handwriting feature index SI, the comprehensive index IC and the comprehensive pressure index I; after obtaining multiple writer's identity authenticity scores LE according to the real handwriting sample data, the average writer's identity authenticity score LE is calculated. avg , and further obtain the scoring standard deviation σ; according to the writer's identity authenticity scoring average LE avg and the scoring standard deviation σ, we get the handwriting authenticity index threshold LEZ; The result determination module is used to calculate the identity authenticity score CN of the writer to be determined based on the handwriting sample data to be determined, compare the identity authenticity score CN with the handwriting authenticity index threshold LEZ, and determine whether the handwriting is authentic according to the result.
Citation Information
Cited By
Man-machine collaborative writing system and method based on multi-modal fusion
CN122261411A