Mining Historical Documents for Near-Duplicate Figures

24
Mining Historical Documents for Near-Duplicate Figures Thanawin (Art) Rakthanmanon Qiang Zhu Eamonn Keogh

description

Mining Historical Documents for Near-Duplicate Figures. Thanawin (Art) Rakthanmanon Qiang Zhu Eamonn Keogh. What is a near-duplicate pattern?. Two books about Diatoms. Biddulphia alternans. A History of Infusoria , including Desmidiaceae and Diatomaceae , 1861. - PowerPoint PPT Presentation

Transcript of Mining Historical Documents for Near-Duplicate Figures

Page 1: Mining Historical Documents for  Near-Duplicate Figures

Mining Historical Documents for Near-Duplicate Figures

Thanawin (Art) RakthanmanonQiang Zhu

Eamonn Keogh

Page 2: Mining Historical Documents for  Near-Duplicate Figures

2

What is a near-duplicate pattern?

A History of Infusoria, including Desmidiaceae and Diatomaceae, 1861.

Biddulphia alternans

A Synopsis of the British Diatomaceae, 1853.

Two books about Diatoms

Page 3: Mining Historical Documents for  Near-Duplicate Figures

3

Motivation

• There are about 130 million books in the world (according to Google 2010)

• Many are now digitized• Finding repeated patterns can ..

– allow us to trace the evolution of cultural ideas– allow us to discover plagiarism– allow us to combine information

from two different sources

Page 4: Mining Historical Documents for  Near-Duplicate Figures

4

Problem Statement

• Given 2 books and user-defined parameters (i.e. size of motifs), find similar patterns/figures between these books in reasonable amount of time.

What is a “reasonable amount of time”?• It can take minutes to hours to scan a book. • We would like to be able to discover similar

figures in minutes or tens of minutes.– This could be done offline (a "screensaver" could work

on you personal library at night).

Page 5: Mining Historical Documents for  Near-Duplicate Figures

5

Objectives

• We propose an algorithm to discover similar patterns inside a manuscript or across 2 manuscripts.

• Our scalable method consider only shape so input documents can be b/w or color documents.

• Our method will return approximately repeated shape patterns in small amount of time.

Page 6: Mining Historical Documents for  Near-Duplicate Figures

6

Example Results (1)

• Two Petroglyph (Rock Art) Books

[1] Indian Rock Art of Southern California with Selected Petroglyph Catalog, 1975.

[2] Sudamerikanische Felszeichnungen (South American Petroglyphs), Berlin, 1907.

1st book (233 figures) 2nd book (2,852 figures)

[1] [2]

Similar Figures

Page 7: Mining Historical Documents for  Near-Duplicate Figures

7

Example Results (2)• 25 seconds to find motifs across 2 books of size

478 pages and 252 pages.

Page 8: Mining Historical Documents for  Near-Duplicate Figures

8

Example Results (3)

• Similar figures from 4 different books are discovered. Book1 [3]: Scottish Heraldry (243 pages)

Book3 [5]: British Heraldry (252 pages)

Book2 [4]: Peeps at Heraldry (110 pages)

Book4 [6]: English Heraldry (487page)

Page 9: Mining Historical Documents for  Near-Duplicate Figures

9

Example Results (4)• Also works well for handwritten documents.

IAM dataset from Research Group on Computer Vision and Artificial Intelligence, University of Bern

Page 10: Mining Historical Documents for  Near-Duplicate Figures

10

Overview of Our Algorithm

HashingHash Signature

Compute all pair distances(GHT-based distance)

1500x1000 pixel2

DownSampling

300x200 pixel2

LocatePotentialWindows

18 potential windows

Page 11: Mining Historical Documents for  Near-Duplicate Figures

11

Locating Potential Windows

• Humans easily locate the figures. How?

Document contain black and white pixels

Count the number of black pixels using moving rectangle

Figure Positions locate at the peaksRemove noise by using threshold

Our observations ...

50,000 windows reduce to 20 potential windows.

Page 12: Mining Historical Documents for  Near-Duplicate Figures

12

Down Sampling

• Reduce search space. • Increase the quality of matching.

Overlap 82%

Overlap only 16%

Page 13: Mining Historical Documents for  Near-Duplicate Figures

13

Random Projection

• Hashing is an efficient way to reduce the number of expensive real distance calculations.

Mask template

Mask template

Remove Enough

Remove Enough

Same Signature

Remove 50% 10 times

Page 14: Mining Historical Documents for  Near-Duplicate Figures

14

GHT-based Distance Calculation

(1) GHT-based distance measure correctly groups all seven pairs.

