COMPUTER ASSISTED MINIMAL INVASIVE SURGERY TOWARDS GUIDED MOTOR CONTROL Vinay B Gavirangaswamy Canny edge detection algorithm Gaussian Convolution to smooth the image Sobel Filtering to find • gradient magnitude • and gradient direction Non-maximum suppression Hysteresis and connected components analysis Output Original Single Threaded Output (contd.) Original Multi-Threaded (OpenMP) Output (contd.) Original Multi-Threaded (GPU-CUDA) Performance Analysis on OpenMP Run Times of Canny Edge Detection 0.7 0.6 0.5 1 p 0.4 2 4 0.3 8 0.2 16 0.1 0 200x173 284x211 300x225 n 512x512 1280x800 Performance Analysis on OpenMP (contd.) Speedup of Canny Algorithm Efficiency of Canny Algorithm 3.5 1.2 3 1 2.5 0.8 2 p p 0.6 1.5 0.4 1 0.2 0.5 0 0 200x173 284x211 300x225 512x512 1280x800 1 2 n 4 8 16 200x173 284x211 300x225 512x512 1280x800 1 2 n 4 8 16 Canny Edge Algorithm Performance on CUDA CS6260 Project Implementation Canny Edge Detection Performance on CUDA With Different Block Size Runtimes 128x128 Runtimes serial vs. parallel 256x256 512x512 1024x1024 2048x2048 1 10000 40000 140000 530000 2150000 2 70000 60000 80000 70000 90000 4 70000 50000 60000 60000 80000 80000 8 60000 60000 60000 60000 70000 60000 120000 100000 40000 16 60000 60000 50000 60000 70000 20000 32 50000 60000 60000 60000 80000 0 1 2 4 8 16 32 Canny Edge Detection Performance on CUDA With Different Block Size (Contd.) Speedup 128x128 1 2 4 8 16 32 Speedup serial vs. parallel 256x256 512x512 1024x1024 2048x2048 1 1 1 1 1 0.142857 0.666666 23.888888 14 67 1.75 7.57142857 9 0.142857 2.333333 14 0.8 33 8.83333333 26.875 0.166666 0.666666 2.333333 30.714285 67 67 33 8.83333333 7 0.166666 0.666666 30.714285 67 67 2.8 8.83333333 7 0.666666 2.333333 0.2 67 33 8.83333333 26.875 50 45 40 35 30 25 20 15 10 5 0 1 2 4 8 16 32 Canny Edge Detection Performance on CUDA With Different Block Size (Contd.) Efficiency 128x128 256x256 Efficiency serial vs. parallel 512x512 1024x1024 2048x2048 14 1 2 4 8 16 32 1 1 1 1 1 0.071428 0.333333 11.944444 57 33 0.875 3.78571429 4 0.035714 0.583333 29 0.2 33 2.20833333 6.71875 0.020833 0.083333 0.291666 3.8392857 33 33 67 1.10416667 1 0.010416 0.041666 1.9196428 67 67 0.175 0.55208333 6 0.020833 0.072916 0.8398437 0.00625 33 67 0.27604167 5 12 10 8 6 4 2 0 1 2 4 8 16 32 Canny Edge Detection Performance on CUDA With Different #Threads Runtimes 128x128 Runtimes serial vs. parallel 256x256 512x512 1024x1024 2048x2048 1 100000 400000 1400000 5300000 215000000 2 430000 1750000 7010000 28030000 112540000 4 210000 880000 3500000 14110000 56510000 8 110000 430000 1760000 7090000 28280000 1000000000 100000000 10000000 1000000 16 50000 220000 880000 3530000 14140000 32 20000 110000 450000 1780000 7120000 100000 10000 1000 1 2 4 8 128x128 256x256 1024x1024 2048x2048 16 32 512x512 Canny Edge Detection Performance on CUDA With Different #Threads (Contd.) Speedup 128x128 Speedup serial vs. parallel 256x256 512x512 1024x1024 36 2048x2048 31 1 1 1 1 0.232558 0.228571 0.199714 2 14 43 69 0.18908313 0.476190 0.454545 4 48 45 0.4 0.37562013 0.909090 0.930232 0.795454 8 91 56 55 0.74753173 1.818181 1.590909 16 2 82 09 1.50141643 3.636363 3.111111 32 5 64 11 2.97752809 1 1.9104318 5 3.8046363 5 7.6025459 7 15.205091 9 30.196629 2 26 21 16 11 6 p 1 1 1 2 4 8 128x128 256x256 1024x1024 2048x2048 n 16 32 512x512 Canny Edge Detection Performance on CUDA With Different #Threads (Contd.) Efficiency 128x128 256x256 Efficiency serial vs. parallel 512x512 1024x1024 2048x2048 1.2 1 1 1 1 0.116279 0.114285 0.099857 2 07 71 35 0.09454156 0.119047 0.113636 4 62 36 0.1 0.09390503 0.113636 0.116279 0.099431 8 36 07 82 0.09344147 0.113636 0.099431 16 0.125 36 82 0.09383853 0.113636 0.097222 32 0.15625 36 22 0.09304775 1 0.9552159 2 0.9511590 9 0.9503182 5 0.9503182 5 0.9436446 6 1 0.8 0.6 0.4 0.2 0 p 1 -0.2 1 2 4 8 16 32 -0.4 128x128 256x256 512x512 1024x1024 2048x2048 Linear (512x512) Markov Chain Weather Model Simple Markov Model of Weather 0.42 0.45 SUNNY(0.30) 0.38 CLOUDY(0.40) 0.12 0.20 0.39 0.10 RAINY(0.30) 0.60 0.45 Prediction Based on State Transition Probability If we want to know probability of the sequence SUNNY SUNNY SUNNY SUNNY SUNNY Take initial probablity of SUNNY day i.e. on a any given day probability that it will be SUNNY is 0.30 And for use to get another SUNNY day after a SUNNY day is 0.42 So, by using Markov Chain we can say prbability of getting 5 consecutive SUNNY day is 0.3 0.42 0.09335088 4 Challenges Faced During OpenMP Missing Edges • Medical images consist of nerves and arteries which should be treaded as an edge however their gradient magnitude varies relative to region in image. • Solution : Adaptive Thresholding False Edges in Parallel Implementation Summary Canny and Markov Chain Model is a simple and efficient way to perform edge detection however canny performs poorly with images taken during laparoscopy (good to get started) Future work Contribute improvements to MIS learning methodology. REFERENCES Image Convolution with CUDA – Victor Podlozhnyuk, sdkfeedback@nvidia.com Performance Evaluation of Feature Extraction Algorithm on GPGPU – Namdev Sawant Dept. of Computer Science and Engg. Dinesh Kulkarni Dept. of Information Technology, 2011 International Conference on Communication Systems and Network Technologies Canny Edge Detection on NVIDIA CUDA - Yuancheng “Mike” Luo and Ramani Duraiswami, Perceptual Interfaces and Reality Laboratory, Computer Science & UMIACS, University of Maryland, College Park Cuda-grayscale – Karlphil, karlphil...@gmail.com Rich, E.A. 2007. Automata, computability and complexity: Theory and applications, Upper Saddle River, NJ: Prentice Hall Special thanks to Jason and Vasilije!