Scaled-RAM Interpolator on FPGA Xijie Jia 1 , Kaiyuan Guo 1 , - - PowerPoint PPT Presentation

scaled ram interpolator on fpga
SMART_READER_LITE
LIVE PREVIEW

Scaled-RAM Interpolator on FPGA Xijie Jia 1 , Kaiyuan Guo 1 , - - PowerPoint PPT Presentation

SRI-SURF: A Better SURF Powered by Scaled-RAM Interpolator on FPGA Xijie Jia 1 , Kaiyuan Guo 1 , Wenqiang Wang 3 , Yu Wang 1,2 and Huazhong Yang 1 1 E.E. Dept., TNLIST, Tsinghua University, Beijing, China 2 yu-wang@mail.tsinghua.edu.cn 3 Microsoft


slide-1
SLIDE 1

SRI-SURF: A Better SURF Powered by Scaled-RAM Interpolator on FPGA

Nano-scale Integrated Circuit and System Lab, Department of Electronic Engineering, Tsinghua University

Xijie Jia1, Kaiyuan Guo1, Wenqiang Wang3, Yu Wang1,2 and Huazhong Yang1

1E.E. Dept., TNLIST, Tsinghua University, Beijing, China 2yu-wang@mail.tsinghua.edu.cn 3Microsoft Research Asia, Beijing, China

slide-2
SLIDE 2

Outline

  • Introduction
  • Methods
  • Experiments
  • Conclusion
  • p. 2
slide-3
SLIDE 3

Outline

  • Introduction

– Background – Related Work – SURF Algorithm – Contributions

  • Methods
  • Experiments
  • Conclusion
  • p. 3
slide-4
SLIDE 4

Background – Local Feature Extraction

  • Main Goal:

– Find representative regions of a image – Find robust expression for each of them

  • What is “robust” feature:

– Invariant to affine transformations, environment light, etc.

  • Algorithms:

– SIFT (Scale Invariant Feature Transform) [IJCV04] – PCA-SIFT (Principle Component Analysis SIFT) [CVPR04] – GLOH (Gradient Location-Orientation Histogram) [PAMI05] – SURF (Speed-Up Robust Feature) [ECCV06]

  • p. 4
slide-5
SLIDE 5

Background - Applications

  • Image mosaic[ICISE09]
  • Object recognition[SMC09]
  • 3D reconstruction[ICIP12]
  • Crowd counting[TCEC14]
  • Requirements

– Real-time processing – High matching precision at high resolution

  • p. 5
slide-6
SLIDE 6

Background - Performance Evaluation

  • Frames Per Second (FPS)
  • Feature Points Per Frame (PPF)

– Related to image resolution and texture complexity

  • Feature Points Per Second (PPS)

– MAX-PPS: represents the calculation capacity of the system – ACT-PPS: represents the requirements of the application

  • p. 6

Frame 0 Frame 1 …. Frame N PPF 0 PPF 1 …. PPF N 0s 1s FPS PPS

slide-7
SLIDE 7

Parallel platform Serial platform

Related Work – SURF Acceleration

  • p. 7

CPU

OpenSURF[2009]

Easy to realize Low performance

GPU

clSURF[GPGPU2011]

Good portability from CPU Low energy efficiency

ASIC

SURFEX[CICC2013]

Best energy efficiency Low flexibility

FPGA

SURF[FPT2013]

Good energy efficiency Long develop cycle

slide-8
SLIDE 8

Related Work – SURF Acceleration

  • Early work on GPU: high performance by powerful chip
  • Works on FPGA: performance was still insufficient

– Simplification -> precision problem – Low computation capacity – High resource occupation

  • Work on ASIC: high performance by specific device
  • p. 8

Version Clock Resolution FPS PPF PPS Octave Chip Function [GPGPU11] 1.4GHz 791x704 40 800 32K NA GTX480 FD+OG+DG [ReConFig11] 100MHz 640x480 ~2 ~49 0.1K 8 Virtex 5+PowerPC FD+OG+DG [BEC12] 25MHz 640x480 60 100 6.0K 6 3x Virtex 4 FD+OG+DG [TENCON13] 200MHz 300x300 42 250 10.5K 4 Zynq 7 FD+OG+DG [FPT13] 156MHz 640x480 356 100 35K 6 Virtex 6 FD+OG+DG [ReConfig14] 25MHz 640x480 131 1614 211K 6 Zynq 7 FD+OG [CICC13] 200MHz 1920x1080 57 5000 285K 12 ASIC FD+OG+DG FD:Feature Detection OG:Orientation Generation DG:Descriptor Generation