(2) The higher level structure of the dendrogram also correctly groups similar petroglyphs.

Figure and Equation from [14] Q. Zhu, X. Wang, E. Keogh and S.H. Lee, “Augmenting the Generalized Hough Transform to Enable the Mining of Petroglyphs,” SIGKDD, 2009

GHT = Generalized Hough Transform

Atlatls

Anthropomorphs

Bighorn Sheep

Page 15: Mining Historical Documents for  Near-Duplicate Figures

15

Overview of Our Algorithm

DownSampling

LocatePotentialWindows

HashingHash Signature

Compute all pair distances(GHT-based distance)

1500x1000 pixel2 300x200 pixel2 18 potential windows

Page 16: Mining Historical Documents for  Near-Duplicate Figures

16

Experimental Results• The performance of our algorithm depends on dataset.• We created artificial “books” to test on.• Each page of book contains 100 random figures.• Each characters contains 14 segments (16K different figures).

Polynomial Distortion

Gaussian Noise

Page 17: Mining Historical Documents for  Near-Duplicate Figures

17

Experimental Results• Our algorithm can find similar figures (motifs) from 100-

page book in less than a minute.

0

0.5

1.0

1.5

2.0

2.5

3.0x 10

4

Exe

cutio

n T

ime

(se

c)

Number of Pages

Best known algorithm to findexact motif (All Windows)

Exact Motif (Potential Windows)

DocMotif

1 2 4 8 16 32 64 128 256 512

6.9 hours

5.5 minutes

Page 18: Mining Historical Documents for  Near-Duplicate Figures

18

Scalability

Exe

cutio

n T

ime

(sec

)

Number of Pages1 2 4 8 16 32 64 128 256

0

1

10

100250

Effect of Gaussian NoiseVar = 0.20

No noiseVar = 0.01Var = 0.05Var = 0.10Var = 0.15

Scalability

0

500

1000

1500

2000

Exe

cutio

n T

ime

(sec

)

Polynomial distortion

No distortion

1 2 4 8 16 32 64 128 256 512 1024 2048

Number of Pages

Sample Motifs

Effect of Distortion

Page 19: Mining Historical Documents for  Near-Duplicate Figures

19

How Good of the Results?

2 4 8 16 32 64 128 256 51205

1015202530

Mask 50%Mask 40%Mask 30%Mask 20%BruteForce

Ave

rage

Dis

tanc

e Masking Ratio

A

2 4 8 16 32 64 128 256 51205

1015202530

Ave

rage

Dis

tanc

e

iteration=5iteration=9iteration=10iteration=11iteration=20BruteForce

Number of Iterations

C

Number of pages

2 4 8 16 32 64 128 256 51205

1015202530

Ave

rage

Dis

tanc

e

HDS=2 (4:1)HDS=3 (9:1)BruteForce

Hash Downsampling

B

• The average distances from top 20 motifs are not much different among different parameter choices.

Page 20: Mining Historical Documents for  Near-Duplicate Figures

20

Parameter Effects

10 iterations

9 iterations

1 2 4 8 16 32 64 128 256 512

Number of Pages

0

100

200

300

400

Exe

cutio

n T

ime

(sec

)

Number of Iterations

11 iterationsC

1 2 4 8 16 32 64 128 256 512

0

100

200

300

400

Exe

cutio

n T

ime

(se

c)

HDS=3 (9:1)

HDS=2 (4:1)

HDS=1 (1:1)

Hash Downsampling

B

Number of Pages

0

100

200

300

400

500

600

700

Exe

cutio

n T

ime

(se

c) Masking Ratio

20%30%

40%

50%

1 2 4 8 16 32 64 128 256 512

A

Number of Pages

Page 21: Mining Historical Documents for  Near-Duplicate Figures

21

Conclusion• An algorithm to find similar figures across two manuscripts.

– Approximation algorithm– Work pretty well on both figures and text– Practical: very fast and very similar

• Key Ideas– Locating potential windows– Down Sampling– Random Projection– GHT-based Distance

• Drawbacks– Not support rotation invariance– Many parameters but not much sensitive

Page 22: Mining Historical Documents for  Near-Duplicate Figures

22

References1. G. Ramponi, F. Stanco, W. D. Russo, S. Pelusi, and P. Mauro, “Digital automated restoration of manuscripts and

antique printed books,” EVA - Electronic Imaging and the Visual Arts, 2005.2. J. V. Richardson Jr., “Bookworms: The Most Common Insect Pests of Paper in Archives, Libraries, and Museums.” 3. A. Pritchard, “A history of Infusoria, including Desmidiaceae and Diatomaceae,” British and foreign. Ed. IV. 968.

