Presentation is loading. Please wait.

Presentation is loading. Please wait.

Particle Swarm Optimization for Image Analysis Stefano Cagnoni Dipartimento di Ingegneria dell’Informazione Università di Parma.

Similar presentations


Presentation on theme: "Particle Swarm Optimization for Image Analysis Stefano Cagnoni Dipartimento di Ingegneria dell’Informazione Università di Parma."— Presentation transcript:

1 Particle Swarm Optimization for Image Analysis Stefano Cagnoni Dipartimento di Ingegneria dell’Informazione Università di Parma

2 Particle Swarm Optimization Optimization technique inspired by the collective behavior of flocks (swarms) of birds in search of food Each particle moves ‘randomly’ in the parameter space under the action of an attractive force field generated by: the best point in the parameter space ever discovered by the particle itself the best point in the parameter space ever discovered by the whole swarm

3 Basic PSO equations X P (t) = X P (t-1) + v P (t) v P (t) = w * v P (t-1) + c 1 * rand() * [BestX P – X P (t-1)] + c 2 * rand() * [gBestX – X P (t-1)] c 1, c 2 positive constants w inertia weight X P position of particle P BestX P best location reached by particle P up to time t-1 gBestX best location ever found by the whole swarm rand()random number between 0 and 1 The swarm converges towards the fittest point. Particle Swarm Optimization

4 PSO and Image Analysis Multi-objective optimization: the goal is to identify (segment out) one or MORE regions of interest (ROIs) in the search space (the image), not a single optimum. k-mean clustering PSO (Passaro and Starita 2006): the swarm reorganizes itself in multiple sub-swarms: each sub-swarm may then ‘address’ a different target.

5 Applications License Plate Detection: real time detection of the license-plate region within images of running cars Pasta Segmentation: detection and segmentation of larger pasta pieces in images with variable lighting and background

6 Pasta Segmentation (GECCO 2006 competition) Goal: to segment pieces of pasta, separating them from background and from ‘pasta noise’

7 Pasta Segmentation k-mean clustering PSO (Passaro and Starita 2006) : the swarm re-organizes itself in multiple sub- swarms: each sub-swarm may then ‘address’ a different target.

8 First search stage: Global search: we try to grossly detect, within the whole image, the most ‘promising’ areas Pasta Segmentation

9 Second search stage: Local search: attention is focused on the ROIs detected in the previous stage to refine the borders of candidate pasta regions. Pasta Segmentation

10 Fitness function Since pixels of a certain color are sought, fitness is based on distance in the RGB space if ( |r(x,y)-g(x,y)| K 2 ) punctual fitness = K 1 - |r(x,y) – g(x,y)| else punctual fitness = 0 (K 1 =30, K 2 =60) Pasta Segmentation

11 Using only color information could cause swarms to converge towards ISOLATED pixels similar to the color prototype. A local fitness term has been added, which depends on the number of neighbors of the current particle which have high punctual fitness fitness(x,y) = punctual fitness(x,y) + local fitness(x,y) where local fitness = K 0 * number of neighbors Pasta Segmentation

12 Basic PSO equation v P (t) = w * v P (t-1) + C 1 * rand() * [BestX P – X P (t-1)] + C 2 * rand() * [gBestX – X P (t-1)] The swarm converges towards the fittest pixels. However, the goal is to segment out whole pasta pieces and not only to detect points within them. Pasta Segmentation

13 A repulsion term is added: v P *(t) = v P (t) + repulsion p The repulsion term between two particles is computed, separately along each axis, as repulsion(i, j) = REPULSION_RANGE - |X i -X j | REPULSION_RANGE is the maximum distance within which the particles interact. The global repulsion term for P is the average of all repulsion terms with particles interacting with it: repulsion p =  j repulsion(p,j) / n Pasta Segmentation

14 The standard equation has been further modified, to increase stability of sub-swarms. If a particle with high punctual fitness lies within a region with high density of particles, then it has a probability, which is linearly dependent on such a density, of staying there: Prob{X t-1 =X t } = number of particles in the neighbourhood / total number of particles in the swarm Pasta Segmentation

15 Global search We assign each pixel a score which is proportional to the number of times a particle has flown over (or stayed on, if the particle stands still) it. The higher the score of a pixel, the higher the probability for that pixel of representing pasta. Pasta Segmentation

16 Each particle’s ‘influence area’ is actually a neighborhood of the current pixel, so the score of all the neighboring pixels is also increased by a term which decreases with distance: 11111 13331 13531 13331 11111 Pasta Segmentation To make statistics more stable, a number of runs are performed, each of which starts from a different random re-initialization of the whole swarm.

17 To bias the following step (local search) further, the dynamic range of the results of global search is stretched Using the mean score as threshold, the pixel scores which are above the threshold are further increased, whilst the scores which are below the threshold are further reduced Pasta Segmentation