slide-9
SLIDE 9

Introduction to SURF - Algorithm

  • Feature Detection

– Calculate integral image ——base data – Calculate det 𝓘𝑏prrox norm ——locate in each interval – Find local-maximum ——locate among neighbor interval – Up-sampling interpolation ——sub-pixel correction

  • Orientation Generation

– Calculate Haar wavelet ——base data – Add-up Slide-Window ——locate orientation

  • Descriptor Generation

– Calculate Haar wavelet ——base data – Sum-up Sub-Neighbor-Region ——generate 4x4x4 descriptors

  • p. 9
slide-10
SLIDE 10

Introduction to SURF - Algorithm

  • p. 10

image Integral image Scale image Scale image Scale image …… Feature points (x, y, s) Feature points’ orientation Feature points’ descriptor

slide-11
SLIDE 11

Introduction to SURF - Complexity

  • p. 11

Op. Determinant Find localMax UpSamp-Intp Orientation Descriptor Total Resolution Candidate Point Feature Point Feature Point 640x480 520 520 500 Read RAM 9,059,904 453,440 2,304,000 11,817,344 Plus 7,361,172 6,480 1,152,320 4,864,000 13,383,972 Minus 3,963,708 4,860 340,080 1,728,000 6,036,648 Multiply 566,244 165,360 1,296,000 2,027,604 Square 283,122 37,440 320,562 Divide 283,122 283,122 Compare 14,040 18,720 32,760 Equation Set 540 540 Rotate 56,680 576,000 632,680 ATAN 520 520

High computation complexity Bottleneck of serial processing Good parallelism Points are computed serially, Bottleneck is single point processing

slide-12
SLIDE 12

Introduction to SURF - approximation

  • Feature points are from different scales
  • Non-integer coordinate feature points
  • How to use integral image?
  • In OpenSURF, all the integral image data

are from integer coordinates

  • How about interpolation
  • p. 12

θ θr FP(x,y,s) FPr(xr,yr,sr) FP(x,y,s) R=6s FPr(xr,yr,sr) Rr=6sr Orientation Descriptor The index deviation caused by rounding error FP: original feature point FPr: rounded-coordinates-and-scale feature point

slide-13
SLIDE 13

Contribution

  • Interpolation of Integral Image (I3)

– For better matching precision

  • Compromise of Interpolation of Integral Image (CI3)

– Halve the memory access, by decreasing a bit accuracy – For higher processing speed

  • Multi-Scaled RAM (MSR)

– For lower storage occupation

  • p. 13
slide-14
SLIDE 14

Outline

  • Introduction
  • Methods

– Interpolation of Integral Image (I3) – Compromise of Interpolation of Integral Image (CI3) – Multi-Scaled RAM (MSR) – Implementation

  • Experiments
  • Conclusion
  • p. 14
slide-15
SLIDE 15
  • p. 15

4x Up

0.5 4x 0.5

Quantization Error of Image System Continuous image-> Acquisition -> Pixels Loss of image detail Decimal coordinates-> Truncation -> Integer Index deviation

Cumulative error is enlarged step by step

θ θr FP(x,y,s) FPr(xr,yr,sr) FP(x,y,s) R=6s FPr(xr,yr,sr) Rr=6sr Orientation Descriptor The index deviation caused by rounding error FP: original feature point FPr: rounded-coordinates-and-scale feature point

Interpolation of Integral Image

slide-16
SLIDE 16
  • Haar wavelet - math
  • p. 16

Interpolation of Integral Image

decimal coordinate decimal distance integer coordinate integer distance

  • OpenSURF

Theoretical situation Approximate by interpolation Directly read from integral image

slide-17
SLIDE 17
  • p. 17

