600 likes | 762 Views
Biologically Inspired Intelligent Systems. Lecture 05 Dr. Roger S. Gaborski. Quiz 1 second half of lecture. BACKGROUND: Spatial Filtering. Neighborhood processing Define center point (x,y) Perform operations involving only pixels in the neighborhood
E N D
Biologically Inspired Intelligent Systems Lecture 05 Dr. Roger S. Gaborski
Quiz 1 second half of lecture Roger S. Gaborski
BACKGROUND: Spatial Filtering • Neighborhood processing • Define center point (x,y) • Perform operations involving only pixels in the neighborhood • Result of operation is response to process at that point • Moving the pixel results in a new neighborhood • Repeat process for every point in the image Roger S. Gaborski
Linear and Nonlinear Spatial Filtering • Linear operation • Multiply each pixel in the neighborhood by the corresponding coefficient and sum the results to get the response for each point (x,y) • If neighborhood is m x n , then mn coefficients are required • Coefficients are arranged in a matrix, called • Filter • Filter mask • Kernel • Template • Mask sizes are typically odd sizes (3x3, 5x5, etc.) • Larger the mask, greater the compute time Roger S. Gaborski
Chapter 3 www.prenhall.com/gonzalezwoodseddins Roger S. Gaborski
Correlation -- Convolution • Correlation • Place mask w on the image array f as previously described • Convolution • First rotate mask w by 180 degrees • Place rotated mask on image as described previously Roger S. Gaborski
Example - Correlation • Assume w and f are one dimensional • Origin of f is its left most point • Place w so that its right most point coincides with the origin of f • Pad f with 0s so that there are corresponding f points for each w point (also pad end with 0s) • Multiply corresponding points and sum • In this case (example on next page) result is zero • More w to the right one value, repeat process • Continue process for whole length of f Roger S. Gaborski
Chapter 3 www.prenhall.com/gonzalezwoodseddins ‘full’ is the result we obtain from the operations on the previous slide. If instead of aligning the left most element of f with the right most element of w we aligned the center element of w with the left most value of f we would obtain the ‘same’ result, same indicating the result is the same length of the original w Roger S. Gaborski
‘Full’ correlation Roger S. Gaborski
‘Same’ correlation etc. Roger S. Gaborski
Example - Convolution • Convolution is the same procedure, but the filter is first rotated 180 degrees. • If the filter is symmetric, correlation and convolution results are the same Roger S. Gaborski
Chapter 3 www.prenhall.com/gonzalezwoodseddins Can simply extend to images Roger S. Gaborski
Linear Filtering in MATLAB • g = imfilter(f, w, filtering mode, boundary_options, size_options) • f is the input filter • w is filter mask • g is filtered output • filtering mode specifies either corr or conv • boundary_options deals with padding issues • size_options is either full or same Roger S. Gaborski
MATLAB function for filtering: imfilter • g = imfilter(f, w, ‘replicate’) • Correlation is the default . • If filters are pre-rotated 180 degrees, can simply use default • If filter is symmetric, doesn’t matter Roger S. Gaborski
Chapter 3 www.prenhall.com/gonzalezwoodseddins Roger S. Gaborski
Basic Neuron Models Output function Neuron Firing Rate Value (Output Spikes) Filter Output Fires strongest when Image matches linear filter Linear Filter Non-linear Function Roger S. Gaborski
%Dog128Filter.m %Generates difference of Gaussians 128x128 imageSize = 128; sigmaex= .095*imageSize; sigmainh = .19*imageSize; [x,y] = meshgrid(-63:64 -63:64); %First Term exp1 = exp( -1*( x .* x + y .* y)./(2*sigmaex*sigmaex)); FirstTerm = 7.5 *exp1; %SecondTerm exp2 = exp( -1*( x .* x + y .* y)./(2*sigmainh*sigmainh)); SecondTerm = 1.95*exp2; Dog128 = .0013*(FirstTerm - SecondTerm); Roger S. Gaborski
128 x 128 Receptive field Roger S. Gaborski
128 x 128 Receptive field Roger S. Gaborski
128x128 – 1D Roger S. Gaborski
Code example D64 = imresize(Dog128,.5, 'bilinear'); figure, surf(D64), title('DoG64') Roger S. Gaborski
Color Flag Image Roger S. Gaborski
Small Gray Flag Image Roger S. Gaborski
Homework #2 Assigned Roger S. Gaborski
Four Lobes of Neocortex- Lateral view Dorsal Caudal Rostral Ventral Roger S. Gaborski
Cortex Roger S. Gaborski
Visual Cortex http://www.thebrain.mcgill.ca Roger S. Gaborski
V1- Receptive fields sensitive to spatial frequency, orientation, motion, direction, speed coded in terms of local contrast • V2 – Receptive fields sensitive to orientation, spatial frequency, and color. Roger S. Gaborski
V3, V4, V5 (MT) and IT • V3- receives connections from V2 and sends information to MT. RFs sensitive to orientation and some sensitivity to color and movement. • V4 – larger receptive fields, RFs sensitive to both color and orientation. • V5 – complex motion processing • IT - Inferotemporal cortex –receives connections from V4 and respond to a wide range of colors and simple geometric shapes. Key for object recognition Roger S. Gaborski
Primary Cortex and Secondary Cortexes • Hierarchical relationships between a primary cortex and secondary cortexes • Secondary areas of these various cortexes then converge onto what are called associative areas • Associative areas perform a more global level of information processing. They progressively associate signals from other sensory modalities to create an integrated, multisensory representation of the world See: http://www.thebrain.mcgill.ca Roger S. Gaborski
Processing Streams- Computational Function • Visual – ‘what’ and ‘where’ streams • Taste • Olfaction • Touch • Hearing Roger S. Gaborski
Processing Streams • Ventral Stream (the ‘what’ stream’) • V1 V2 V4 posterior then anterior inferior temporal visual cortex • What is the object being viewed, independent of location or size on the retina Roger S. Gaborski
What Happens in the Ventral Stream? • Build a representation of the object • Invariance • Interface visual representation with other sensory systems to form associations • Amygdala- learn associations between sight of food and its taste Roger S. Gaborski
Processing StreamsDorsal Stream • Dorsal Stream (the ‘where stream’) • V1 MT, MST, then parietal cortex • Where is the object with respect to the animal • What is the motion of the object • Outputs: • control eye movements • Prefrontal cortex short term memory Roger S. Gaborski
philosophy.hku.hk/courses/cogsci/ncc.php Roger S. Gaborski