SlideShare a Scribd company logo
1 of 41
Download to read offline
Genetic Algorithms
George Bora
UTCN
December 4, 2013
George Bora (UTCN) Genetic Algorithms December 4, 2013 1 / 20
Computer Science to Evolutionary Computation
Within the vast field of computer science under it’s vast array of potential
applications there exists the branch of artificial intelligence.
George Bora (UTCN) Genetic Algorithms December 4, 2013 2 / 20
Computer Science to Evolutionary Computation
Within the vast field of computer science under it’s vast array of potential
applications there exists the branch of artificial intelligence.
One of the sub-branches of artificial intelligence is evolutionary
computation which seeks to achieve continuous optimization and
combinatorial optimization by incorporating knowledge of natural evolution
processes.
George Bora (UTCN) Genetic Algorithms December 4, 2013 2 / 20
Basic Concepts from Biology
The basic building blocks for evolutionary computation, which have kept
their names from their native science, are as follows:
genes
allele
chromosome
individual
mapping
mutation and crossover
fitness function
George Bora (UTCN) Genetic Algorithms December 4, 2013 3 / 20
Genes
The element from which this method derives it name, as genes are the
basic building blocks of life.
George Bora (UTCN) Genetic Algorithms December 4, 2013 4 / 20
Genes
The element from which this method derives it name, as genes are the
basic building blocks of life.
So too in our search for the solution for various problems, genes are the
basic elements we switch around and juggle with in order to arrive at a
more optimum solution.
George Bora (UTCN) Genetic Algorithms December 4, 2013 4 / 20
Allele
If genes are the basics of the solution in theory, alleles are the values
encoded in genes are the ones we use in practice, when developing
software which uses genetic programming.
George Bora (UTCN) Genetic Algorithms December 4, 2013 5 / 20
Allele
If genes are the basics of the solution in theory, alleles are the values
encoded in genes are the ones we use in practice, when developing
software which uses genetic programming.
When the time has passed and the solution must effectively be built or
instantiated it is the allele which forms the blue print we go by.
George Bora (UTCN) Genetic Algorithms December 4, 2013 5 / 20
Allele
If genes are the basics of the solution in theory, alleles are the values
encoded in genes are the ones we use in practice, when developing
software which uses genetic programming.
When the time has passed and the solution must effectively be built or
instantiated it is the allele which forms the blue print we go by.
In the original vision for genetic algorithms there was only 1 allele per
gene, which was a binary value and was stored in a 1 bit, as the field
progressed all of those constrictions have been lifted.
George Bora (UTCN) Genetic Algorithms December 4, 2013 5 / 20
Chromosome and Individual
As in nature an animal can not have it’s information encoded in a single
gene, in programming a solution which warrants genetic algorithms is not
simple enough as to be composed on 1 gene.
George Bora (UTCN) Genetic Algorithms December 4, 2013 6 / 20
Chromosome and Individual
As in nature an animal can not have it’s information encoded in a single
gene, in programming a solution which warrants genetic algorithms is not
simple enough as to be composed on 1 gene.
Chromosomes are the collection of genes, which make up the blueprint
from which we will map our solution and create the individual.
George Bora (UTCN) Genetic Algorithms December 4, 2013 6 / 20
Chromosome and Individual
As in nature an animal can not have it’s information encoded in a single
gene, in programming a solution which warrants genetic algorithms is not
simple enough as to be composed on 1 gene.
Chromosomes are the collection of genes, which make up the blueprint
from which we will map our solution and create the individual.
If the chromosomes are the blue prints the individual is the ”end product”,
to make an analogy with software engineering, and individual is to a class
what a instance is to a object.
George Bora (UTCN) Genetic Algorithms December 4, 2013 6 / 20
Mapping
The process by which we construct a individual from the chromosome we
have generated is called mapping, it is one of the important elements
(alongside chromosome structure and fitness functions) we must consider
before we implement our design.
George Bora (UTCN) Genetic Algorithms December 4, 2013 7 / 20
Mapping
The process by which we construct a individual from the chromosome we
have generated is called mapping, it is one of the important elements
(alongside chromosome structure and fitness functions) we must consider
before we implement our design. Mapping and it’s complexity is often tied
with how we define our alleles,genes and chromosome as well as our
genetic operations, a great deal of planning being required in order to
produce the best possible algorithm.
George Bora (UTCN) Genetic Algorithms December 4, 2013 7 / 20
Crossover
Crossover is one of the fundamental operations within the toolbox of
genetic algorithms, and one of the most important methods by which we
can combine existing chromosomes to form new ones in the search for a
fit enough solution.
George Bora (UTCN) Genetic Algorithms December 4, 2013 8 / 20
Crossover
Crossover is one of the fundamental operations within the toolbox of
genetic algorithms, and one of the most important methods by which we
can combine existing chromosomes to form new ones in the search for a
fit enough solution. It involves separating each chromosome which takes
part into two parts, and then recombining parts from the different old
chromosomes to form the new set of chromosomes.
George Bora (UTCN) Genetic Algorithms December 4, 2013 8 / 20
Mutation
Mutation is the changing of the allele of a gene to another one of it’s
possible values.
George Bora (UTCN) Genetic Algorithms December 4, 2013 9 / 20
Mutation
Mutation is the changing of the allele of a gene to another one of it’s
possible values. This operation permits genetic algorithms to potentially
escape from local optimum solutions, a very important characteristic in the
field of artificial intelligence.
George Bora (UTCN) Genetic Algorithms December 4, 2013 9 / 20
Fitness Function
Via crossover and mutation we can create whole populations of
individuals, potential solutions, and so the question arises when do we
stop the evolutionary cycle?
George Bora (UTCN) Genetic Algorithms December 4, 2013 10 / 20
Fitness Function
Via crossover and mutation we can create whole populations of
individuals, potential solutions, and so the question arises when do we
stop the evolutionary cycle? The answer being when we have reached a
certain vicinity of an ideal solution, but for this we need to evaluate how
close is any one individual to satisfying our demands and being the sought
after solution.
George Bora (UTCN) Genetic Algorithms December 4, 2013 10 / 20
Fitness Function II
The implementation of the fitness function changes from one class of
problems to another, standardization being much more difficult than with
genes, and is one of the most time consuming elements of genetic
programming.
George Bora (UTCN) Genetic Algorithms December 4, 2013 11 / 20
Fitness Function II
The implementation of the fitness function changes from one class of
problems to another, standardization being much more difficult than with
genes, and is one of the most time consuming elements of genetic
programming.
Writing the fitness function, which when given a chromosome will return
how fit or close to the ideal it is, is one of the hardest yet essential tasks in
developing a solution with genetic programming as it is the only way to
close the loop and choose a final solution.
George Bora (UTCN) Genetic Algorithms December 4, 2013 11 / 20
Genetic Algorithms vs Genetic Programming
Within this field there exist two very different paradigms, genetic
algorithms and genetic programming the most visible difference between
them being the structure of the chromosomes they produce.
George Bora (UTCN) Genetic Algorithms December 4, 2013 12 / 20
Genetic Algorithms vs Genetic Programming
Within this field there exist two very different paradigms, genetic
algorithms and genetic programming the most visible difference between
them being the structure of the chromosomes they produce.
Genetic algorithms work with a chromosome which is linear and often fixed
in length, making them ideal for tunning the behavior of various solutions.
George Bora (UTCN) Genetic Algorithms December 4, 2013 12 / 20
Genetic Algorithms vs Genetic Programming
Within this field there exist two very different paradigms, genetic
algorithms and genetic programming the most visible difference between
them being the structure of the chromosomes they produce.
Genetic algorithms work with a chromosome which is linear and often fixed
in length, making them ideal for tunning the behavior of various solutions.
Genetic programming instead uses a tree-structured chromosome variable
in size, which allows it to generate the structure of the solution as well as
the behavior.
George Bora (UTCN) Genetic Algorithms December 4, 2013 12 / 20
The problem
The creation of a algorithm which is capable of classifying a target image,
returning information about the general structure, size and color (the
pre-defined classes) of the object present in the image.
George Bora (UTCN) Genetic Algorithms December 4, 2013 13 / 20
The problem
The creation of a algorithm which is capable of classifying a target image,
returning information about the general structure, size and color (the
pre-defined classes) of the object present in the image.
Requirements:
1 the use of genetic computing within the solution
2 as high of a success rate as possible
George Bora (UTCN) Genetic Algorithms December 4, 2013 13 / 20
Image classification
Image recognition, which can be classified as a sub-field of computer
vision, is a field concerned with the identification of objects and entities
within images.
George Bora (UTCN) Genetic Algorithms December 4, 2013 14 / 20
Image classification
Image recognition, which can be classified as a sub-field of computer
vision, is a field concerned with the identification of objects and entities
within images.
Image classification is a classical image recognition problem in which the
task is to assign labels to images based their content or metadata.
George Bora (UTCN) Genetic Algorithms December 4, 2013 14 / 20
The classes
The labels we apply are called classes and for this algorithm we have
defined 3 great families of classes:
form classes: for now we have defined classes for circles,
triangles(isosceles) and circles although additions to these are
relatively easy to add due to our use of genetic algorithms
color classes: right now only red, green and blue are implemented
although using the rgb format is also possible.
size classes: chosen arbitrarily.
George Bora (UTCN) Genetic Algorithms December 4, 2013 15 / 20
The chromosome
The chromosome is fairly simplistic being formed out of:
a gene encoding the form.
a gene encoding the color.
a gene encoding the size.
George Bora (UTCN) Genetic Algorithms December 4, 2013 16 / 20
Genes and Allele
The genes governing shapes at the moment can have the following
values: circle, triangle and square all identified by numeric codes.
George Bora (UTCN) Genetic Algorithms December 4, 2013 17 / 20
Genes and Allele
The genes governing shapes at the moment can have the following
values: circle, triangle and square all identified by numeric codes. The
genes governing color at the moment can accept any color defined by the
SVG standard although they can also handle rgb codes, which would
require 3 separate genes.
George Bora (UTCN) Genetic Algorithms December 4, 2013 17 / 20
Genes and Allele
The genes governing shapes at the moment can have the following
values: circle, triangle and square all identified by numeric codes. The
genes governing color at the moment can accept any color defined by the
SVG standard although they can also handle rgb codes, which would
require 3 separate genes.
The genes governing size are again numeric codes which represent hard
coded categories of size.
George Bora (UTCN) Genetic Algorithms December 4, 2013 17 / 20
Mapping
The mapping process is the most intensive one, in terms of time and lines
of code needed, followed closely by calculating the fitness function.
The process consists of:
creating a SVG file from the chromosome requires only the standard
Java standard file API.
converting said .svg file to the .png (raster) format as the image we
are trying to classify will be a raster image, requires calls to the
Inkscape API via Java’s system API.
George Bora (UTCN) Genetic Algorithms December 4, 2013 18 / 20
Fitness function
As the result of the mapping is a image of a similar raster format like the
one we seek to classify, the fitness function simply does a naive
comparison of the two images bit by bit.
George Bora (UTCN) Genetic Algorithms December 4, 2013 19 / 20
Fitness function
As the result of the mapping is a image of a similar raster format like the
one we seek to classify, the fitness function simply does a naive
comparison of the two images bit by bit.
It then normalizes the bit difference to a range between 0 and 1, as
required by the genetic algorithm, this fitness being then used in the
standard manner for deciding which chromosomes pass into the next
generation.
George Bora (UTCN) Genetic Algorithms December 4, 2013 19 / 20
The cons
This procedure has a number of weak points:
genetic algorithms traditionally aren’t suited to image classification.
the speed of this procedure, is very low due to the calls to Inkscape
and the creation of numerous files (can be improved).
the fitness function relies on a very sensible and naive image
comparison method (can be improved).
George Bora (UTCN) Genetic Algorithms December 4, 2013 20 / 20
The pros
A number of points in it’s favour
the available class list, due to the classes being written in SVG, is
very easily extendable.
in it’s current form it requires only Java and Inkscape (a very available
software).
there are a large number of image comparison methods which can be
used for the fitness function.
George Bora (UTCN) Genetic Algorithms December 4, 2013 21 / 20
The End
Thank your for your attention !
George Bora (UTCN) Genetic Algorithms December 4, 2013 22 / 20
The End
Thank your for your attention !
Any questions ?
George Bora (UTCN) Genetic Algorithms December 4, 2013 22 / 20