Compromise of Interpolation of Integral Image (CI3)

decimal coordinate decimal distance decimal coordinate integer distance

  • A trade-off version

Need 32 number from integral image Different interpolation parameter Need 32 number from integral image Same interpolation parameter

  • Haar wavelet - math
slide-18
SLIDE 18
  • p. 18

Compromise of Interpolation of Integral Image (CI3)

decimal coordinate decimal distance integer coordinate integer distance

  • Proposed

Need 32 number from integral image Hard to fetch in parallel Pre-compute the Haar wavelets on integer coordinates Need 4 pre-computed number

  • Haar wavelet - math
slide-19
SLIDE 19

Compromise of Interpolation of Integral Image (CI3)

  • p. 19

Version Point Type Coord.Type Index Level Coords. Deviation Trad. All Rounded Integer Pixel Large Propose d FP Fixed Decimal Sub-Pixel Small NP Fixed Decimal Sub-Pixel Small IP As Trad. As Trad. As Trad.

  • Advantage:

– Use interpolation to improve accuracy – Remains the data access pattern predictable

  • Weakness:

– RAM occupation is doubled for pre-computed Harr wavelets. – Not exactly as the mathematical solution

slide-20
SLIDE 20

RAM Occupation Problem

  • p. 20

𝑡0 Distribution of Extracted FPs Rows Needed Row-Width 320 640 1280 1920 2 54% 71 20.28% 10.14% 5.07% 3.38% 3 29% 105 13.71% 6.86% 3.43% 2.29% 4 11% 140 10.29% 5.14% 2.57% 1.71% 5 5% 175 8.23% 4.11% 2.06% 1.37%

Comparison of FP Distribution and Buffer Utilization

  • A large number of rows are required:

𝑡𝑞𝑏𝑜IP,max = 2 23𝑡0 + 1 + 2𝑡0

  • Only a few of the data are used:

24x24x8=4608

slide-21
SLIDE 21

Multi-Scaled RAM (MSR)

  • Scaled Integral Image -> Multi-Scaled RAM
  • Haar results of NP are processed on the

corresponding scaled RAM

  • Normalized scale -> uniform RAM access

pattern

  • Adjust utilization:

– 39%, 26%, 19.5%, 15.5%

  • Reject redundant data -> save RAM

– 16 + 34 × 2 ×

1 2 + 1 3 + 1 4 + 1 5 = 108

– RAM saved: 1 − 108 175 = 38%

  • p. 21

Original Integral Image

ImageWidth 175 rows

1/2 1/3 1/4 1/5

16 rows 34 rows 34 rows Multi-Scaled Integral Image HaarX Result HaarY Result

slide-22
SLIDE 22

Hardware Implementation

  • 16-bit fractional part
  • Dual clock domain: I/O and calculation
  • Two closed-loop feedbacks:

– Stall the process of reading image if needed – Reduce the number of feature points in a frame

  • p. 22

Scaled-RAM Interpolator

I3 I3

Scaled Haar Wavelet

I3

MSR IImg RAM Scale 2~5 SII SubEE SII SubEO SII SubOE SII SubOO LT RT LB RB RD MSR Haar RAM Scale 2~5 SHX SubEE SHX SubEO SHX SubOE SHX SubOO RAM Scale 2~5 SHY SubEE SHY SubEO SHY SubOE SHY SubOO LT RT LB RB LT RT LB RB Calc Haar 3xIMG_W HaarY HaarX WR WR RD IImg Generator Feature Extractor Det 1234 6Dets (WLR=18) Orientation Generator Scaled IImg Pos Generator Scaled IImg Pos Scaled Integral Image Calc Haar 5x15 FindOri HaarX sin cos FP Ori Descriptor Generator Scaled Haar Pos Generator FindDes 64-dim vector FP Des IImg Slide WLR Det Scale 1 Det Scale 3 Det Scale 6 ... WLR WLR ... ... FindLocMax Octave1 FindLocMax Octave2 Det 2456 Find Extreme FP Pos FP Pos DataIn Buffer Image In Norm DataOut Buffer FP Out FP All FP Pos Scaled Haar Pos HaarY Img IImg WR Clock Driven Legend clkwr clkrd clkwr clkrd Pressure Feedback PPF Feedback

