Figure: shape
number of order 4, 6
and 8 along with
their chain-code
representations, first
difference, and
corresponding shape
numbers.
compiled by: Deepak Bhatta 14
Example: suppose n=18 is
specified for the boundary.
▪To obtain the shape
number of this order,
following steps are done:
1.Find the basic rectangle.
2.The closet rectangle of
order 18 is 3 x 6
rectangle; sub-divide the
rectangle.
3.Align the chain code
directions with the
resulting gird.
4.Obtain the chain code
and use its first difference
to compute the shape
number.
compiled by: Deepak Bhatta 15
An Example
•Problem:Sortingincoming
fishonconveyorbelt
accordingtospecies.
•Assumethatwehaveonlytwo
kindsoffish:
•Seabass,
•salmon
Figure: Picture Taken from a camera
compiled by: Deepak Bhatta 24
An Example: Decision Process
•Whatkindofinformationcandistinguishonespeciesfromtheother?
➢Length,width,numberandshapeoffins,tailshapeetc.
•Whatcancauseproblemsduringsensing?
➢Lightingconditions,positionoffishontheconveyorbelt,cameranoise,etc.
•Whatarethestepsintheprocess?
➢Captureimage→isolatefish→takemeasurement→makedecision
compiled by: Deepak Bhatta 25
An Example : Selecting Features
•Assumeafishermantoldusthataseabassisgenerallylongerthana
salmon.
•Wecanuselengthasafeatureanddecidebetweenseabassadsalmon
accordingtoathresholdonlength.
•Howcanwechoosethisthreshold?
compiled by: Deepak Bhatta 26
An Example : Selecting Features
compiled by: Deepak Bhatta 27
An Example : Selecting Features
•Eventhoughseabassislongerthansalmonontheaverage,thereare
manyexamplesoffishwherethisobservationdoesnothold.
•Tryanotherfeature,averagelightnessofthefishscales.
compiled by: Deepak Bhatta 28
An Example : Selecting Features
compiled by: Deepak Bhatta 29
An Example: Cost of Error
•Weshouldalsoconsidercostsofdifferenterrorswemakeinour
decisions.
•Forexample,ifthefishpackingcompanyknowsthat:
•Customerswhobuysalmonwillobjectvigorouslyiftheyseesea
bassintheircans.
•Customerswhobuyseabasswillnotbeunhappy,ifthey
occasionallyseesomeexpensivesalmonintheircans.
•Howdoesthisknowledgeaffectourdecision?
compiled by: Deepak Bhatta 30
Minimum Distance Classifier
Figure: Example of two classes and their mean vectors.
Figure: Example of three classes with relatively complex
structure
compiled by: Deepak Bhatta 47
K-Nearest Neighbors Classifier
Figure: (a) Example of KNN classifier ( k = 1) for a five-class classifier in a 2D feature space. (b) Minimum
distance classifier results for the same data set.
compiled by: Deepak Bhatta 49
compiled by: Deepak Bhatta 53
Human brain contains
a massively
interconnected net of
10
10
-10
11
neurons or
nerve cells
Brain Computer: What is it?
Biological Neuron
-The simple
arithmetic
computing”
element
Biological Prototypes and Artificial Neurons
The schematic model
of a biological neuron
Synapses
Dendrites
Soma
Axon
Dendrite
from
other
Axon from
other neuron
1.Somaorbodycell-isalarge,round
centralbodyinwhichalmostallthelogical
functionsoftheneuronarerealized.
2.Theaxon(output),isanervefibre
attachedtothesomawhichcanserveasa
finaloutputchanneloftheneuron.Anaxon
isusuallyhighlybranched.
3.Thedendrites(inputs)-representa
highlybranchingtreeoffibres.Theselong
irregularlyshapednervefibres(processes)
areattachedtothesoma.
4.Synapsesarespecializedcontactsona
neuronwhicharetheterminationpointsfor
theaxonsfromotherneurons.
56
Vision, AI and ANNs
•1940s:beginningofArtificialNeuralNetworks
McCullogh&Pitts,1942
S
iw
ix
iq
Perceptronlearningrule(Rosenblatt,1962)
Backpropagation
Hopfieldnetworks(1982)
Kohonenself-organizingmaps
input outputneuron
m M
Sm
57
Vision, AI and ANNs
1950s:beginningofcomputervision
Aim:givetomachinessameorbettervisioncapabilityasours
Drive:AI,roboticsapplicationsandfactoryautomation
Initially:passive,feedforward,layeredandhierarchicalprocess
thatwasjustgoingtoprovideinputtohigherreasoning
processes(fromAI)
Butsoon:realizedthatcouldnothandlerealimages
1980s:Activevision:makethesystemmorerobustbyallowingthe
visiontoadaptwiththeongoingrecognition/interpretation
58
•AMcCulloch-Pittsneuronoperatesonadiscrete
time-scale,t=0,1,2,3,... withtimetickequalto
onerefractoryperiod
•Ateachtimestep,aninputoroutputis
onoroff—1or0,respectively.
•Eachconnectionorsynapsefromtheoutputofoneneuronto
theinputofanother,hasanattachedweight.
Warren McCulloch and Walter Pitts (1943)x (t)
1
x (t)
n
x (t)
2
y(t+1)
w
1
2
n
w
w
axon
q
59
Excitatory and Inhibitory Synapses
•Wecallasynapse
excitatoryifw
i>0,and
inhibitoryifw
i<0.
•Wealsoassociateathresholdqwitheachneuron
•Aneuronfires(i.e.,hasvalue1onitsoutputline)attimet+1iftheweightedsum
ofinputsattreachesorpassesq:
y(t+1) = 1 if and only if Sw
ix
i(t) q
60
From Logical Neurons to Finite Automata
AND
1
1
1.5
NOT
-1
0
OR
1
1
0.5
Brains, Machines, and
Mathematics, 2nd Edition,
1987
X Y→
Boolean Net
X
Y Q
Finite
Automaton
66
Example: face recognition
•Hereusingthe2-stageapproach:
67
SOM : Self Organized Map
•Provideawayofrepresentingmultidimensionaldatainmuchlowerdimensional
spaces-usuallyoneortwodimensions.
•Vectorquantization:Reducingthedimensionalityofvectors.
68
Nuro Fuzzy Systems
NeuralNetworks
Neuralnetworksaregoodatrecognizingpatterns,theyarenotgood
atexplaininghowtheyreachtheirdecisions.
FuzzySystems
Fuzzylogicsystems,whichcanreasonwithimpreciseinformation,are
goodatexplainingtheirdecisionsbuttheycannotautomatically
acquiretherulestheyusetomakethosedecisions.
Need a Intelligent Hybrid System !!