More Related Content

Similar to Genetic Algorithms for Image Classification

Dynamic Radius Species Conserving Genetic Algorithm for Test Generation for S...
Dynamic Radius Species Conserving Genetic Algorithm for Test Generation for S...Dynamic Radius Species Conserving Genetic Algorithm for Test Generation for S...
Dynamic Radius Species Conserving Genetic Algorithm for Test Generation for S...ijseajournal
 
Bioinformatics n bio-bio-1_uoda_workshop_4_july_2013_v1.0
Bioinformatics n bio-bio-1_uoda_workshop_4_july_2013_v1.0Bioinformatics n bio-bio-1_uoda_workshop_4_july_2013_v1.0
Bioinformatics n bio-bio-1_uoda_workshop_4_july_2013_v1.0Fokhruz Zaman
 
Haystack 2019 - Natural Language Search with Knowledge Graphs - Trey Grainger
Haystack 2019 - Natural Language Search with Knowledge Graphs - Trey GraingerHaystack 2019 - Natural Language Search with Knowledge Graphs - Trey Grainger
Haystack 2019 - Natural Language Search with Knowledge Graphs - Trey GraingerOpenSource Connections
 
Natural Language Search with Knowledge Graphs (Haystack 2019)
Natural Language Search with Knowledge Graphs (Haystack 2019)Natural Language Search with Knowledge Graphs (Haystack 2019)
Natural Language Search with Knowledge Graphs (Haystack 2019)Trey Grainger
 