slide-23
SLIDE 23

Outline

  • Introduction
  • Methods
  • Experiments

– Precision evaluation: Better than OpenSURF, ARMSESW,HW<3x10-6 – Performance evaluation: MAX-PPS=241KPPS, avg-ACT-PPS=212KPPS – Resource evaluation: 22% logic, 43% RAM (@1080P)

  • Conclusion
  • p. 23
slide-24
SLIDE 24

Test Dataset

  • Local Feature Evaluation Dataset

[http://www.robots.ox.ac.uk/~vgg/research/affine/]

  • 5 different changes, 8 scenes, 6 images each, around 800x640
  • p. 24
slide-25
SLIDE 25

Precision Evaluation

  • Curve of recall~(1-precision)

– Better matching precision than OpenSURF (Matlab version) – The loss of detail brought by MSR is compensated by restoring accuracy of scale s by I3 – Hardware verification results match software (Matlab) results well

  • p. 25
slide-26
SLIDE 26

Descriptor Error between SW. and HW.

  • Approx-Root-Mean-Square Error:
  • Main error

– CORDIC: Iterative approximation

  • Average ARMSE

– Less than 3x10-6 – ±1 bit error for 16-bit descriptor

  • p. 26

0.00E+00 1.00E-06 2.00E-06 3.00E-06 bark bikes boat graf leuven trees ubc wall Average ARMSE of Descriptors

Average ARMSE of Dataset

avg1 avg2 avg3 avg4 avg5 avg6 ARMSE = 1 64

𝑗=0 63

𝑤𝑗,SW − 𝑤𝑗,HW

2

slide-27
SLIDE 27

Performance Evaluation

  • p. 27

500 1000 1500 2000 2500 3000 3500 4000 4500 bark bikes boat graf leuven trees ubc wall

PPF: Relative to resolution and texture Average is 2K

Pic1 Pic2 Pic3 Pic4 Pic5 Pic6 50 100 150 200 250 bark bikes boat graf leuven trees ubc wall

FPS: Negative relative to PPF Average is 118FPS

Pic1 Pic2 Pic3 Pic4 Pic5 Pic6 50,000 100,000 150,000 200,000 250,000 300,000 bark bikes boat graf leuven trees ubc wall

PPS: Keep stable. Average is 212K 88.2% of MAX-PPS

Pic1 Pic2 Pic3 Pic4 Pic5 Pic6 50 100 150 200 250 bark bikes boat graf leuven trees ubc wall

Latency(ns): Depend on the amount of FP in the bottom area. Average is 113ns, 1.2% of image

Pic1 Pic2 Pic3 Pic4 Pic5 Pic6

slide-28
SLIDE 28

Resource Evaluation

  • Altera Stratix III EP3SL340H1152C3

– Logic resource utilization is below 23%, not sensitive to resolution – RAM size is in proportional to row-width, 43% @1920 – Our system is compact, suit for coexisting with other modules at high resolution

  • p. 28

Modules Registers 18bit DSPs VGA BRAM bits 1080P BRAM bits Provided 270,400 576 16,662,528 IIG+SRI 4.5K/1.7% 21/3.7% 1.7M/10.0% 5.1M/30.7% FE 25.0K/9.3% 24/4.2% 639K/3.8% 2.0M/12.3% OG 13.0K/4.8% 12/2.0% 49K/0.3% 50K/0.3% DG 13.1K/4.9% 32/5.6% 15K/0.09% 16K/0.09% Norm 5.0K/1.9% 0/0.0% 9K/0.06% 9K/0.06% Total 60.7K/22.4% 89/15.5% 2.4M/14.3% 7.2M/43.4%

slide-29
SLIDE 29

Comparison with Previous Work

  • Points per second

– MAX-PPS=241KPPS,avg-ACT-PPS=212KPPS – Best in FPGA solutions, comparable with the ASIC solution

  • Frame rate

– Best MAX-FPS, avg-ACT-FPS=118FPS

  • p. 29

Version Clock Resolution FPS PPF PPS Octave Chip Function [GPGPU11] 1.4GHz 791x704 40 800 32K NA GTX480 FD+OG+DG [ReConFig11] 100MHz 640x480 ~2 ~49 0.1K 8 Virtex 5+PowerPC FD+OG+DG [FCCM10] 200MHz 640x480 56 NA NA NA Virtex 5 FD+OG [BEC12] 25MHz 640x480 60 100 6.0K 6 3x Virtex 4 FD+OG+DG [TENCON13] 200MHz 300x300 42 250 10.5K 4 Zynq 7 FD+OG+DG [FPT13] 156MHz 640x480 356 100 35K 6 Virtex 6 FD+OG+DG [ReConfig14] 25MHz 640x480 131 1614 211K 6 Zynq 7 FD+OG [CICC13] 200MHz 1920x1080 57 5000 285K 12 ASIC FD+OG+DG Proposed 150MHz 640x480 488 480 241K 6 Stratix III FD+OG+DG 1920x1080 72 3250

slide-30
SLIDE 30

Outline

  • Introduction
  • Improvement
  • Experiments
  • Conclusion
  • p. 30
slide-31
SLIDE 31

Conclusion

  • Scaled-RAM Interpolator SURF

– Interpolation of Integral Image (I3): Better matching precision

  • better than OpenSURF, ARMSESW,HW<3x10-6

– Compromise of Interpolation of Integral Image (CI3): Higher processing speed

  • MAX-PPS=241KPPS, avg-ACT-PPS=212KPPS

– Multi-Scaled RAM (MSR): Lower storage occupation

  • 22% logic, 43% RAM (@1080P)
  • TODO:

– Making full use of MSR’s parallelism among scales

  • p. 31
slide-32
SLIDE 32

Thanks! Q&A

  • p. 32

Nano-scale Integrated Circuit and System Lab, Department of Electronic Engineering, Tsinghua University

slide-33
SLIDE 33

References

  • [1] D. G. Lowe, “Distinctive image features from scale-invariant keypoints,” IJCV, 2004.
  • [2] Y. Ke et al., “PCA-SIFT: a more distinctive representation for local image descriptors,” CVPR, 2004.
  • [3] K. Mikolajczyk et al., “A performance evaluation of local descriptors,” PAMI, 2005.
  • [4] H. Bay et al., “SURF: Speeded Up Robust Features,” ECCV, 2006.
  • [5] J. Hong et al., “Image Mosaic Based on SURF Feature Matching,” ICISE, 2009.
  • [6] M.-L. Wang et al., “Object recognition from omnidirectional visual sensing for mobile robot

applications,” SMC, 2009.

  • [7] M. Segundo et al., “Automating 3D reconstruction pipeline by surf-based alignment,” ICIP, 2012.
  • [8] H. Zhang et al., “Large crowd count based on improved SURF algorithm,” TCEC, 2014.
  • [9] Evans C. Notes on the OpenSURF Library. Technical report, University of Bristol, 2009.
  • p. 33
slide-34
SLIDE 34

References Cont.d

  • [10] P. Mistry et al., “Analyzing Program Flow Within a Many-kernel OpenCL Application,” GPGPU, 2011.
  • [11] L. Liu et al., “SURFEX: A 57fps 1080P resolution 220mW silicon implementation for simplified speeded-

up robust feature with 65nm process,” CICC, 2013.

  • [12] X. Fan et al., “Implementation of high performance hardware architecture of OpenSURF algorithm on

FPGA,” FPT, 2013.

  • [13] M. Schaeferling et al., “Object Recognition on a Chip: A Complete SURF-Based System on a Single

FPGA,” ReConFig, 2011.

  • [14] T. Sledevic et al., “SURF algorithm implementation on FPGA,” BEC, 2012.
  • [15] Y.-S. Do et al., “A new area efficient SURF hardware structure and its application to Object tracking,”

TENCON, 2013.

  • [16] C. Wilson et al., “A power-efficient real-time architecture for SURF feature extraction,” ReConFig, 2014.
  • [17]Mikolajczyk K, et al. Local Feature Evaluation Dataset,

http://www.robots.ox.ac.uk/~vgg/research/affine/.

  • p. 34