# Patent

## Title
Retrieving electronic documents by converting them to synthetic text

## Abstract

The present invention relies on the two-dimensional information in documents and encodes two-dimensional structures into a one-dimensional synthetic language such that two-dimensional documents can be searched at text search speed. The system comprises: an indexing module, a retrieval module, an encoder, a quantization module, a retrieval engine and a control module coupled by a bus. Electronic documents are first indexed by the indexing module and stored as a synthetic text library. The retrieval module then converts an input image to synthetic text and searches for matches to the synthetic text in the synthetic text library. The matches can be in turn used to retrieve the corresponding electronic documents. In one or more embodiments, the present invention includes a method for comparing the synthetic text to documents that have been converted to synthetic text for a match.

## Background
CROSS REFERENCE TO RELATED APPLICATIONS
This application is a divisional of U.S. patent application Ser. No. 11/777,142, titled “Retrieving Electronic Documents by Converting them to Synthetic Text,” filed Jul. 12, 2007, which is incorporated by reference herein in its entirety.


BACKGROUND OF THE INVENTION
1. Field of the Invention
This invention relates generally to systems and methods for retrieving electronic documents using an image or portion of the electronic document. More particularly, the present invention is related to systems and methods for retrieving electronic documents by converting the electronic documents to synthetic text, converting an input image to synthetic text, and comparing the synthetic text for a match.
2. Description of the Related Art
The retrieval of electronic documents in the presence of noise or only given a very small part of the document is a very difficult problem. The larger the collection of documents, the more difficult the problem is. For example, retrieving an electronic text document given a blurry or illegible image of a portion of a printed page taken with a camera cell phone is difficult when the corpus of is large. This problem 100 is illustrated by FIG. 1A that shows an example image input 102 and a corresponding original electronic document 104. Furthermore, identifying the location 106 in the document 104 and the corresponding text 106 is even more difficult. This problem is only increased with the proliferation of low quality cameras and image capture devices and the ease in which they can be used to send the images.
One attempt by the prior art to solve this problem is to extract features of the image and use an index to retrieve documents containing a majority of the features. For example, inverted files are used to index individual image features. However, the features do not provide enough context information for consistent and accurate matches. Moreover, because of the poor quality of the input image it is often difficult to identify the features in the input image. Even when features can be identified in the input image, the noise degrades the information such that it is often not sufficient to find a matching electronic document. In other words, the features are incorrectly recognized leading matches to the wrong documents.
Another approach is to apply Optical Character Recognition (OCR) on the input image and the use the output of the OCR process to search the text strings of in the document. However, this suffers from the same problems noted above, namely that the image quality is so poor that OCR cannot be effectively performed. Even when it is performed, the error rate in the recognition is so high as to make the search ineffective because the matching documents are so unrelated to the original image.
SUMMARY OF THE INVENTION
The present invention overcomes the deficiencies of the prior art with a system for retrieving electronic documents by converting them to synthetic text. The present invention is particularly advantageous because it is able to match images that include a high level of noise even from a small portion of the original document to an electronic version of the document from which it was created. In other words, the present invention provides a system that extracts images features that can be reliably recognized on blurry images and yet sufficiently discriminate to differentiate between documents. The present invention also provides a computationally efficient indexing mechanism that searches for matching documents that is unaffected by features that have noise and relies on feature location in the sample image and the document.
The system of the present invention converts electronic documents to plain text documents in a synthetic language to be able to leverage existing text document retrieval algorithms that are very fast and scalable, thus enabling search of arbitrary electronic documents at text search speeds. The present invention advantageously provides full true mapping of the electronic document to plain text where the plain text is in a synthetic language and where the synthetic text representation of the document alone is sufficient to perform retrieval. More specifically, the synthetic text does not represent the natural language content of the original document if any, in contrast to OCR. The present invention relies on the two-dimensional information in documents and encodes two-dimensional structures into a one-dimensional synthetic language such that two-dimensional documents can be searched at text search speed. In one embodiment, the system comprises: an indexing module, a retrieval module, an encoder, a quantization module, a retrieval engine and a control module coupled by a bus. A number of electronic documents are first indexed by the indexing module and stored as a synthetic text library. The retrieval module then converts an input image to synthetic text and searches for matches to the synthetic text in the synthetic text library. The matches can be in turn used to retrieve the corresponding electronic documents. It should be noted that a plurality of matches and corresponding electronic documents may be retrieved ranked by order according the similarity of the synthetic text.
In one or more embodiments, the present invention includes a method for indexing documents by converting them to synthetic text, and a method for retrieving documents by converting an image to synthetic text and comparing the synthetic text to documents that have been converted to synthetic text for a match.
The features and advantages described herein are not all-inclusive, and many additional features and advantages will be apparent to one of ordinary skill in the art in view of the figures and description. Moreover, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and not to limit the scope of the inventive subject matter.