Prediction of Euro 50 Using Back Propagation Neural Network (BPNN) and Geneti...
Prediction of Euro 50 Using Back Propagation Neural Network (BPNN) and Geneti...Prediction of Euro 50 Using Back Propagation Neural Network (BPNN) and Geneti...
Prediction of Euro 50 Using Back Propagation Neural Network (BPNN) and Geneti...AI Publications
 
A Survey On Genetic Algorithms
A Survey On Genetic AlgorithmsA Survey On Genetic Algorithms
A Survey On Genetic AlgorithmsValerie Felton
 
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...Application of Genetic Algorithm and Particle Swarm Optimization in Software ...
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...IOSR Journals
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithmsAmna Saeed
 
Error correction 2 3ºe4 (summary)
Error correction 2 3ºe4 (summary)Error correction 2 3ºe4 (summary)
Error correction 2 3ºe4 (summary)jeanphilippeguy
 
Genetic Algorithm 2 -.pptx
Genetic Algorithm 2 -.pptxGenetic Algorithm 2 -.pptx
Genetic Algorithm 2 -.pptxTAHANMKH
 
Genetic algorithms full lecture
Genetic algorithms full lectureGenetic algorithms full lecture
Genetic algorithms full lecturesadiacs
 
Jim Gray Award Lecture
Jim Gray Award LectureJim Gray Award Lecture
Jim Gray Award LecturePhilip Bourne
 