18 RESULTS AT THE END OF GLOBAL SEARCH Pasta Segmentation

19 Local search Attention is focused onto the most interesting regions, limiting the domain where the swarm can move to sub- regions with high density of high-score pixels Pasta Segmentation

20 The local search algorithm is conceptually very similar to the global search After global search After local search Pasta Segmentation

21 after local search input image RESULTS AT THE END OF LOCAL SEARCH Pasta Segmentation

22 Normalization and thresholding Scores are normalized, after which a threshold is applied, to produce a binary output input imagebinary output% of correctly classified pixels: 97.6% Pasta Segmentation

23 input imageafter global search Pasta Segmentation

24 % of correctly classified pixels after binarization: 95.8% Pasta Segmentation input imageafter local search

25 Pasta Segmentation input imageafter global search

26 % of correctly classified pixels after binarization: 92.6% input imageafter local search Pasta Segmentation

27 input imageafter global search

28 Pasta Segmentation % of correctly classified pixels after binarization: 90.3% input imageafter local search

29 Pasta Segmentation input imageafter global search

30 Pasta Segmentation % of correctly classified pixels after binarization: 92.8% input imageafter local search

31 Plates feature high density of pixels with high horizontal gradient values due to the contrast between letters (black) and plate background (white) The horizontal gradient can be easily and efficiently approximated using differences PSO-based License Plate Detection

32 As for the pasta segmentation problem Two Search stages : Global search: the most ‘promising’ areas within the whole image are grossly detected Local search: attention is focused on the ROIs defined in the previous stage to detect good plate candidates A repulsion term is introduced in the PSO equation PSO-based License Plate Detection

33 The goal is to find regions featuring high density of high-gradient pixels To prevent swarms from converging towards ISOLATED pixels, fitness has two terms: punctual fitness, depending on visual features local fitness, proportional to the number of neighbors PSO-based License Plate Detection

34 The swarm explores a gray-scale image fitness(x,y) = punctual fitness(x,y) + local fitness(x,y) if ( |r(x,y)-g(x,y)|< K 0 && |r(x,y)-b(x,y)|<K 0 && |g(x,y)-b(x,y)| <K 0 ) punctual_fitness = max(right_gradient,left_gradient); else punctual_fitness = 0; whereright_gradient = |grayscale(x,y)-grayscale(x+1,y)|; left_gradient = |grayscale(x,y)-grayscale(x-1,y)|; local fitness = K1 * neighbor_number PSO-based License Plate Detection

35 The standard equation has been further modified to increase stability of sub-swarms. If a particle with high punctual fitness lies within a region with high density of particles, then it has a probability, which is linearly dependent on such a density, of staying there: Prob { X t-1 =X t } = number of particles in the neighborhood / total number of particles in the swarm PSO-based License Plate Detection

36 GLOBAL SEARCH RESULTS PSO-based License Plate Detection

37 Two ‘promising’ areas are detected (sub-swarms with Nparticles > T): the larger one will be explored first PSO-based License Plate Detection

38 The whole swarm is re-initialized near the selected area and a local search is performed, using the previous algorithm. PSO-based License Plate Detection

39 A bounding box is computed enclosing all particles with high punctual fitness. If this box has a w:h ratio = 5:1, we can assert we found the plate. PSO-based License Plate Detection

40 Otherwise the box is expanded, letting some agents move up and down (or left and right), in order to reach the given ratio. On failure, the next region is explored. PSO-based License Plate Detection

41 Final result PSO-based License Plate Detection

42 TEST RESULTS Set of 98 plates, 10 runs per plate = 980 runs NAvg. time Correct detections 9550.083 s Wrong detections150.151 s Plate not found101.424 s In many cases performing the whole plate detection process has a lower computation cost than computing the gradient image PSO-based License Plate Detection

43 (Single-frame) detection percentage vs. time Real-time tracking can be achieved re-initializing the swarm in frame F(t+1) within the region where the plate has been detected in frame F(t): average detection time 0.03s (more than 30 fps can be analyzed). PSO-based License Plate Detection

44 Swarm Intelligence approaches can be very efficient in roughly detecting object positions, as they effectively sample the search space Very interesting approaches to the analysis of stereo images for obstacle detection and robot navigation have been described by Louchet, Lutton and Olague

45 Genetic and Evolutionary Image Processing and Computer Vision Hindawi Book Series in Signal Processing Editors: S. Cagnoni, E. Lutton, G. Olague UPCOMING BOOK

46 EVOIASP 2008 (part of Evo* 2008) 10 th European Workshop on Evolutionary Computation for Image Analysis and Signal Processing Napoli, March 2008 Deadline: 1 November 2007 UPCOMING WORKSHOP


Download ppt "Particle Swarm Optimization for Image Analysis Stefano Cagnoni Dipartimento di Ingegneria dell’Informazione Università di Parma."

Similar presentations


Ads by Google