BRIEF DESCRIPTION OF THE DRAWINGS
The invention is illustrated by way of example, and not by way of limitation in the figures of the accompanying drawings in which like reference numerals are used to refer to similar elements.
FIG. 1A illustrates a high level diagram of the problem solved by the present invention.
FIG. 1B illustrates a functional diagram of an embodiment of the present invention.
FIG. 2 illustrates a block diagram for system for performing indexing and retrieval of documents in accordance with the present invention.
FIG. 3 illustrates a block diagram of one embodiment of the memory of the system of FIG. 2.
FIG. 4 illustrates a flow chart of one embodiment of the method for indexing documents in accordance with the present invention.
FIG. 5 illustrates a flow chart of a second embodiment of the method for indexing documents in accordance with the present invention.
FIG. 6 illustrates a flow chart of a third embodiment of the method for indexing documents in accordance with the present invention.
FIG. 7 illustrates a flow chart of an embodiment of the method for retrieving documents in accordance with the present invention.
FIG. 8 illustrates a flow chart of a second embodiment of the method for retrieving documents in accordance with the present invention.
FIG. 9 illustrates a flow chart of a third embodiment of the method for retrieving documents in accordance with the present invention.
FIGS. 10A-10D are diagrams illustrating the encoding of two-dimensional data into one dimensional data in accordance with one embodiment of the present invention.
FIG. 11 illustrates a diagram illustrating encoding in accordance with the second embodiment of the present invention.
FIGS. 12A and 12B illustrate the results of encoding and image patch and a base document with the overlapping matching synthetics text shown with highlighting.



DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS
A system and methods for converting electronic documents to synthetic text, and using the synthetic text for retrieving electronic documents are described below. In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the invention. It will be apparent, however, to one skilled in the art that the invention can be practiced without these specific details. In other instances, structures and devices are shown in block diagram form in order to avoid obscuring the invention.
Reference in the specification to “one embodiment,” “an embodiment” or “the embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment.
Some portions of the detailed descriptions that follow are presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm is here, and generally, conceived to be a self-consistent sequence of steps leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared and otherwise manipulated. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers or the like.
It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussion, it is appreciated that throughout the description, discussions utilizing terms such as “processing” or “computing” or “calculating” or “determining” or “displaying” or the like, refer to the action and processes of a computer system, a personal digital assistant (PDA), a cellular telephone or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.
The present invention also relates to an apparatus for performing the operations herein. This apparatus may be specially constructed for the required purposes, or it may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a computer readable storage medium, such as, but is not limited to, any type of disk including floppy disks, optical disks, CD-ROMs, and magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs), EPROMs, EEPROMs, magnetic or optical cards, or any type of media suitable for storing electronic instructions, each coupled to a computer system bus.
Finally, the algorithms and displays presented herein are not inherently related to any particular computer or other apparatus. Various general-purpose systems may be used with programs in accordance with the teachings herein, or it may prove convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will appear from the description below. In addition, the present invention is not described with reference to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the invention as described herein.
System
FIG. 1B shows a functional diagram of an embodiment of the system 150 of the present invention. The present invention advantageously identifies an original electronic document based on a very small portion and/or noisy image 152 of the document. The system 150 receives an image 152, for example of a small portion of a document from a camera such as in a cell phone (not shown). The system 150 converts the image 152 to a synthetic text representation 158, as will be described in more detail below. Preferably some time previously, the system 150 also received a plurality of electronic documents 154a-n; processed the documents to generate corresponding synthetic text; and indexed them to produce a library 160 of synthetic text documents. Then the system 105 compares the synthetic text 158 to the synthetic text library 160. In one embodiment, the comparison is performed by searching for the synthetic text 158 string in the corpus of document in the synthetic text library 106. This is particularly advantageous because any number of existing text search engines may be used for the comparison. Thus, the full power of existing text retrieval engines can be used. The matching documents 164 and locations are identified, and the index is used to retrieve the original documents 166. Then they can be presented or displayed to the user.
Referring now also to FIG. 2, a functional block diagram of the system 150 configured in accordance with embodiments of the present invention is shown. The system 150 preferably comprises a control unit 250, the display device 210, a keyboard 212 and cursor control 214. The system 150 may optionally include a communication device 216 and one or more input/output (I/O) devices 218.
The control unit 250 comprises an arithmetic logic unit, a microprocessor, a general purpose computer or some other information appliance equipped to provide electronic display signals to display device 210. In one embodiment, the control unit 250 comprises a general purpose computer having a graphical user interface, which may be generated by, for example, a program written in Java running on top of an operating system like WINDOWS® or UNIX®.
Still referring to FIG. 2, the control unit 250 is shown including processor 202, main memory 204 and data storage device 206, all of which are communicatively coupled to a system bus 208.
Processor 202 processes data signals and may comprise various computing architectures including a complex instruction set computer (CISC) architecture, a reduced instruction set computer (RISC) architecture, or an architecture implementing a one or more of instruction sets. Although only a single processor is shown in FIG. 2, multiple processors may be included.
Main memory 204 stores instructions and/or data that may be executed by processor 202. The instructions and/or data may comprise code for performing any and/or all of the techniques described herein. Main memory 204 may be a dynamic random access memory (DRAM) device, a static random access memory (SRAM) device, or some other memory device known in the art. The memory 204 is described in more detail below with reference to FIG. 3.
Data storage device 206 stores data and instructions for processor 202 and comprises one or more devices including a hard disk drive, a floppy disk drive, a CD-ROM device, a DVD-ROM device, a DVD-RAM device, a DVD-RW device, a flash memory device, or some other mass storage device known in the art. In one embodiment, the data storage device 206 includes data for presentation on the display device 210. In another embodiment, the data storage device 206 is a disk array separate from the system 150 but communicatively coupled for high speed access.
System bus 208 represents a shared bus for communicating information and data throughout control unit 250. System bus 208 may represent one or more buses including an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, a universal serial bus (USB), or some other bus known in the art to provide similar functionality. Additional components coupled to control unit 250 through system bus 208 include the display device 210, the keyboard 212, the cursor control 214, the communication device 216 and the I/O device(s) 218.
The display device 210 represents any device equipped to display electronic images and data as described herein. In one embodiment, the display device 210 is a liquid crystal display (LCD) and light emitting diodes (LEDs) similar to those on many conventional display system for computers to provide a display area and status feedback, operation settings and other information to the user. In other embodiments, the display device 210 may be cathode ray tube type display.
Keyboard 212 represents an alphanumeric input device coupled to control unit 250 to communicate information and command selections to processor 202. The keyboard 212 can be a QWERTY keyboard, a key pad, or representations of such created on a touch screen.
Cursor control 214 represents a user input device equipped to communicate positional data as well as command selections to processor 202. Cursor control 214 may include a trackball, a stylus, a pen, a touch screen, cursor direction keys or other mechanisms to cause movement of a cursor. In one embodiment, cursor control 214 is a digitizer in which a touch-sensitive, transparent panel covers the screen of display device 210.
The system 150 may optionally include the communication devices 216 and one or more input/output (I/O) devices 218 such as described below.
The communication device 216 may be a network controller that links control unit 250 to a network (not shown) via signal line 220 that may include multiple processing systems. The network of processing systems may comprise a local area network (LAN), a wide area network (WAN) (e.g., the Internet), and/or any other interconnected data path across which multiple devices may communicate. The control unit 250 also has other conventional connections to other systems such as a network for distribution of files (media objects) using standard network protocols such as TCP/IP, http, https, and SMTP as will be understood to those skilled in the art. The communication device 216 in other embodiments includes a Bluetooth® transceivers, wireless transceivers, or infrared transceivers for communication along a channel 220.
One or more I/O devices 218 are coupled to the bus 208. These I/O devices 218 are part of system 150 in one embodiment. The I/O device 218 may also include audio input/output device equipped to receive audio input via a microphone and transmit audio output via speakers. Optionally, I/O audio device 218 may contain one or more analog-to-digital or digital-to-analog converters, and/or one or more digital signal processors to facilitate audio processing. In one embodiment, I/O device 418 is a general purpose audio add-in/expansion card designed for use within a general purpose computer system. In yet another embodiment, the input/output device is a camera for the capture of still and video images and sound.
It should be apparent to one skilled in the art that the system 150 may include more or less components than those shown in FIG. 2 without departing from the spirit and scope of the present invention. For example, the system 150 may include additional memory, such as, for example, a first or second level cache, or one or more application specific integrated circuits (ASICs). Similarly, additional components may be coupled to control unit 250 including, for example, an RFID tag reader, digital still or video cameras, or other devices that may or may not be equipped to capture and/or download electronic data to control unit 450. One or more components could also be eliminated.
FIG. 3 is a block diagram of one embodiment of the memory unit 204 for the system 150. The memory unit 204 preferably comprises: an operating system 302, an application 304, an indexing module 306, a retrieval module 308, an indexed document storage 310, a snake encoder 312, a SIFT encoder 314, a quantization module 316, a retrieval engine and a control module 320. Those skilled in the art will recognize that the memory 204 also includes buffers for temporarily storing data. The memory 204 stores instructions and/or data that may be executed by processor 202. The instructions and/or data comprise code for performing any and/or all of the techniques described herein. These modules 302-320 are coupled by bus 208 to the processor 202 for communication and cooperation. Those skilled in the art will recognized that while the present invention will now be described as modules or portions of a memory 204, the modules or portions thereof may also be stored in other media such as permanent data storage device 406.
The operating system 302 is one of a conventional type such as WINDOWS®, SOLARIS®, BREW®, SYMBIAN®, MAC-OS or a LINUX® based operating system.
The memory 204 may also include one or more application programs 304 including, without limitation, drawing applications, word processing applications, electronic mail applications, financial applications and web browser applications.
The indexing module 306 includes software and routines for indexing an original electronic document or an image in accordance with the present invention. The indexing module 306 begins with an electronic version of a document. This can be the original document, an image of the original document, or alternatively it can be a portion of an image of the original document with a high level of noise. Basically, the indexing module 306 generates synthetic text for an electronic document it receives. The indexing module 306 also associates documents, pages and locations within a page for the synthetic text generated. This allows the synthetic text to be used is as an index back to the original electronic document. In one embodiment, the indexing module 306 receives an electronic document, identifies bounding boxes for text and other content within the electronic document, and converts the bounding boxes to synthetic text. In one embodiment, a synthetic word is created for every bounding box in the image. Various implementations for the indexing module 306 are described in more detail below with reference to FIGS. 4-6. In order to perform indexing, the indexing module 306 is communicatively coupled to the snake encoder 312, the SIFT encoder 314, and the quantization module 316. These components 312, 314 and 316 and their cooperation with the indexing module 306 are described below. It should also be understood that the indexing module 306 is used to create the synthetic text library 160. Once a document has been processed by the indexing module 306, its corresponding synthetic text can be stored in the indexed document storage 310. The corpus of synthetics text representations stored in the indexed storage 310 form a synthetic text library 160.
The retrieval module 308 includes software and routines for retrieving one or more documents corresponding to an input image. The retrieval module 308 works in conjunction with the indexing module 306 to convert an input image into synthetic text. The retrieval module 308 uses the synthetic text string generated by processing the input image with the indexing module 306 to search the indexed document storage 310. The retrieval module 308 is communicatively coupled to cooperate with the retrieval engine 318 and provides the searching functionality. Additionally, the retrieval module 308 retrieves one or more original electronic documents corresponding to portions of matching synthetic text from the synthetics text library 160. In one embodiment, the retrieval module 308 presents an ordered list of the documents most likely to match the input image. The functionality of the retrieval module 308 is described in more detail below with reference to FIGS. 7-9.
The indexed document storage 310 is storage of a conventional type. It may be a combination of both volatile and non volatile storage. The indexed document storage 310 stores original electronic images or documents, corresponding synthetic text and an index between the synthetic text and the original electronic images or documents. For example, in one embodiment the indexed document storage includes: an electronic document in a computer readable form such as an XML file, synthetic text corresponding to the XML file and an index between the XML file and synthetic text. In another embodiment for example, the indexed document storage may include an original application file (E.g., an MS-Word file), an image file representing how the application file would be printed or displayed, synthetic text and one or more indexes between a synthetic text and the application file.
The snake encoder 312 and SIFT encoder 314 are two exemplary encoders that can be used by the present invention to generate the synthetic text. These encoders 312, 314 can be used individually or collectively. Those skilled in the art will recognize that a variety of other types of encoders may be used to generate the synthetic text from the input images. In another embodiment, a spiral encoder is used. A spiral encoder is similar to the snake encoder described below in that it is based on bounding boxes and produces one synthetic word for each bounding box. It uses the same principle of creating a path starting at each word, and then encoding this path. The path is a spiral around the word, connecting the centers of words, and what is encoded are the angles of the segments, and/or the relative lengths of the 2 words joined by the segments, and/or the aspect ratio of bounding boxes, or other similar parameters that will be understood by those skilled in the art. In yet another embodiment, the encoder is a graph encoder. Graph encoders are a family of encoders based on bounding boxes that produces a graph for each bounding box. Although some bounding boxes may not be used in different variations, or a graph is made for each pair of words, or group of three words, or the graph could be non-continuous, or not be a path—e.g. Star shaped and encodes some parameters of this graph as features. Snake encoders and spiral encoders are two embodiments of graph encoders.
The snake encoder 312 includes software and routines for encoding an image into synthetic text. In particular, the snake encoder 312 is adapted for encoding documents including western character-based languages. In particular, snake coding converts a page of written Western scripts into a sequence of feature vectors. So a sequence of few of these vectors extracted from an image of a patch of text in which bounding boxes of words can be extracted can be used to uniquely identify the original location within a document database. Referring now also to FIGS. 10A-10D, the process performed by the snake encoder 312 will be described in detail. In this embodiment, the layout of bounding boxes of words is converted to features to identify a particular location within a document database (document ID, page number and x, y location on the page). In particular, the geometry of neighboring bounding boxes is encoded into a word of synthetic text. In one embodiment, one word of synthetic text is generated for each bounding box on a page. For a given bounding box 1008, the encoding stores information about the relative location and size of the bounding boxes in a piecewise linear path that starts at the center of the bounding box 1008 and joining the centers of bounding boxes below alternating between left and right. FIG. 10A illustrates a document image 1002 including a plurality of bounding boxes. An example encoding for the given bounding box 1008 that uses the centers 1004 of bounding boxes in a path from the given bounding box to the bottom of the image to generate a snake-like path 1006 is shown. It should be understood that in an alternate embodiment, the encoding could be modified such that the snake pattern was continued only a predefined number of bound boxes below the given bounding box 1008. This unique path is coded as a string. The path for the given bounding box 1008 goes first to the bounding box below and to the left, and then it alternates between right and left. Each element in the feature vector corresponds to an angle that has been quantized. A particular example is shown in FIG. 10A. Each character in the string corresponds to an angle that has been quantized. The odd numbered characters in the string describe the relative location of the bounding boxes in the path. Referring also to FIG. 10B, for the given path 1006, the odd number characters in the string are shown as a quantized an angle to the next bounding box—for example—α 1014, γ 1016, ε 1018, and θ 1020. Referring now also to FIG. 10C, for the given path 1006 the even numbered characters describe the width of those succeeding boxes as a quantized an angle—for example—β1024, δ1026, ζ1028, and η 1030. Thus the synthetic text corresponding to the bounding box 1008 is the string α β γ δ ε ζ θ η 1040 as illustrated in FIG. 10D. The use of this encoding mechanism is particularly advantageous for a number of reasons. First, the use of angles advantageously makes the encoding scale independent. Therefore even though the scale of the input image from a camera differs greatly from the original image, the two images will be recognized as a match by the present invention. Second, the length of the snake can be adapted according to collection size and the level quantization. The length of the snake can be any number of lines from two lines to the remaining number of lines until the bottom of the page is reached. This is particularly advantageous because it allows the present invention to be adapted to the amount of processing power available and/or needed based on the size of the synthetic library 160.
In one embodiment, every page of every document that is wanted in the index undergoes encoding according to the process described above. This means that every bounding box on a page produces a synthetic word. For printed documents, the bounding boxes can be obtained from the printer driver, which is typically more efficient than two dimensional image processing. This is the synthetic text resulting from encoding each page is indexed and stored in the indexed document storage 310.
The SIFT encoder 314 includes software routines for encoding an image into synthetic text. In particular, the SIFT encoder 314 is adapted for encoding documents including eastern ideographic languages. The SIFT encoder 314 performs a function similar to that of the snake encoder 312. The SIFT encoder 314 generates feature vectors based on Scale Invariant Feature Transformation (SIFT) features in a document. In particular, SIFT features align along the lines of text when applied to documents contain Asian scripts of the giving making them suitable for the present invention. Referring now also to FIG. 11, an example of SIFT features for a document having Asian characters is shown. A SIFT feature is produced for each inter-character region. Each SIFT feature is converted to a word in the synthetic language through clustering and quantization. The ordering of SIFT features along lines of text enables the present invention to convert the series of words into paragraphs.
Those skilled in the art will recognize that various other encodings may be used in place of the snake encoder 312 or the SIFT encoder 314. Snake coding has the fundamental property of being able to encode a two-dimensional layout into a one-dimensional text string. The key principle is to encode vertical layout information as a sequence of letters within a word, and horizontal information as a concatenation of words. This is similar to storing a 2D matrix as a vector by storing one column after another. Other encodings are possible with the same property. Also encodings that can encode patches containing images or a mixture of images and text are possible. Snake coding uses a local approach to quantize feature vectors (i.e. the angles in the path) into words. Namely is angle is quantized separately. In alternate embodiments, a mechanism of encoding groups of features or words based on classifier may be used. In this approach a classifier is trained to classify a given path into one of a few thousand categories. Then a word encoding the category would actually be used to store the path. The classifier would be built using unsupervised clustering given many observed paths as training examples. In a more sophisticated instance many paths corresponding to the same layout, obtained through artificial imaging of a patch, are presented to the classifier with the constraint that they should be assigned to the same cluster, with the goal of achieving a classifier more robust to image noise. Similarly the classes for which instances are confused in the validation phase could be given “similar” words, so that when performing text search the two classes would be considered close under some form of edit distance (this already happens naturally in the current implementation of snake coding.)
The quantization module 316 includes software routines for cooperating with the snake encoder 312 or the SIFT encoder 314 to adjust and optimize the encoding. In one embodiment, the quantization of the angles (converting angles to characters) is done by quantizing linearly the tangent of the angle (y=x) to avoid trigonometric computations. For example, one quantization is shown below in Table 1.