Markov Chain and Adaptive Parameter Selection on Particle Swarm Optimizer
Markov Chain and Adaptive Parameter Selection on Particle Swarm Optimizer  Markov Chain and Adaptive Parameter Selection on Particle Swarm Optimizer
Markov Chain and Adaptive Parameter Selection on Particle Swarm Optimizer ijsc
 

Similar to Genetic Algorithms for Image Classification (20)

E034023028
E034023028E034023028
E034023028
 
Dynamic Radius Species Conserving Genetic Algorithm for Test Generation for S...
Dynamic Radius Species Conserving Genetic Algorithm for Test Generation for S...Dynamic Radius Species Conserving Genetic Algorithm for Test Generation for S...
Dynamic Radius Species Conserving Genetic Algorithm for Test Generation for S...
 
Bioinformatics n bio-bio-1_uoda_workshop_4_july_2013_v1.0
Bioinformatics n bio-bio-1_uoda_workshop_4_july_2013_v1.0Bioinformatics n bio-bio-1_uoda_workshop_4_july_2013_v1.0
Bioinformatics n bio-bio-1_uoda_workshop_4_july_2013_v1.0
 
Haystack 2019 - Natural Language Search with Knowledge Graphs - Trey Grainger
Haystack 2019 - Natural Language Search with Knowledge Graphs - Trey GraingerHaystack 2019 - Natural Language Search with Knowledge Graphs - Trey Grainger
Haystack 2019 - Natural Language Search with Knowledge Graphs - Trey Grainger
 
