350 likes | 370 Views
Evolving Edge detection. Final project by Rubshtein Andrey (303468490). Introduction. Is it possible for a living creature to evolve vision? Is it possible for a living creature to evolve at least an edge detector?. Simulates an environment in which there are “living creatures”
E N D
Evolving Edge detection Final project by Rubshtein Andrey (303468490)
Introduction • Is it possible for a living creature to evolve vision? • Is it possible for a living creature to evolve at least an edge detector?
Simulates an environment in which there are “living creatures” They are called Genomes. Each Genome has some parameters There exists a global fitness function which tells how successful a Genome is. There exists a Population of some Genomes There are many Generations A bit about Genetic Algorithms
More about Genetic Algorithms Each generation consist of 3 stages: • Selection – The more fit are chosen. • Crossover – Some genomes are crossed, while inheriting their parents properties. • Mutation – Some Genomes are randomly changed, with a slight variation. • We hope that after some generations, we get more fitted Genomes.
The Goal Assumptions: • Each living creature can perform a convolution, with a constant mask, which is coded into his Genome. • The creatures that detect edges better, survive better. • There exists an ideal edge detector.
More about the Goals • Is it possible to develop, by means of natural selection, a good edge detector? • Is it possible to achieve that using only convolution type edge detectors, while the perfect edge picture is not?
Ideal edge detector • Canny’s edge detector was chosen as an ideal edge detector. • Why Canny? Has an impressive results, and uses much more advanced techniques than convolutions • So it’s challenging to try to evolve to it.
About the simulation The genome structure • A 3x3 Matrix • Each of the cells is in the range [-255,255] • A threshold value in the range [0,255]
About similarity Measure • Both images are binary after threshold • The measure is : Similarity[x,y]=Sum[x OR y] / Sum[ x AND y]
Why this measure is good? • It is symmetric : Sim[x,y]=Sim[y,x] • It has the range of [0,1] • It is simple to implement • It is “reflexive” – Sim[x,x]=1 • It doesn’t give extra points for pictures which have a common non-edge (0 ) pixel. • It reduces points for false positive edges, and false negative edges.
Why this measure isn’t good • A small movement in the picture results in a low similarity rate • The measure takes into account single pixels, which isn’t the goal in edge detection • A better measure would have been perhaps one that takes into account the shape of the edges (Geshtalt)
The results • After a few generations, the Genomes learn to somehow detect edges. • Yet even in the easy pictures, the evolution fails to get a good ratio of similarity ( Usually less than 0.3) • But, we see an impressive results, when looking with our eyes.
Results for easy pictures • It is amazing that we’ve managed to evolve something close to the ideal • Then again, the similarity rate is low
Results for hard pictures • The evolution finds some solution, yet it isn’t as good as wanted • The similarity rate is very low
Conclusions • It is easy to evolve some kind of edge detector • It is hard to evolve a good edge detector, in terms of similarity • It seems that an edge detector evolved from one picture isn’t good for another picture.
Why the results are bad: • Canny is a very sophisticated edge detector. Perhaps it’s impossible to imitate it using only convolutions? • Perhaps the similarity measure isn’t suitable for this problem. Perhaps using another similarity it’s possible to get better results.
The end Thank you for listening :-)