• 沒有找到結果。

第四章 實驗結果

第四節 實驗分析

從實驗數據中可以發現,在 NN 的執行時間中,CPU 雖然一開始略 快於 GPU,但在輸入 2,332*2,332 個特徵點之後,CPU 執行的時間開始 迅速攀升,最後在輸入 20,252*20,252 個特徵點時,執行的時間達到 168.842 秒。相對的,GPU 的執行時間雖然在一開始略慢於 CPU,但是 在 CPU 的執行時間開始增加時,GPU 卻依然可以維持速度,而在輸入 20,252*20,252 個特徵點的檔案時,GPU 只需要 7.45108 秒。於是從 NN 的實驗中得到,在輸入 20,252*20,252 個特徵點時,GPU 的執行速度相

462 602 2332 5278 7042 8685 12187 15154 18296 20252

CPU 0.110137 0.183554 2.652754 13.65874 24.35601 37.18157 73.50149 114.1472 166.8571 204.8758 GPU 1.029975 1.047669 1.540063 2.676545 3.517533 4.436839 6.835031 9.36011 15.08114 17.35252

0

Execution times (sec.)

在 K-NN 的部分,由於多了一個排序步驟,因此在 CPU 以及 GPU 的執行時間都略慢於 NN。但從實驗數據中依然可以看出,雖然 CPU 一 開始在小特徵點數量的實驗中略優於 GPU,但在特徵點數量漸漸變大的 過程中,CPU 的執行時間不僅越來越慢,而且與 GPU 之間的執行時間 差距越來越大。在輸入 20,252*20,252 個特徵點時,CPU 需要 204.876 秒、GPU 需要 17.3525 秒。因此本研究從 K-NN 的實驗中得出,在輸入 20,252*20,252 個特徵點時,GPU 的執行時間相較於 CPU 可以得到大約 11 倍的加速。

第五章 程式應用

第一節 應用簡介

本研究呈現一個使用圖形辨識技術將書本封面做整理的系統。系統 藉由 SIFT 的圖像辨識功能,將圖書的封面轉為特徵值,並建立特徵值 資料庫。當使用者查詢書籍時,只需將欲查詢圖書之封面輸入資料庫,

系統便可以根據特徵比對的結果輸出特定資料,並於圖書資料庫中找尋 到查詢的資訊。在系統的建置階段,使用 SIFT 演算法將館內現有的藏 書建檔,將圖書之封面使用數位攝影機拍攝後,透過演算法轉換為特徵 點集合,其中的每一個特徵點都擁有 128 個特徵值可供比對。建置完成 後,系統會得到一個全館藏書封面的特徵點資料庫,每一筆資料都會對 應書籍資料庫。當使用者欲使用本系統查詢藏書資料時,只需將封面拍 下並上傳至系統,系統會將該封面轉換為特徵點,並使用 GPU 做平行 比對出待查的書籍。

圖 21 封面資料庫

資料來源:自製。

本研究將資料庫設計為辨識圖片後,資料庫能夠回傳一 ISBN 碼,

並且讓程式利用此 ISBN 碼向國立臺灣師範大學圖書館網頁做檢索。流 程如圖 22 所示:

圖 22 系統流程圖

資料來源:自製。

第六章 結論

本研究提出一個加速 SIFT 特徵比對程序的平行運算架構,以 NVIDIA® GPU 加速 NN 以及 K-NN 演算法,相較於 CPU 上可以得到 22 倍以及 11 倍的加速,有效提升 SIFT 演算法特徵比對的效能。未來透過 Multi-GPU 技術或是雲端運算叢集技術,可望將整體系統運算的效能更 進一步有效地提升。

而在應用層面,本研究提出了一個基於 SIFT 演算法的圖書辨識系 統之雛形。以目前的成果,辨識一本書從上傳圖片到輸出比對結果的網 頁時間不超過五秒,相信將來在運算效能更加提升之後,可以將比對的 時間縮短,並且將比對的資料庫逐步擴大。未來更可以結合手機軟體撰 寫,讓使用者只須要拍下書籍的封面,便能夠以手機上網向圖書館和網 路書店檢索書籍。

參考文獻

Bellman, R. E. (2003). Dynamic Programming. Mineola, NY: Courier Dover Publications.

Bentley, J. L. (1975). Multidimensional binary search trees used for associative searching. Communications of the ACM, 18(9), 509-517.