Natural Language Search with Knowledge Graphs (Haystack 2019)
Natural Language Search with Knowledge Graphs (Haystack 2019)Natural Language Search with Knowledge Graphs (Haystack 2019)
Natural Language Search with Knowledge Graphs (Haystack 2019)
 
Prediction of Euro 50 Using Back Propagation Neural Network (BPNN) and Geneti...
Prediction of Euro 50 Using Back Propagation Neural Network (BPNN) and Geneti...Prediction of Euro 50 Using Back Propagation Neural Network (BPNN) and Geneti...
Prediction of Euro 50 Using Back Propagation Neural Network (BPNN) and Geneti...
 
RM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lectureRM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lecture
 
A Survey On Genetic Algorithms
A Survey On Genetic AlgorithmsA Survey On Genetic Algorithms
A Survey On Genetic Algorithms
 
M017127578
M017127578M017127578
M017127578
 
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...Application of Genetic Algorithm and Particle Swarm Optimization in Software ...
Application of Genetic Algorithm and Particle Swarm Optimization in Software ...
 
SIRG-BSU_2.pptx
SIRG-BSU_2.pptxSIRG-BSU_2.pptx
SIRG-BSU_2.pptx
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Error correction 2 3ºe4 (summary)
Error correction 2 3ºe4 (summary)Error correction 2 3ºe4 (summary)
Error correction 2 3ºe4 (summary)
 
S04405107111
S04405107111S04405107111
S04405107111
 
Genetic Algorithm 2 -.pptx
Genetic Algorithm 2 -.pptxGenetic Algorithm 2 -.pptx
Genetic Algorithm 2 -.pptx
 
Genetic algorithms full lecture
Genetic algorithms full lectureGenetic algorithms full lecture
Genetic algorithms full lecture
 
Jim Gray Award Lecture
Jim Gray Award LectureJim Gray Award Lecture
Jim Gray Award Lecture
 
Markov Chain and Adaptive Parameter Selection on Particle Swarm Optimizer
Markov Chain and Adaptive Parameter Selection on Particle Swarm Optimizer  Markov Chain and Adaptive Parameter Selection on Particle Swarm Optimizer
Markov Chain and Adaptive Parameter Selection on Particle Swarm Optimizer
 
L018147377
L018147377L018147377
L018147377
 
Genetic Algorithms.pdf
Genetic Algorithms.pdfGenetic Algorithms.pdf
Genetic Algorithms.pdf
 

Recently uploaded

What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