TABLE 1







Angle Range
Text









 0-10
A



11-20
B



21-30
C



31 or greater
D










The actual size of the bins can be adjusted. Coarser bins will produce fewer errors when quantizing bounding boxes are obtained from a noisy image, but also less unique patterns. Such a coarser quantization is shown in Table 2 below.










TABLE 2







Angle Range
Text









 0-15
a



15-30
b



31 or greater
c










In the Snake encoder, noise affects differently even and odd characters as they encode different geometric properties. Thus in one embodiment a different quantization of odd and even characters is provided. In one embodiment, a sensitivity analysis is performed to produce the quantization as different bins may experience different noise levels due to the geometry of the problem. In yet another embodiment, the present invention can employ quantization at multiple levels. For example, the library of synthetic text may be created such that includes two levels of quantization for each document. The first level quantization is of course, over inclusive level quantization. The second level quantization is that a finer level with the increased accuracy. The retrieval module 308 could then operate by first using the first level quantization to identify a subset of documents in the corpus of documents stored in the indexed document storage 310. Then the second level quantization could be used to retrieve yet a smaller subset of documents from the identified first subset to increase the accuracy and speed at which documents could be recognized.
The retrieval engine 318 is software and routines for comparing a string of synthetic text to a library of synthetic text. One of the particular advantages of the present invention is that it is able to leverage and scale upon existing search engine technology. Thus the retrieval engine 318 may be any more variety of commercial search engines presently available such as from Google, Yahoo, Overture, etc. Any search engine capable of searching for a text string and returning results with a page rank order may be used. The retrieval engine 318 receives a string of synthetic text generated by the indexing module 306 and searches for matching patterns in the synthetic library 160 stored in the indexed document storage 310. The retrieval engine 318, in one embodiment, interacts and is under the control of the retrieval module 308 to perform the image matching of the present invention.
The control module 320 is software routines for controlling the processes of the present invention. In particular, the control module 320 interacts with the other components of the memory unit 204 in accordance with the methods that are described below with reference to FIGS. 4-9. While the control module 320 is shown here as a separate module controlling the other modules of the memory 204, those skilled in the art will recognize that this control functionality may be distributed amongst the other modules of the memory 204 and the control module 220 may be omitted.
Methods
FIG. 4 illustrates a flow chart of one embodiment of the method for indexing documents in accordance with the present invention. The method begins by receiving or retrieving 402 an electronic document. Then, the method then defines 404 a two-dimensional structure for encoding. In one embodiment, the two-dimensional structure is a bounding box as has been described above with reference to FIG. 10. In an alternate embodiment, the two-dimensional structure is a SIFT feature as has been described above with rooms to FIG. 11. Next the method identifies 406 two-dimensional structures in the electronic document received in step 402. Then the method encodes 408 the identified two-dimensional structures into a one-dimensional structure. This encoding can use any one of the encoding methods that have been described above. Then a document and location are associated 410 with the one-dimensional structure. Finally, the method stores 412 the association and the corresponding one-dimensional structure, for example in a database. This process is repeated for a plurality of two-dimensional structures in the electronic document, for example there maybe numerous association/one-dimensional structure pairs for a page of a given document. Moreover, any number of documents can be used to build a library 160 of synthetic text that later be used in retrieval to locate the corresponding electronic documents.
Referring now to FIG. 5 illustrates a second embodiment of the method for indexing documents in accordance with the present invention will be described. The method begins by receiving or retrieving 502 an electronic document. Next, the method defines a two-dimensional structure for encoding by defining 504 bounding boxes around words within the electronic document. Each of the bounding boxes within the electronic document is next identified 506. Then, the spatial relationships between the bounding boxes identified in the electronic document are encoded 508 to synthetic text. In particular, a graph encoder (such as the snake encoder 312) is used to generate a text string for each bounding box within the electronic document. The letters of the synthetic text (e.g., a text string) generated in the encoding step 508 are then associated with a document and a location within the document from which they were generated. For example, document ID, the page and the x, y location of the bounding box within the electronic document are associated with the text string. Finally, this association is stored 512. For example, the synthetic text, document name and location in the document may be stored together in a lucene index.
FIG. 6 illustrates a third embodiment of the method for indexing documents in accordance with the present invention. This third embodiment is designed for use with documents having Asian languages or ideographic characters. The third embodiment of the method for indexing documents begins by receiving/retrieving 602 an electronic document. In this method, SIFT features are defined 604 for each character/word/intercharacter space in the electronic document. Next, the SIFT features in the electronic document are identified 606. Then the spatial relationships of the SIFT features are encoded 608 into the synthetic text. For example, the SIFT encoder 314 can be used to generate text strings from the SIFT features in a document image. Next, the synthetic text is then associated 610 with a document, page, and location on the page corresponding to the SIFT feature from which the text string was generated. This information is then stored 612 in the database.
Referring now to FIG. 7, an embodiment of the method for retrieving documents in accordance with the present invention will be described. The method begins by encoding 702 at least one original document to a one-dimensional structure as has been described above with reference to FIG. 4. Alternatively, the method may assume that there already exists a library of synthetic text that has been created over time and is accessible for comparison. Then the method receives 704 an image patch. For example, an image patch 152 such as shown in FIG. 1B is received. Then the method identifies 706 one or more two-dimensional structures 1008 in the image patch 152. Those skilled in the art will recognize that such two-dimensional structures may take a variety of different formats such as bounding boxes or a variety of other different shaped polygons reflecting either areas of image data or areas of white space. Then the method encodes 708 the two-dimensional structure(s) of the image patch 152 identified in step 706 into a one-dimensional structure. Using the encoded one-dimensional structure, the method then searches 710 for any matching one-dimensional structures in the encoded original electronic documents. Those skilled in the art will recognize that a variety of conventional search engines may be used to compare one-dimensional structures such as text. The present invention is particularly advantageous because text searches are used. Text searches are advantageous because they may be quickly performed on a large corpus of documents. Furthermore, the text search can leverage existing search technologies and perform a prefix search, provide matching scores, and rank the matches according to a variety of different parameters. The present invention is particularly advantageous because it can use any variety of existing search engines for searching. As with conventional search engines, this searching step may yield a plurality of matching results ordered on a variety of different parameters. Once a matching one-dimensional structure from the encoded original electronic documents has been identified, the method retrieves 712 the original document corresponding to the matching one dimensional structure. This retrieval step can include retrieving the particular page and location corresponding to the match and presenting it to the user. One of the particular advantages of the present invention is that unlike other matching technologies, the combination of the use of synthetic text, utilizing existing search technology, and allowing the quantization to be adjusted results in document retrieval with greater accuracy and fewer false positive results.
Referring now to FIG. 8, a second embodiment of the method for retrieving documents in accordance with the present invention will be described. The method begins by encoding 802 a plurality of electronic documents to synthetics text as has been described above with reference to FIG. 4. This step is performed repeatedly overtime to create a library of synthetic text that may be searched to find matching electronic documents. Next the method receives 804 an image patch 152. Then the method identifies 806 one or more bounding boxes 1008 for words within the image patch 152. Next, the method encodes 808 the bounding boxes 1008 in the image patch 152 to synthetic text. In the present invention, the encoding is preferably done by individually selecting each bounding box and then performing snake encoding for that bounding box to the bottom edge of the image patch. The end result is that each bounding box in the image patch will be converted to a string of synthetic text. The results of the encoding described above in step 808 can then be used to search within the previously encoded original electronic documents. Since the original documents have been encoded in this synthetic text and a patch is also encoded in the synthetic text, this searching becomes a simple task of comparison. For increased accuracy the text comparison can be augmented as will be understood by those skilled in the art and as is done for conventional Internet search engines. Furthermore, to improve recognition, the synthetic text for the input image could be modified, such as not generating synthetic text for any bounding box on the edge of the patch, thereby avoiding any of the edge effect of caused by the size of the patch. Once a match has been found in the searching step 810, the method retrieves at least one original document corresponding to the matching synthetic text. As has been noted above, all the matches to the synthetic patch can be presented to the user in rank order in a manner similar to how web pages are represented.
Referring now to FIG. 9, a third embodiment of the method for retrieving documents in accordance with the present invention will be described. The method shown in FIG. 9 is similar to the methods described above with reference to FIGS. 7 and 8, however, it is directed towards retrieving documents where the input image patch includes SIFT features. The method has steps almost identical to those described above with reference to FIG. 8. It should be noted, however, that the step of identifying features 906 in the image patch identifies SIFT features. Similarly, the step of encoding 908 utilizes the SIFT encoder 314 to convert the SIFT features to a string of synthetic text. Otherwise, the method of FIG. 9 is similar to the methods that have been described above and has all the same advantages while operating on documents containing Asian idea graphic languages.
FIGS. 12A and 12B illustrate the results of encoding and image patch and a base document with the overlapping matching synthetics text shown with highlighting. FIG. 12A illustrates an example of synthetic text resulting from the processing of an image patch. FIG. 12B illustrates a library of synthetic text corresponding to hit the rally of electronic documents. The areas in FIGS. 12A and 12B illustrate corresponding matches between the input synthetic text and a library of documents. These instances of matching strings can then be rank ordered according to likelihood of an exact match. Additionally the corresponding original documents that generated the portion of the library of synthetic text can also be retrieved and presented to the user in conjunction with the rank ordering of the matches.
Those skilled in the art will recognize that the present invention can be enhanced by employing different search strategies. The description above has assumed the use of a conventional search engine and input of the synthetic text generated from processing the input image patch. However, when an image is taken, a paragraph is produced in a new lexicon. This paragraph constitutes the query by which the original document is retrieved. However when presented to the text search engine, it may be advantageous to add words to the query incrementally using previous results to refine the query. For example, alternate spellings (e.g. due to likely quantization errors when a value is in the proximity of a quantization boundary) can be created and input to the search engine. Such alternate search strategies can be optimized by considering 1) the need for prefix search, as the lines visible in a patch may not reach far down enough in the page to produce the complete word; 2) the redundancy in the encoding. For example typically when using a snake encoder, the top two lines in the patch contain most of the information and thus it may be sufficient to submit them as query; and 3) the possibility that noise may alter some letters of the encoding in a predictable way, for example because the value was close to the quantization boundary.
A specific modification to the above embodiment is to employ spelling variations in. For example, likely spelling variations for every term in a spiral coding query can be used to increase accuracy. This approach considers the distance of the floating point features encoded in each term to the quantization boundary that determines the letter that the given feature will be encoded as. Features that are closer to the quantization boundaries are more likely to be changed by noisy imaging. Using this new approach fewer alternative spellings are generated, thus decreasing the number and score of false positives. This improvement can be used to increasing the speed of recognition (because fewer spelling variations are tested), and/or to increase scalability maintaining the number of spelling variations per term approximately constant (query time and recognition rate will also stay approximately constant.) This can be achieved increasing the number of bits per encoded feature, which will increase the misspelling rate, but also the uniqueness of each term.
The foregoing description of the embodiments of the present invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the present invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. For example, the systems and methods of the present invention may be used for other applications such as but not limited to comparing music, comparing fingerprint signatures, or comparing images of faces. In all these other applications, the original input is converted to text compared to a library of synthetic text. Specifically, a very small clip of music may be converted to synthetic text where notes are converted to characters inappropriately grouped into words and then compared to a library of music that has been converted to synthetic text to determine a match. Similarly, fingerprint matching can be ordered and thus the method can be applied using a procedure analogous to that described above for Asian characters. It is intended that the scope of the present invention be limited not by this detailed description, but rather by the claims of this application. As will be understood by those familiar with the art, the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. Likewise, the particular naming and division of the modules, routines, features, attributes, methodologies and other aspects are not mandatory or significant, and the mechanisms that implement the present invention or its features may have different names, divisions and/or formats. Accordingly, the disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the present invention, which is set forth in the following claims.