Bonato, V., Marques, E., & Constantinides, G. A. (2008). A parallel hardware architecture for scale and rotation invariant feature detection. IEEE Transactions on Circuits and Systems for Video Technology, 18(12), 1703-1712.

Bosch, A., Zisserman, A., & Muñoz, X. (2008). Scene classification using a hybrid generative/discriminative approach. IEEE Transactions on Pattern Analysis and Machine Intelligence, 30(4), 712-727.

Do, T., Kijak, E., Furon, T., & Amsaleg, L. (2010, October). Deluding image recognition in SIFT-based CBIR systems. Paper presented at the

Proceedings of the 2nd ACM workshop on Multimedia in forensics, security and intelligence, Firenze, Italy, 2010.

Finley, D. R. (2005). Optimized QuickSort

C Implementation

(Non-Recursive). Retrieved June 18, 2013 from

http://alienryderflex.com/quicksort/

Garcia, V., & Debreuve, E. (2008, June). Fast k nearest neighbor search using GPU. Paper presented at the 2008 IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops, Anchorage, Alaska, USA, 2008.

Garcia, V., Debreuve, E., Nielsen, F., & Barlaud, M. (2010, September).

application to high-dimensional feature matching. Paper presented at the International Conference on Image Processing (ICIP), Hong Kong, 2010.

Heymann, S., Muller, K., Smolic, A., Frohlich, B., & Wiegand, T. (2007, February). Sift implementation and optimization for general-purpose gpu. Paper presented at the 15-th International Conference in Central Europe on Computer Graphics, Visualization and Computer Vision, Bory, Czech Republic, 2007.

Huang, F. C., Huang, S. Y., Ker, J. W., & Chen, Y. C. (2012).

High-performance SIFT hardware acceleration for real-time image feature extraction. IEEE Transactions on Circuits and Systems for Video Technology, 22(3), 340-351.

Huo, C., Pan, C., Huo, L., & Zhou, Z. (2012). Multilevel SIFT matching for large-size VHR image registration. IEEE Geoscience and Remote Sensing Letters, 9(2), 171-175.

Jégou, H., Douze, M., & Schmid, C. (2011). Product quantization for nearest neighbor search. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(1), 117-128.

Kuang, Q., & Zhao, L. (2009, December). A practical GPU based kNN algorithm. Paper presented at the International Symposium on

Computer Science and Computation Technology (ISCSCT), Huangshan, China, 2009.

Li, B., Kong, X., Wang, Z., & Fu, H. (2009, September). SIFT-based image retrieval combining the distance measure of global image and

sub-image. Paper presented at the fifth International Conference on

Kyoto, Japan, 2009.

Liu, C., Yuen, J., & Torralba, A. (2011). SIFT flow: dense correspondence across scenes and its applications. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(5), 978-994.

Lowe, D. G. (2004). Distinctive image features from scale-invariant keypoints. International Journal of Computer Vision, 60(2), 91.

NVIDIA Corporation. (2012). CUDA: Compute Unified Device Architecture (Version 5.0) [Software]. Available from

http://www.nvidia.com/object/cuda_home_new.html

NVIDIA Corporation. (2012). CUDA C Programming Guide. Retrieved July 2, 2013, from

http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html OpenCV. (2013). OpenCV: Open Source Computer Vision (Version 2.4.5)

[Software]. Available from http://opencv.org/

Sinha, U. (2010). SIFT: Scale Invariant Feature Transform. Retrieved October 5, 2012, from

http://www.aishack.in/2010/05/sift-scale-invariant-feature-transform/

Sismanis, N., Pitsianis, N., & Sun, X. (2012, September). Parallel search of k-nearest neighbor with synchronous operations. Paper presented at the 2012 IEEE Conference on High Performance Extreme Computing (HPEC), Waltham, Massachusetts, USA, 2012.

Tarhini, A. (2011). Parallel k-Nearest Neighbor. Retrieved October 5, 2012, from

http://alitarhini.wordpress.com/2011/02/26/parallel-k-nearest-neighbor/

Xu, W., Wu, J., Liu, X., Zhu, L., & Shi, G. (2008, December). Application of

International Conference on Computer Science and Software Engineering, Wuhan, Hubei, China, 2008.

Zhang, C., Li, F., & Jestes, J. (2012, March). Efficient parallel kNN joins for large data in MapReduce. Paper presented at the Proceedings of the 15th International Conference on Extending Database Technology, Berlin, Germany, 2012.

相關文件