Genetic Algorithms for Image Classification

  • 1. Genetic Algorithms George Bora UTCN December 4, 2013 George Bora (UTCN) Genetic Algorithms December 4, 2013 1 / 20
  • 2. Computer Science to Evolutionary Computation Within the vast field of computer science under it’s vast array of potential applications there exists the branch of artificial intelligence. George Bora (UTCN) Genetic Algorithms December 4, 2013 2 / 20
  • 3. Computer Science to Evolutionary Computation Within the vast field of computer science under it’s vast array of potential applications there exists the branch of artificial intelligence. One of the sub-branches of artificial intelligence is evolutionary computation which seeks to achieve continuous optimization and combinatorial optimization by incorporating knowledge of natural evolution processes. George Bora (UTCN) Genetic Algorithms December 4, 2013 2 / 20
  • 4. Basic Concepts from Biology The basic building blocks for evolutionary computation, which have kept their names from their native science, are as follows: genes allele chromosome individual mapping mutation and crossover fitness function George Bora (UTCN) Genetic Algorithms December 4, 2013 3 / 20
  • 5. Genes The element from which this method derives it name, as genes are the basic building blocks of life. George Bora (UTCN) Genetic Algorithms December 4, 2013 4 / 20
  • 6. Genes The element from which this method derives it name, as genes are the basic building blocks of life. So too in our search for the solution for various problems, genes are the basic elements we switch around and juggle with in order to arrive at a more optimum solution. George Bora (UTCN) Genetic Algorithms December 4, 2013 4 / 20
  • 7. Allele If genes are the basics of the solution in theory, alleles are the values encoded in genes are the ones we use in practice, when developing software which uses genetic programming. George Bora (UTCN) Genetic Algorithms December 4, 2013 5 / 20
  • 8. Allele If genes are the basics of the solution in theory, alleles are the values encoded in genes are the ones we use in practice, when developing software which uses genetic programming. When the time has passed and the solution must effectively be built or instantiated it is the allele which forms the blue print we go by. George Bora (UTCN) Genetic Algorithms December 4, 2013 5 / 20
  • 9. Allele If genes are the basics of the solution in theory, alleles are the values encoded in genes are the ones we use in practice, when developing software which uses genetic programming. When the time has passed and the solution must effectively be built or instantiated it is the allele which forms the blue print we go by. In the original vision for genetic algorithms there was only 1 allele per gene, which was a binary value and was stored in a 1 bit, as the field progressed all of those constrictions have been lifted. George Bora (UTCN) Genetic Algorithms December 4, 2013 5 / 20
  • 10. Chromosome and Individual As in nature an animal can not have it’s information encoded in a single gene, in programming a solution which warrants genetic algorithms is not simple enough as to be composed on 1 gene. George Bora (UTCN) Genetic Algorithms December 4, 2013 6 / 20
  • 11. Chromosome and Individual As in nature an animal can not have it’s information encoded in a single gene, in programming a solution which warrants genetic algorithms is not simple enough as to be composed on 1 gene. Chromosomes are the collection of genes, which make up the blueprint from which we will map our solution and create the individual. George Bora (UTCN) Genetic Algorithms December 4, 2013 6 / 20
  • 12. Chromosome and Individual As in nature an animal can not have it’s information encoded in a single gene, in programming a solution which warrants genetic algorithms is not simple enough as to be composed on 1 gene. Chromosomes are the collection of genes, which make up the blueprint from which we will map our solution and create the individual. If the chromosomes are the blue prints the individual is the ”end product”, to make an analogy with software engineering, and individual is to a class what a instance is to a object. George Bora (UTCN) Genetic Algorithms December 4, 2013 6 / 20
  • 13. Mapping The process by which we construct a individual from the chromosome we have generated is called mapping, it is one of the important elements (alongside chromosome structure and fitness functions) we must consider before we implement our design. George Bora (UTCN) Genetic Algorithms December 4, 2013 7 / 20
  • 14. Mapping The process by which we construct a individual from the chromosome we have generated is called mapping, it is one of the important elements (alongside chromosome structure and fitness functions) we must consider before we implement our design. Mapping and it’s complexity is often tied with how we define our alleles,genes and chromosome as well as our genetic operations, a great deal of planning being required in order to produce the best possible algorithm. George Bora (UTCN) Genetic Algorithms December 4, 2013 7 / 20
  • 15. Crossover Crossover is one of the fundamental operations within the toolbox of genetic algorithms, and one of the most important methods by which we can combine existing chromosomes to form new ones in the search for a fit enough solution. George Bora (UTCN) Genetic Algorithms December 4, 2013 8 / 20
  • 16. Crossover Crossover is one of the fundamental operations within the toolbox of genetic algorithms, and one of the most important methods by which we can combine existing chromosomes to form new ones in the search for a fit enough solution. It involves separating each chromosome which takes part into two parts, and then recombining parts from the different old chromosomes to form the new set of chromosomes. George Bora (UTCN) Genetic Algorithms December 4, 2013 8 / 20
  • 17. Mutation Mutation is the changing of the allele of a gene to another one of it’s possible values. George Bora (UTCN) Genetic Algorithms December 4, 2013 9 / 20
  • 18. Mutation Mutation is the changing of the allele of a gene to another one of it’s possible values. This operation permits genetic algorithms to potentially escape from local optimum solutions, a very important characteristic in the field of artificial intelligence. George Bora (UTCN) Genetic Algorithms December 4, 2013 9 / 20
  • 19. Fitness Function Via crossover and mutation we can create whole populations of individuals, potential solutions, and so the question arises when do we stop the evolutionary cycle? George Bora (UTCN) Genetic Algorithms December 4, 2013 10 / 20
  • 20. Fitness Function Via crossover and mutation we can create whole populations of individuals, potential solutions, and so the question arises when do we stop the evolutionary cycle? The answer being when we have reached a certain vicinity of an ideal solution, but for this we need to evaluate how close is any one individual to satisfying our demands and being the sought after solution. George Bora (UTCN) Genetic Algorithms December 4, 2013 10 / 20
  • 21. Fitness Function II The implementation of the fitness function changes from one class of problems to another, standardization being much more difficult than with genes, and is one of the most time consuming elements of genetic programming. George Bora (UTCN) Genetic Algorithms December 4, 2013 11 / 20
  • 22. Fitness Function II The implementation of the fitness function changes from one class of problems to another, standardization being much more difficult than with genes, and is one of the most time consuming elements of genetic programming. Writing the fitness function, which when given a chromosome will return how fit or close to the ideal it is, is one of the hardest yet essential tasks in developing a solution with genetic programming as it is the only way to close the loop and choose a final solution. George Bora (UTCN) Genetic Algorithms December 4, 2013 11 / 20
  • 23. Genetic Algorithms vs Genetic Programming Within this field there exist two very different paradigms, genetic algorithms and genetic programming the most visible difference between them being the structure of the chromosomes they produce. George Bora (UTCN) Genetic Algorithms December 4, 2013 12 / 20
  • 24. Genetic Algorithms vs Genetic Programming Within this field there exist two very different paradigms, genetic algorithms and genetic programming the most visible difference between them being the structure of the chromosomes they produce. Genetic algorithms work with a chromosome which is linear and often fixed in length, making them ideal for tunning the behavior of various solutions. George Bora (UTCN) Genetic Algorithms December 4, 2013 12 / 20
  • 25. Genetic Algorithms vs Genetic Programming Within this field there exist two very different paradigms, genetic algorithms and genetic programming the most visible difference between them being the structure of the chromosomes they produce. Genetic algorithms work with a chromosome which is linear and often fixed in length, making them ideal for tunning the behavior of various solutions. Genetic programming instead uses a tree-structured chromosome variable in size, which allows it to generate the structure of the solution as well as the behavior. George Bora (UTCN) Genetic Algorithms December 4, 2013 12 / 20
  • 26. The problem The creation of a algorithm which is capable of classifying a target image, returning information about the general structure, size and color (the pre-defined classes) of the object present in the image. George Bora (UTCN) Genetic Algorithms December 4, 2013 13 / 20
  • 27. The problem The creation of a algorithm which is capable of classifying a target image, returning information about the general structure, size and color (the pre-defined classes) of the object present in the image. Requirements: 1 the use of genetic computing within the solution 2 as high of a success rate as possible George Bora (UTCN) Genetic Algorithms December 4, 2013 13 / 20
  • 28. Image classification Image recognition, which can be classified as a sub-field of computer vision, is a field concerned with the identification of objects and entities within images. George Bora (UTCN) Genetic Algorithms December 4, 2013 14 / 20
  • 29. Image classification Image recognition, which can be classified as a sub-field of computer vision, is a field concerned with the identification of objects and entities within images. Image classification is a classical image recognition problem in which the task is to assign labels to images based their content or metadata. George Bora (UTCN) Genetic Algorithms December 4, 2013 14 / 20
  • 30. The classes The labels we apply are called classes and for this algorithm we have defined 3 great families of classes: form classes: for now we have defined classes for circles, triangles(isosceles) and circles although additions to these are relatively easy to add due to our use of genetic algorithms color classes: right now only red, green and blue are implemented although using the rgb format is also possible. size classes: chosen arbitrarily. George Bora (UTCN) Genetic Algorithms December 4, 2013 15 / 20
  • 31. The chromosome The chromosome is fairly simplistic being formed out of: a gene encoding the form. a gene encoding the color. a gene encoding the size. George Bora (UTCN) Genetic Algorithms December 4, 2013 16 / 20
  • 32. Genes and Allele The genes governing shapes at the moment can have the following values: circle, triangle and square all identified by numeric codes. George Bora (UTCN) Genetic Algorithms December 4, 2013 17 / 20
  • 33. Genes and Allele The genes governing shapes at the moment can have the following values: circle, triangle and square all identified by numeric codes. The genes governing color at the moment can accept any color defined by the SVG standard although they can also handle rgb codes, which would require 3 separate genes. George Bora (UTCN) Genetic Algorithms December 4, 2013 17 / 20
  • 34. Genes and Allele The genes governing shapes at the moment can have the following values: circle, triangle and square all identified by numeric codes. The genes governing color at the moment can accept any color defined by the SVG standard although they can also handle rgb codes, which would require 3 separate genes. The genes governing size are again numeric codes which represent hard coded categories of size. George Bora (UTCN) Genetic Algorithms December 4, 2013 17 / 20
  • 35. Mapping The mapping process is the most intensive one, in terms of time and lines of code needed, followed closely by calculating the fitness function. The process consists of: creating a SVG file from the chromosome requires only the standard Java standard file API. converting said .svg file to the .png (raster) format as the image we are trying to classify will be a raster image, requires calls to the Inkscape API via Java’s system API. George Bora (UTCN) Genetic Algorithms December 4, 2013 18 / 20
  • 36. Fitness function As the result of the mapping is a image of a similar raster format like the one we seek to classify, the fitness function simply does a naive comparison of the two images bit by bit. George Bora (UTCN) Genetic Algorithms December 4, 2013 19 / 20
  • 37. Fitness function As the result of the mapping is a image of a similar raster format like the one we seek to classify, the fitness function simply does a naive comparison of the two images bit by bit. It then normalizes the bit difference to a range between 0 and 1, as required by the genetic algorithm, this fitness being then used in the standard manner for deciding which chromosomes pass into the next generation. George Bora (UTCN) Genetic Algorithms December 4, 2013 19 / 20
  • 38. The cons This procedure has a number of weak points: genetic algorithms traditionally aren’t suited to image classification. the speed of this procedure, is very low due to the calls to Inkscape and the creation of numerous files (can be improved). the fitness function relies on a very sensible and naive image comparison method (can be improved). George Bora (UTCN) Genetic Algorithms December 4, 2013 20 / 20
  • 39. The pros A number of points in it’s favour the available class list, due to the classes being written in SVG, is very easily extendable. in it’s current form it requires only Java and Inkscape (a very available software). there are a large number of image comparison methods which can be used for the fitness function. George Bora (UTCN) Genetic Algorithms December 4, 2013 21 / 20
  • 40. The End Thank your for your attention ! George Bora (UTCN) Genetic Algorithms December 4, 2013 22 / 20
  • 41. The End Thank your for your attention ! Any questions ? George Bora (UTCN) Genetic Algorithms December 4, 2013 22 / 20