London, 1861.4. W. Smith, “A synopsis of the British Diatomaceae; with remarks on their structure, function and distribution; and

instructions for collecting and preserving specimens,” vol. 1 pp. [V]-XXXIII, pp. 1-89, 31 pls. London: John van Voorst, 1853.

5. W. West, G S.. West, “A Monograph of the British Desmidiaceae,” Vols. I–V. Ray Society, London, 1904–1922.6. C. R. Dod, R. P. Dod, “Dod’s Peerage, Baronetage and Knightage of Great Britain and Ireland for 1915,” London:

Simpkin, Marshall, Hamilton, Kent and co. ltd, 1915.7. J. B. Burke, “Book of Orders of Knighthood and Decorations of Honour of all Nations,” London: Hurst and Blackett, pp.

46-47, 1858.8. B. Gatos, I. Pratikakis, and S. J. Perantonis, “An adaptive binarisation technique for low quality historical documents,”

Proc. of Int. Work. on Document Analysis Sys., pp. 102–13.9. E. Kavallieratou and E. Stamatatos, “Adaptive binarization of historical document images,” Proc. 18th International

Conf. of Pattern Recognition, pp. 742–745. 10. H. J. Wolfson and I. Rigoutsos, “Geometric Hashing: An Overview,” IEEE Comp’ Science and Engineering, 4(4), pp. 10-

21, 1997.11. X. Bai, X. Yang, L. J. Latecki, W. Liu, and Z. Tu, “Learning context sensitive shape similarity by graph transduction,” IEEE

TPAMI, 2009.12. E. J. Keogh, L. Wei, X. Xi, M. Vlachos, S. Lee, and P. Protopapas, “Supporting exact indexing of arbitrarily rotated

shapes and periodic time series under Euclidean and warping distance measures,” VLDB J. 18(3), 611-630, 2009.13. P. V. C. Hough, “Method and mean for recognizing complex pattern,” USA patent 3069654, 1966.

Page 23: Mining Historical Documents for  Near-Duplicate Figures

23

References14. Q. Zhu, X. Wang, E. Keogh, and S. H. Lee, “Augmenting the Generalized Hough Transform to Enable the Mining of

Petroglyphs,” SIGKDD, 2009.15. R. O. Duda and P. E. Hart, “Use of the Hough transform to detect lines and curves in pictures,” Comm. ACM 15(1), pp.11-15,

1972.16. D. H. Ballard, “Generalizing the Hough transform to detect arbitrary shapes,” Pattern Recognition 13, 1981, pp. 111-122. 17. M. Tompa and J. Buhler, “Finding motifs using random projections,” In proceedings of the 5 th Int. Conference on

Computational Molecular Biology. pp 67-74, 2001.18. T. Koch-Grunberg, “Sudamerikanische Felszeichnungen” (South American petroglyphs), Berlin, E. Wasmuth A.-G, 1907.19. A. Fornés, J. Lladós, and G. Sanchez, “Old Handwritten Musical Symbol Classification by a Dynamic Time Warping Based

Method. in Graphics Recognition: Recent Advances and New Opportunities,” Lecture Notes in Computer Science, vol. 5046, pp. 51-60, 2008.

20. G. Sanchez, E. Valveny, J. Llados, J. M. Romeu, and N. Lozano, “A platform to extract knowledge from graphic documents. application to an architectural sketch understanding scenario,” Document Analysis Systems VI, Vol. 3163, pp. 389 -400, 2004.

21. J. Mas, G. Sanchez, and J. Llados, “An Incremental Parser to Recognize Diagram Symbols and Gestures represented by Adjacency Grammars,” Graphics Recognition: Ten Year Review. Lecture Notes in Computer Science, vol. 3926, pp. 252-263, 2006.

22. K. B. Schroeder et al., “Haplotypic Background of a Private Allele at High Frequency,” the Americas, Molecular Biology and Evolution, 26 (5), pp. 995-1016, 2009.

23. G. A. Smith, and W. G. Turner, “Indian Rock Art of Southern California with Selected Petroglyph Catalog,” San Bernardino County, Museum Association, 1975.

24. C. Davenport, “British Heraldry,” London Methuen, 1912.25. C. Davenport, “English heraldic book-stamps, figured and described,” London : Archibald Constable and co. ltd, 1909.26. X. Xi, E. J. Keogh, L. Wei, and A. Mafra-Neto, “Finding Motifs in a Database of Shapes,” Prof. of Siam Conf. Data Mining, 2007.

Page 24: Mining Historical Documents for  Near-Duplicate Figures

24

Thank you foryour attention

QUESTION?