## Claims

1. A method for retrieving an electronic document in response to receipt of an image patch, the method comprising:
receiving the image patch;
identifying a first two-dimensional structure in the image patch;
identifying a second two-dimensional structure in the image patch;
identifying a third two-dimensional structure in the image patch;
generating a first text string that encodes the first two-dimensional structure into a first one-dimensional structure by specifying a location of the first two-dimensional structure, a first quantized angle measured between a line originating from the first two-dimensional structure and a path joining a center of the first two-dimensional structure to a center of the second two-dimensional structure and a second quantized angle defining a path joining a center of the second two-dimensional structure to a center of the third two-dimensional structure;
searching, from a library, for a second one-dimensional structure that is similar to the first one-dimensional structure of the image patch; and
retrieving the electronic document corresponding to the second one-dimensional structure similar to the first one-dimensional structure of the image patch from a document storage.

2. The method of claim 1, further comprising determining the first and the second quantized angles using a plurality of quantization levels.

3. The method of claim 1, wherein the first, the second and the third two-dimensional structures in the image patch each include a bounding box for words.

4. The method of claim 1, wherein the first, the second and the third two-dimensional structures in the image patch include a Scale Invariant Feature Transform (SIFT) feature in the image patch.

5. The method of claim 1, further comprising:
encoding a plurality of electronic documents to corresponding one-dimensional structures; and
storing the plurality of electronic documents, the one-dimensional structures and associations between the plurality of electronic documents and the corresponding one-dimensional structures in the document storage.

