Introduction
In the field of sketch recognition, distinguishing between geometric shapes and handwritten text remains a significant challenge. Most existing systems are specialized for one or the other, often failing when text labels and shapes are intermingled or overlapping—a common occurrence in engineering blueprints and circuit diagrams. Researchers at Texas A&M University have proposed a novel solution to this problem by utilizing a single metric: entropy rate. By treating digital ink as a "language" of angles, they demonstrate that text is fundamentally more information-dense and less predictable than geometric shapes, allowing for high-accuracy classification without complex, domain-specific rules.
Methodology
The proposed method avoids the "brittleness" of traditional hand-picked features (like stroke length or speed) by focusing on the intrinsic randomness of a stroke. The process follows three primary stages:
- Stroke Grouping: Strokes are clustered based on spatial and temporal proximity, typically grouping those drawn within 100–400ms of each other.
- The "Alphabet" of Ink: Continuous pen movements are transformed into a discrete string of symbols. The researchers defined a 7-symbol alphabet (A-F and X), where each symbol represents a specific range of curvature formed by three consecutive points. For instance, a straight line segment might be encoded as 'A', while a sharp turn is assigned 'D'.
- Entropy Rate Calculation: The system calculates the zero-order Shannon entropy of the resulting string. To ensure the metric is scale-independent, the total entropy is divided by the length of the bounding box diagonal, yielding the "entropy rate."
Finally, a simple threshold is applied: strokes with high entropy rates are classified as text, while those with low rates are identified as shapes. An arctan-based confidence measure is used to handle ambiguous cases.
Experimental Results
The system was evaluated using data from the SOUSA web tool, including Military Course of Action (COA) symbols and Free Body Mechanics diagrams. The latter served as an "unseen domain" to test the generalizability of the entropy threshold.
The results demonstrated that text consistently produces significantly higher entropy than geometric primitives. Even complex shapes like zig-zag resistors maintain a repeating, predictable pattern that results in lower entropy than the varied curves of freehand handwriting.
Key performance metrics include:
- Overall Accuracy: 92.06% when classifying every stroke.
- Text Identification: 97.62% accuracy for text strokes in high-confidence mode.
- Domain Independence: Thresholds trained on military symbols generalized to physics diagrams with 96.42% accuracy, proving entropy is a fundamental characteristic of "text-ness."
Discussion and Limitations
The core insight of this research is that handwriting is structurally more complex and less predictable than geometric primitives. By focusing on curvature (angles between points) rather than absolute coordinates, the system remains robust to rotation and translation. Interestingly, the researchers found that "zero-order" entropy—looking at symbols in isolation—outperformed higher-order models like GZIP compression, which struggle with the limited data available in short pen strokes.
However, some limitations remain. The grouping algorithm occasionally struggles with dashed lines, and small, filled-in dots can be misclassified as text due to their concentrated, multi-directional strokes. Additionally, highly irregular shapes like resistors sit near the classification boundary, occasionally leading to ambiguity.
Conclusion
By leveraging Shannon entropy, this approach provides a robust, context-free method for separating text from shapes in digital sketches. Its success across different drawing domains suggests that entropy rate is a powerful, universal feature for sketch recognition, offering a more flexible alternative to traditional multi-feature classifiers.
Summary updated