




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





Rachel Patel^1 , Beryl Plimmer^1 , John Grundy1, 2, Ross Ihaka^3
(^1) Department of Computer Science (^2) Department of Electrical and Computer Engineering (^3) Department of Statistics University of Auckland Private Bag 92019, Auckland, New Zealand {rpat088@ec, beryl@cs, john-g@cs, ihaka@stat}.auckland.ac.nz
Abstract. A critical component of diagramming sketch tools is their ability to reliably recognise hand-drawn diagram components. This is made difficult by the presence of both geometric shapes and characters in diagrams. The goal of our research is to improve sketch recognition by improving the accuracy in grouping and classifying strokes in a diagram into text characters and shapes. We have done this by identifying the most significant features of strokes that can be used to distinguish shapes from text using a decision tree based parti- tioning technique. Implementation and evaluation of this new “shape divider” using these features against InkKit’s existing divider and the Microsoft divider has shown that our divider is more accurate at dividing text and shape strokes and can therefore improve overall sketch recognition.
Keywords: Human Computer Interaction, Pattern Recognition
Computers can be used to produce formal diagrams e.g. software designs, user inter- face designs, CAD specifications, hierarchy charts and so on. However, in the begin- ning of a project it can be better to use pen and paper. The reason is that these simple, human-centric design tools are far more flexible which encourages creativity and in turn this produces better designs in the end. However a computer offers easy editing and distribution features and greater formality to the look of a diagram and so some- times the important pen and paper design stage is overlooked. Imagine being able to sketch diagrams directly onto a computer screen and have them accurately translated into formalized representations. The Tablet PC supports sketching of characters and recognition of these but has much weaker support for general diagram drawing and accurate recognition. InkKit [8] is a sketch tool for the Tablet PC that has been designed to bridge the gap between pen and paper and com- puters. InkKit allows you to sketch any type of diagram using the Tablet PC’s stylus. Its recognition engine then identifies each component of the diagram and transforms it into a formal, tidy version in a specified format such as HTML or a Word drawing ob- ject. InkKit has been used as a foundation for this research.
A critical part of diagramming sketch tools is being able to reliably recognise the hand-drawn diagram components. The purpose of this Masters project is to improve the recognition algorithms that currently exist. One of the reasons why recognising a diagram is difficult, is because we are dealing with words and shapes at the same time. Figure 1, shows a typical user interface design that can be used Fig 1. Sketch of a user interface design to highlight this problem. For example,
what is it that makes the circles in front of the words “Male” and “Female” circles in- dicating radio buttons and not the letter o? The existing InkKit system automatically divides the ink into words and shapes, and then recognises the words using the Tablet Operating System recognizer and shapes using a variant of Rubine’s algorithm [5]. Once the basic shapes and words have been recognised they are combined back together to suggest the most probable diagram component. This method of dividing the words and shapes is preferred over using a modal interface to separate the two as it preserves human’s natural sketching approaches used on pen and paper [3]. The aim of our research has been to greatly improve the algorithm that divides the ink into either text or drawing as this is the area where we can expect the most improvement in diagram recognition [8]. Most sketch recognition mechanisms measure various features of the strokes in a sketch to guide its recognition. This is also evident in the recognition engine of Ink- Kit. However what is lacking is a definitive, principled set of the most significant fea- tures that can be used to provide an accurate division of the shape and text strokes in a sketch. Therefore our goal is to find these features in order to improve division of shape and text strokes and in doing so improve the accuracy of sketch recognition as a whole. We first detail the methodology we have used to identify the most significant fea- tures of sketches that will aid division of strokes. Section 4 will briefly describe the selected feature set and then detail the experiment conducted to identify which fea- tures from the set are significant. The implementation and evaluation of the resulting divider of shape and text strokes is presented in Section 5. Finally we conclude with a discussion of the results and suggestions for future work.
In this section we provide an overview of the approach we have used beginning with the investigation of possible sketch features, how feature data is collected and ana- lysed, and the implementation and evaluation of the resulting divider of text and shape strokes.
tures to help division, and also provided us with the most optimal combination of fea- tures for implementation.
Implementation & Evaluation
Once the significant stroke features had been identified through formal statistical analysis a new shape divider was implemented for InkKit. InkKit’s existing divider remains as we wanted to compare its performance and the Tablet PC Microsoft di- vider to our new shape divider. We evaluated these three divider implementations to determine which is more accurate at dividing text and shape strokes.
All the possible stroke features that may be helpful in distinguishing text from shape strokes were compiled together into a feature set. They came from related work in sketch recognition [2, 5, 6, 8]; features we thought may be significant; and the discov- ery of features from newly available Tablet PC hardware. We attempted to include as many features of strokes as possible to ensure that all avenues would be explored by the statistical analysis and the most significant features could be identified – 52 fea- tures were selected in all. The 52 features can be grouped into seven categories, size, time, intersections, curvature, pressure, Tablet Operating System recognition values and others. Our stroke feature set was then analysed to discover which of these features pro- vide the greatest contribution to dividing text and shape strokes in a diagram. We de- scribe this experiment beginning with the collection and processing of data from a range of sketched diagrams, then analysing this data using a tree-based partitioning technique that consequently constructs a classification tree containing the most sig- nificant features for division of text and shape strokes. This process allowed us to draw conclusions as to which features are most significant to division.
Data Collection & Processing
To perform a full analysis of the feature set sketched diagrams were collected from as many people as possible. A set of nine diagrams were identified to be used for analy- sis, illustrated in Table 1. In compiling this set we looked for examples of shapes and text that would represent those typical of a wide range of diagram types and therefore would allow us to identify the most significant features of strokes for division to be identified for a general-purpose, reusable shape divider. Our diagram set includes ba- sic shapes and text, complex shapes, composite shapes and various combinations and ordering of shapes and text. Sketches were gathered from 26 people. Each person completed a set of 9 sketches. Each sketch was then processed to obtain the 52 fea- tures from our feature set, forming a final dataset ready for statistical analysis with 1519 observations in all. We manually categorized each stroke as SHAPE or TEXT as base data for the statistical analysis.
Table 1. The Diagram Set
Shape Description Example Sketch Circle Button : rectangle with label “Button” inside it.
Text : “Hello how are you”, without punctuation.
Radio-text : radio button with label “Hello world” next to it. Text-radio : same as radio-text above but label written be- fore radio button (spatial ordering is the same). Combo box : rectangle with a triangle inside.
Resistor : spiked line, from electrical diagrams. Hexagon : six-sided polygon.
Connector : two rectangles with a line connecting them in the middle.
Analysis
The analysis of the dataset was performed using the R statistical package, pre-release Version 2.5.0 [9]. The dataset was used as training data for the rpart function [7] which applies a tree-based partitioning technique to identify the significant features to use as decision variables in a binary classification tree and determines how to split those features so that they can accurately classify strokes as either text or shape strokes. For each feature rpart is provided with each example stroke’s feature data e.g. length, average speed, curvature, average pressure value etc, and the known classifi- cation of the stroke i.e. SHAPE or TEXT. From the total training set the rpart function constructs a binary classification tree starting with the most significant feature, then the next, then the next and so on.
Results
The binary classification tree resulting from our rpart analysis of our full training set is shown in Figure 2. Eight different features of strokes, named in each node of the classification tree, were identified from the feature set as being significant for divid- ing shape from text strokes, each one is described in Table 2. The majority of these features are measuring some element of size, as five out of eight of the features come from this category. Features of time have also registered their importance as making up two out of eight of the significant features. Also one feature of curvature has been identified as important to the division of shape and text strokes. This resultant decision tree is used to classify strokes into SHAPE or TEXT. For example, consider classifying a given stroke. First we sample its bounding box width. If its bounding box width is >= 1848 we follow the left branch of the tree. We then measure its total angle. If its total angle is < 10.1 the left branch is taken once again and the stroke is classified as a SHAPE. Taking another stroke, we calculate its
0
10
20
30
40
50
60
70
80
90
100
Microsoft New InkKit Divider Type
% Misclassified Strokes
.
% Misclassified Shapes % Misclassified Text
8.8 10.
0
10
20
30
40
50
60
70
80
90
100
Microsoft New InkKit Divider Type
% M issclassified Strokes
.^
% Misclassified Shapes % Misclassified Text
Fig 3. Percentage of misclassified shape and Fig 4. Percentage of misclassified shape and text strokes for each divider using the text strokes for each divider using the new training diagram set diagram set
The dividers were used to divide the original training set of diagrams shown in Ta- ble 1 and also a new set of diagrams that included more complex diagrams exhibiting characteristics not considered previously. The new diagram set consisted of a directed graph, musical notes, check boxes and a crossed out word. Results were compiled based on the proportion of strokes that were correctly or incorrectly classified as text or shape strokes. The level of accuracy of each divider was then assessed from these results to ultimately determine if our new shape divider did in fact perform better. Using the training set of diagrams, the percentage of shape and text strokes that were misclassified for each divider is shown in Figure 3. The Microsoft divider has the highest percentage of misclassified shape strokes at 75.7% and the lowest percent- age of misclassified text strokes, where no text strokes were incorrectly classified at all. The new divider has the lowest proportion of misclassified shape strokes when compared with the other dividers at 10.8%, and the second lowest proportion of mis- classified text strokes at 8.8%. The InkKit divider has a very high misclassification rate for shape strokes at 67.4%, coming in as the second highest of all dividers, how- ever in contrast it has a low percentage of misclassified text strokes at 10.3%, how- ever when compared with the other dividers, InkKit’s rate of misclassification for text strokes is the highest. All dividers showed much greater accuracy in classifying text strokes than shape strokes. Using the new diagram set the percentage of misclassified shape and text strokes for each of the three dividers are shown in Figure 4. The Microsoft divider once again has the worst rate of misclassification of shape strokes where 93.1% were incorrectly classified. It has the best percentage of misclassified text strokes at 1.4%. This fol- lows the pattern shown in the evaluation results for the training diagram set shown in Figure 3. Also following the results of the first evaluation, our new divider has the lowest misclassification rate for shape strokes at 42.1%, although this is still very
high. The new divider has the highest percentage of misclassified text strokes at 21.4% however this is only a little above InkKit at 17.2% for text strokes. InkKit’s rate of misclassification for shape strokes comes in at 80.8%. Again, all dividers show a greater degree of accuracy in classifying text strokes than shape strokes.
Eight features out of the 52 that were in the feature set were found to be significant to dividing text and shape strokes. These features were mostly measures of size and time, with one measuring curvature. The evaluation shows that overall the new shape divider was the most accurate at dividing the training set of diagrams when compared with the InkKit divider and the Microsoft divider. For the new diagram set it was con- siderably better at classifying shape strokes and marginally the worst at classifying text strokes. Overall, when compared with the InkKit and Microsoft dividers, the new divider was more accurate at dividing the new diagram set as well. Therefore we can conclude that the features selected can be used to improve the accuracy of division of text and shape strokes in a sketched diagram.
The classification tree approach has worked well at combining the significant features together for more accurate division of strokes into character text and geometric shapes. Future work in this area could involve experimenting with other algorithms such as using Hidden Markov Models [4] for a more robust divider.