6. The method of claim 1, wherein the first and the second one-dimensional structures include text, and the searching is performed by a conventional search engine.

7. The method of claim 1, wherein retrieving further comprises:
retrieving a plurality of electronic documents from the document storage;
determining a rank order based at least in part on a similarity between the second one-dimensional structure in each of the plurality of electronic documents and the first one-dimensional structure of the image patch; and
presenting the plurality of electronic documents in the rank order.

8. A system for retrieving an electronic document in response to receipt of an image patch, the system comprising:
a processor;
an indexing module stored on a memory and executable by the processor, the indexing module receiving the image patch, identifying a first two-dimensional structure in the image patch, identifying a second two-dimensional structure in the image patch and identifying a third two-dimensional structure in the image patch;
an encoder coupled to the indexing module, the encoder generating a first text string that encodes the first two-dimensional structure into a first one-dimensional structure by specifying a location of the first two-dimensional structure, a first quantized angle measured between a line originating from the first two-dimensional structure and a path joining a center of the first two-dimensional structure to a center of the second two-dimensional structure and a second quantized angle defining a path joining a center of the second two-dimensional structure to a center of the third two-dimensional structure;
a retrieval engine coupled to the indexing module, the retrieval engine searching, from a library, for a second one-dimensional structure that is similar to the first one-dimensional structure of the image patch; and
a retrieval module coupled to the indexing module, the retrieval module retrieving the electronic document corresponding to the second one-dimensional structure similar to the first one-dimensional structure of the image patch from a document storage.

