Presentation is loading. Please wait.

Presentation is loading. Please wait.

Scale Invariant Object Detection using a Hybrid Genetic Algorithm – Fuzzy Logic Approach Group – 9 Ayesha Farrukh [04030004] Junaid Akhtar [04030019]

Similar presentations


Presentation on theme: "Scale Invariant Object Detection using a Hybrid Genetic Algorithm – Fuzzy Logic Approach Group – 9 Ayesha Farrukh [04030004] Junaid Akhtar [04030019]"— Presentation transcript:

1 Scale Invariant Object Detection using a Hybrid Genetic Algorithm – Fuzzy Logic Approach Group – 9 Ayesha Farrukh [04030004] Junaid Akhtar [04030019]

2 Progress Matlab Implementation – Brute force Template Matching Initialize Population Crossover Mutation Fitness Function

3 Brute Force Results Reference Image Template (145, 171)

4 Cross Correlation Surface

5 Correlation Surface [zoomed in] Peak value at: (145, 171) Value = 0.9666

6 Tic-Toc This operation took 152.01 seconds

7 Other Matlab Functions Explored DEC2BIN BIN2DEC RAND CORR2

8 GA Pseudocode StartGA( img, template ) // Initialize a random population of individuals P = initPopulation ( populationSize, imgDimension, scaleDimension ); // Evaluate fitness of all initial individuals of population [fitnessP, fuzzyClassifictaionP ] = calcFitness ( P, img, template ); // test for termination criterion: (Correlation Value > THRESHOLD) WHILE not done do // select a sub-population for offspring production selectedP = selectparents( P ); // Crossover [newP] = crossover( selectedP ); // Mutate x OR y OR scale value randomly [mutatedP] = mutate( newP ); // Evaluate fitness of new calcFitness( mutatedP ); // select the survivors from actual fitness P = survive( P, mutatedP ); END

9 Chromosome Definition 000110001 011111100 1001 x = 49y = 252 Index of Scale to Use

10 512 x 512 Reference Image

11 Template Image

12 Scale imresize Bicubic Interpolation for resizing the template image

13 Initial Population function [initialPopulation, lengthImageDimension, lengthMaxScale] = initialize(populationSize, imageDimension, maxScale) binaryImageDimension = dec2bin(imageDimension); binaryMaxScale = dec2bin(maxScale); lengthImageDimension = length(binaryImageDimension); lengthMaxScale = length(binaryMaxScale); bitsInitialPopulation = (2 * lengthImageDimension) + lengthMaxScale; initialPopulation = zeros(populationSize, bitsInitialPopulation); for i = 1:populationSize xLocation = round(imageDimension*rand); xLocation = dec2bin(xLocation); initialPopulation(i,length(binaryImageDimension) - length(xLocation) + 1 :length(binaryImageDimension)) = xLocation - 48; yLocation = round(imageDimension*rand); yLocation = dec2bin(yLocation); initialPopulation(i,(2*length(binaryImageDimension)) - length(yLocation) + 1 :2*length(binaryImageDimension)) = yLocation - 48; scale = round(maxScale*rand); scale = dec2bin(scale); initialPopulation(i,bitsInitialPopulation - length(scale) + 1 : bitsInitialPopulation) = scale - 48; end

14 Select Parents Sort the current Population according to their respective fitness values Select the best

15 CalculateFitness Use corr2 function to calculate fitness for each individual Classify each individual using Fuzzy classifiers: Negative, Low, & Positive correlation

16 Crossover function [newPopulation] = crossover(selectedPopulation) sizeSelectedPopulation = size(selectedPopulation,1); sizeIndividual = size(selectedPopulation,2); count = 1; while count < sizeSelectedPopulation crossoverPoint = round(sizeIndividual*rand) newPopulation(count,:) = selectedPopulation(count,:); newPopulation(count+1,:) = selectedPopulation(count+1,:); newPopulation(count,crossoverPoint:sizeIndividual) = selectedPopulation(count+1,crossoverPoint:sizeIndividual); newPopulation(count+1,1:crossoverPoint-1) = selectedPopulation(count,1:crossoverPoint-1); count = count + 2; end

17 Mutate( P ) For each member of the selected population ‘P’ Randomly decide whether or not to mutate Randomly decide index of bit to mutate Perform mutation 0011000111111100100100 00110001 0 1111100100100

18 Next Episode Integrate the components Compile Results on Different Images Use information generated during fuzzy classification to improve matching time Compare Tic-Toc Results for time Compare FLOPS for memory


Download ppt "Scale Invariant Object Detection using a Hybrid Genetic Algorithm – Fuzzy Logic Approach Group – 9 Ayesha Farrukh [04030004] Junaid Akhtar [04030019]"

Similar presentations


Ads by Google