9. The system of claim 8, further comprising a quantization module coupled to the encoder, the quantization module determining the first and the second quantized angles using a plurality of quantization levels.

10. The system of claim 8, wherein the first, the second and the third two-dimensional structures in the image patch each include a bounding box for words.

11. The system of claim 8, wherein the first, the second and the third two-dimensional structures in the image patch include a Scale Invariant Feature Transform (SIFT) feature in the image patch.

12. The system of claim 8, further comprising the indexing module:
encoding a plurality of electronic documents to corresponding one-dimensional structures; and
storing the plurality of electronic documents, the one-dimensional structures and associations between the plurality of electronic documents and the corresponding one-dimensional structures in the document storage.

13. The system of claim 8, wherein the first and the second one-dimensional structures include text, and the searching is performed by a conventional search engine.

14. The system of claim 8, wherein the retrieval module retrieving the electronic document further comprises:
retrieving a plurality of electronic documents from the document storage;
determining a rank order based at least in part on a similarity between the second one-dimensional structure in each of the plurality of electronic documents and the first one-dimensional structure of the image patch; and
presenting the plurality of electronic documents in the rank order.

15. A computer program product for retrieving an electronic document in response to receipt of an image patch comprising a non-transitory computer usable medium including a computer readable program, wherein the computer readable program when executed on a computer causes the computer to:
receive the image patch;
identify a first two-dimensional structure in the image patch;
identify a second two-dimensional structure in the image patch;
identify a third two-dimensional structure in the image patch;
generate a first text string that encodes the first two-dimensional structure into a first one-dimensional structure by specifying a location of the first two-dimensional structure, a first quantized angle measured between a line originating from the first two-dimensional structure and a path joining a center of the first two-dimensional structure to a center of the second two-dimensional structure and a second quantized angle defining a path joining a center of the second two-dimensional structure to a center of the third two-dimensional structure;
search, from a library, for a second one-dimensional structure that is similar to the first one-dimensional structure of the image patch; and
retrieve the electronic document corresponding to the second one-dimensional structure similar to the first one-dimensional structure of the image patch from a document storage.

16. The computer program product of claim 15, wherein the computer readable program when executed on the computer further causes the computer to determine the first and the second quantized angles using a plurality of quantization levels.

17. The computer program product of claim 15, wherein the first, the second and the third two-dimensional structures in the image patch each include a bounding box for words.

18. The computer program product of claim 15, wherein the first, the second and the third two-dimensional structures in the image patch include a Scale Invariant Feature Transform (SIFT) feature in the image patch.

19. The computer program product of claim 15, wherein the computer readable program when executed on the computer further causes the computer to:
encode a plurality of electronic documents to corresponding one-dimensional structures; and
store the plurality of electronic documents, the one-dimensional structures and associations between the plurality of electronic documents and the corresponding one-dimensional structures in the document storage.

20. The computer program product of claim 15, wherein the computer readable program when executed on the computer further causes the computer to retrieve the electronic document by:
retrieving a plurality of electronic documents from the document storage;
determining a rank order based at least in part on a similarity between the second one-dimensional structure in each of the plurality of electronic documents and the first one-dimensional structure of the image patch; and
presenting the plurality of electronic documents in the rank order.