a hybrid particle swarm optimization and artificial immune system algorithm for image enhancement

9
Soft Comput DOI 10.1007/s00500-014-1394-6 METHODOLOGIES AND APPLICATION A hybrid particle swarm optimization and artificial immune system algorithm for image enhancement Prasant Kumar Mahapatra · Susmita Ganguli · Amod Kumar © Springer-Verlag Berlin Heidelberg 2014 Abstract Image enhancement means to improve the per- ception of information in images. Histogram equalization (HE) and linear contrast stretching (LCS) are the commonly used methods for image enhancement. But images obtained through these processes, generally, have excessive contrast enhancement due to which they are not suitable for use in fields where brightness is of critical importance. In this paper, a hybrid algorithm based on Particle Swarm Optimization (PSO) along with Negative Selection Algorithm, a model of artificial immune system, is proposed for image enhancement which is achieved by enhancing the intensity of the gray lev- els of the images. The proposed algorithm is applied to his- togram equalized images of lathe tool and MATLAB inbuilt images to verify its effectiveness. The results are compared with conventional enhancement techniques such as HE, LCS and Standard PSO algorithm based image enhancement. Keywords Particle swarm optimization · Artificial immune system · Negative selection algorithm · Image enhancement · Histogram equalization · Linear contrast stretching Communicated by V. Loia. P. K. Mahapatra (B ) · S. Ganguli · A. Kumar V-2(Biomedical Instrumentation Division), CSIR-Central Scientific Instruments Organisation, Sector-30, Chandigarh 160030, India e-mail: [email protected]; [email protected] S. Ganguli e-mail: [email protected] A. Kumar e-mail: [email protected] S. Ganguli Department of Electronics and Communication, Tezpur University, Tezpur 784028, India 1 Introduction Image enhancement basically improves the original image so that information from the enhanced image can be easily collected. According to Maini and Aggarwal (2010), it is a technique to bring out the detail of the image or to highlight some areas in the image. This technique can be divided into point operation, spatial operation, transformation and pseudo coloring. In this paper, image enhancement is done on the basis of spatial operation (Gonzalez et al. 2009). There are several techniques such as Histogram equaliza- tion (HE) and linear contrast stretching (LCS) using which the contrast of an image can be enhanced. HE enhances the contrast of images by transforming the intensity values of the image so that the histogram of the improved image approx- imately matches the histogram of ideal image. LCS maps the intensity values in gray scale image into new values so that 1 % of the data are saturated at low and high intensi- ties of the original image. Adaptive histogram equalization is another method for image enhancement where the image is divided into small regions and histogram equalization is applied to these regions and finally they are fused to produce the resultant enhanced image [Image Processing User Guide by MATLAB Version: 8.2.0.701 (R2013b)]. Different algorithms have been used by researchers to solve this problem of image enhancement. In Hashemi et al. (2010), the author applied a contrast enhancement tech- nique using Genetic Algorithm. Similarly, a combination of different transformation functions with different parameters is used to enhance images using PSO in Braik et al. (2007) and Gorai and Ghosh (2009). In Kwok et al. (2009), contrast enhancement and intensity preservation using PSO have been done. Firefly algorithm has also been used in Hassanzadeh et al. (2011) for image enhancement. In Muna (2011), the author has introduced a new method to enhance high contrast 123

Upload: amod

Post on 28-Mar-2017

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A hybrid particle swarm optimization and artificial immune system algorithm for image enhancement

Soft ComputDOI 10.1007/s00500-014-1394-6

METHODOLOGIES AND APPLICATION

A hybrid particle swarm optimization and artificial immunesystem algorithm for image enhancement

Prasant Kumar Mahapatra · Susmita Ganguli · Amod Kumar

© Springer-Verlag Berlin Heidelberg 2014

Abstract Image enhancement means to improve the per-ception of information in images. Histogram equalization(HE) and linear contrast stretching (LCS) are the commonlyused methods for image enhancement. But images obtainedthrough these processes, generally, have excessive contrastenhancement due to which they are not suitable for use infields where brightness is of critical importance. In this paper,a hybrid algorithm based on Particle Swarm Optimization(PSO) along with Negative Selection Algorithm, a model ofartificial immune system, is proposed for image enhancementwhich is achieved by enhancing the intensity of the gray lev-els of the images. The proposed algorithm is applied to his-togram equalized images of lathe tool and MATLAB inbuiltimages to verify its effectiveness. The results are comparedwith conventional enhancement techniques such as HE, LCSand Standard PSO algorithm based image enhancement.

Keywords Particle swarm optimization · Artificialimmune system · Negative selection algorithm · Imageenhancement · Histogram equalization · Linear contraststretching

Communicated by V. Loia.

P. K. Mahapatra (B) · S. Ganguli · A. KumarV-2(Biomedical Instrumentation Division), CSIR-CentralScientific Instruments Organisation, Sector-30,Chandigarh 160030, Indiae-mail: [email protected]; [email protected]

S. Gangulie-mail: [email protected]

A. Kumare-mail: [email protected]

S. GanguliDepartment of Electronics and Communication, Tezpur University,Tezpur 784028, India

1 Introduction

Image enhancement basically improves the original imageso that information from the enhanced image can be easilycollected. According to Maini and Aggarwal (2010), it is atechnique to bring out the detail of the image or to highlightsome areas in the image. This technique can be divided intopoint operation, spatial operation, transformation and pseudocoloring. In this paper, image enhancement is done on thebasis of spatial operation (Gonzalez et al. 2009).

There are several techniques such as Histogram equaliza-tion (HE) and linear contrast stretching (LCS) using whichthe contrast of an image can be enhanced. HE enhances thecontrast of images by transforming the intensity values of theimage so that the histogram of the improved image approx-imately matches the histogram of ideal image. LCS mapsthe intensity values in gray scale image into new values sothat 1 % of the data are saturated at low and high intensi-ties of the original image. Adaptive histogram equalizationis another method for image enhancement where the imageis divided into small regions and histogram equalization isapplied to these regions and finally they are fused to producethe resultant enhanced image [Image Processing User Guideby MATLAB Version: 8.2.0.701 (R2013b)].

Different algorithms have been used by researchers tosolve this problem of image enhancement. In Hashemi etal. (2010), the author applied a contrast enhancement tech-nique using Genetic Algorithm. Similarly, a combination ofdifferent transformation functions with different parametersis used to enhance images using PSO in Braik et al. (2007)and Gorai and Ghosh (2009). In Kwok et al. (2009), contrastenhancement and intensity preservation using PSO have beendone. Firefly algorithm has also been used in Hassanzadehet al. (2011) for image enhancement. In Muna (2011), theauthor has introduced a new method to enhance high contrast

123

Page 2: A hybrid particle swarm optimization and artificial immune system algorithm for image enhancement

P. K. Mahapatra et al.

images of digital camera. In Mohan and Ravishankar (2013),optimal contrast enhancement is used to enhance mammo-gram images, whereas in Kaur et al. (2011), a new form ofHE is used to enhance distorted images.

Many studies have been done by combining the PSO andclonal selection algorithm. In Afshinmanesh et al. (2005),the author has proposed a new binary particle swarm opti-mization method based on the theory of immunity in biol-ogy. A computationally effective algorithm of combiningPSO with AIS for solving the minimum make span prob-lem of job-shop scheduling is proposed by Ge et al. (2008).A combination of PSO with Clonal selection AIS methodhas also been developed for different optimization problems(Sedighizadeh et al. 2010; Nejad et al. 2012). Hybrid algo-rithms based on AIS/PSO (Mange and Adviser-Kountanis2013) and clonal selection and small population based PSO(Mitra and Venayagamoorthy 2008) have also been proposedand tested in benchmark functions.

In this paper, a hybrid algorithm based on PSO and neg-ative selection AIS is used to improve the quality of imagesby enhancing the contrast of gray-level images. The result-ing gray-level enhanced images are found to be better com-pared with other automatic image contrast enhancementtechniques. The algorithm has been developed using MAT-LAB® software [version: 8.2.0.701 (R2013b)]. The detailedapproach is discussed in the methodology section.

1.1 Particle swarm optimization

Particle swarm optimization (PSO) is a robust stochastic opti-mization technique inspired by the behavior of swarms. Thisalgorithm represents the swarm as particles which are consid-ered as agents flying in a problem space (Merkle and Mid-dendorf 2005). These particles move around in the searchspace with a specified velocity looking for the best solution(Kennedy et al. 2001; Hendtlass 2007). The solution is rep-resented by the location of the particle. Each of them keepstrack of its coordinates in the solution space which are asso-ciated with the best solution (fitness) (Sun et al. 2013) thathas been achieved so far by that particle. This value is calledlocal best or particle best, denoted by pbest. Another bestvalue that is tracked by the PSO is the best value obtainedso far by any particle in the neighbourhood of that particle.This value is called gbest.

The basic operation of PSO is to first randomly place theswarm of particles in the n-dimensional search space, assign-ing each one of them a random velocity and position. Thevelocity and position change with each iteration or gener-ation of movement. At each iteration, a new value of thevelocity is evaluated. This value is then used to calculate thenext position of the particle in the search space. This processis iterated a number of times until an optimal solution isachieved. The working of PSO is governed by two equations

given by:

Vi = ωVi + c1.r1(pbest − pL) + c2.r2(gbest − pL) (1)

pL = pL + Vi (2)

where

ω = 1/ i teration_number [Braik et al, 2007] (3)

Here, Vi and pL are velocity and position of the particle whichgets updated in every iteration, c1 and c2 are acceleration con-stants which control the weight balance of pbest and gbest indeciding the particle’s next movement velocity. The randomvalues r1 and r2 are uniformly generated random numbers inthe range [0,1] which are used so that the particles explorea wide search space before focusing on the optimal solution(Thangaraj et al. 2011).

1.2 Artificial immune systems

Artificial immune systems (AIS) are inspired by theoreti-cal aspects of immunology and observed immune functions.They are flexible and can be applied to solve problems (Ji andDasgupta 2007). AIS can deal with all the efforts to developcomputational models inspired by biological immune sys-tems (Aickelin and Dasgupta 2005). The main operative ele-ments of the immune system are the white blood cells. Theirmain characteristic is the presence of surface receptor mole-cules which are capable of recognizing and binding to mole-cular patterns. An antibody corresponds to the portion of anyleukocyte capable of recognizing a molecular pattern and anantigen is equivalent to any pattern that can be recognizedby this antibody. The strength of binding between an anti-gen and an antibody is the affinity or degree of match. Eachantibody specifically interacts with all antigens whose com-plements lie within a small surrounding region, characterizedby a parameter named as cross-reactivity threshold (De Cas-tro and Timmis 2002).

Among the different types of AIS, NSA acclaimed aprominent role in distinguishing the normal behavior of adynamic process. NSA works on the concept of a shape spacethat represents the important features of the dynamic processfor which a change in behavior needs to be detected. A setof self elements is defined within that shape space and a setof detectors is derived from them, which decides whetheran incoming new feature data from the dynamic process isnormal (self) or not (non-self). Thus, in this way, the NSAdoes its main task of discrimination between self and non-self (Mahapatra et al. 2013; Mange and Adviser-Kountanis2013).

According to NSA algorithm (Fig. 1), a self-string of self-peptides, which gives the normal behavior of the system, anda randomly generated string of immature T-cells are initial-ized. Then the affinity of all the elements of random string

123

Page 3: A hybrid particle swarm optimization and artificial immune system algorithm for image enhancement

A hybrid particle swarm optimization

No

Yes

Random String Recognize? Add to Detector set

Reject

Self String

Fig. 1 The negative selection algorithm

is calculated with respect to all the elements of self string.If the affinity of a random element is greater or equal to agiven cross-reactivity threshold then this random element isrecognized as self element and is discarded; otherwise, it isaccepted and introduced to the detector set.

2 Functions used

Image enhancement is done by transforming the gray valuesof each pixel of the original image into the gray values ofthe enhanced image through some transformation function.According to literature (Gorai and Ghosh 2009), the imageenhancement is done using a transformation function as inEq. (4) which considers both global and local informationand is similar to statistical scaling given in Gonzalez et al.(2009).

g(i, j) =[

k.D

σ(i, j) − b

][ f (i, j) − c × m(i, j)] + m(i, j)a

(4)

where, f(i, j)—the gray value of the (i, j)th pixel of theinput image

g(i, j)—the gray value of the (i, j)th pixel of the enhancedimage

D—the global mean of the pixel of the input imageσ (i, j) — the local standard deviation of the (i, j)th pixel

over an n × n windowm(i, j)—local mean of the (i, j)th pixel over an n× n

windowa, b, c, k—parameters to produce large variations in the

processed image.Enhanced images must have more information, higher

contrast and clear texture. In order to evaluate the quality ofthe enhanced image, an objective function is needed. A goodcontrast enhanced image must have more number of edgels(edge pixels) and a higher intensity of edges (Gonzalez et al.2009). Entropy value is also a performance measure whichreveals the information content in the image. Therefore, theseparameters are used (Mohan and Ravishankar 2013) to cal-

culate the objective or fitness function as given in Eq. 5:

F(Ie) = log(log(E(Is))) × edgels(Is)

M × N× H(Ie) (5)

Here, Ie is the enhanced image and Is is the edge image whichis produced by an edge detector. E(Is) is the sum of M × Npixel intensities of the edge image, edgels (Is) is the numberof edge pixels, whose intensity value is above a threshold inthe edge image. H(Ie) is the entropy of the enhanced image.

3 Proposed methodology

The hybrid PSO/AIS algorithm that is used in this researchwork first processes the HE of the original image using thePSO algorithm and then with the negative selection AISmethod. A flowchart of the proposed method is shown inFig. 2.

The transformation function defined in Eq. (4) is used toproduce the enhanced image. The four parameters a, b, c andk used in the function produce diverse results and help tofind the best solution. The main aim is to find the best setof values for these parameters which is done by PSO. Eachparticle that is initialized has four parameters a, b, c and kwhich have random values within their range. The rangesof these parameters are a ε [0, 1.5], b ε [0, 0.5], c ε [0,1] and k ε [0.5, 1.5]. Using these parameters, each particlegenerates an enhanced image whose quality is calculated bythe fitness function defined in Eq. (5). If the value of thefitness function is more, then it is concluded that the imagehas better contrast and hence it is enhanced. The fitness valuesof images generated by all the particles are calculated and thepbest and gbest values are found. This process is iterated anumber of times. In every iteration, the fitness values of allparticles are compared with the previous pbest values andgbest values and accordingly, if the new solution is better,the pbest and gbest values are updated. Each particle moveswith a certain velocity and position using the pbest and gbestvalue (Merkle and Middendorf 2005; Kennedy et al. 2001)according to Eqs. (1) and (2).

For NSA, at first, the self and random samples are ini-tialized. The gbest image obtained from PSO-HE (i.e. imageobtained using PSO of the HE of original image) method istaken as self-sample and the enhanced image obtained fromHE of the PSO-HE image is taken as the random sample(to get better contrast). The affinity between the elements(pixels) of random sample in relation to the elements of selfsample is calculated using Eq. (6) (Aickelin and Chen 2008;Zheng and Li 2007) which is considered as the reactivitythreshold (Rthreshold).

123

Page 4: A hybrid particle swarm optimization and artificial immune system algorithm for image enhancement

P. K. Mahapatra et al.

No

Yes

No

No

No

Yes

No

Yes

Yes

Discard

End

Aff < Rthreshold

Calculate affinity, Aff

Accept

Iterations complete?

Initialize self and random samples

Carry out operation onrandom samples

Yes

Update Velocity and Position

Create antibodies/particles

Find the HE of the image

Initialize parameters

Start

Fgbest = Fparticle

Carry out operation

Fparticle >Fpbest

Evaluate fitness, Fparticle

Covered all

particles?

Fpbest = Fparticle

Fparticle>Fgbest

Yes

Fig. 2 Flowchart of the proposed hybrid of PSO/AIS method

Affinity measure

= Observed_Value − Expected_Value

1 − Expected_Value(6)

Here, random samples are considered as observed value andself samples as the expected value. Then the image obtainedfrom PSO-HE is enhanced using Eq. 4 and its affinity is cal-culated. If the affinity of the enhanced image is less than

reactivity threshold, then they are accepted, otherwise dis-carded. The non-self produced is also enhanced throughEq. 4 and the process is iterated a number of times to getthe best solution. The best solution obtained while iterat-ing is taken as the optimal solution. The fitness value andhistogram of the resultant image are compared with fitnessvalue, histogram of standard PSO and histogram equalizationimages.

123

Page 5: A hybrid particle swarm optimization and artificial immune system algorithm for image enhancement

A hybrid particle swarm optimization

Fig. 3 Images of lathe tool andtheir respective histograms

Distance traversed

by tool

Original image HE image LCS image PSO Image Hybrid image

Reference image

Histogram0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 1 2 3 4 5 6

x 104

0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

x 104

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

x 104

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0.25mm

Histogram0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 1 2 3 4 5 6

x 104

0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2x 10

4

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

x 104

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0.5mm

Histogram

0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 1 2 3 4 5 6

x 104

0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

x 104

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

0.5

1

1.5

2

x 104

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

1mm

Histogram

0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 1 2 3 4 5 6

x 104

0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2x 10

4

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

x 104

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

1.5mm

Histogram0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 1 2 3 4 5 6

x 104

0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2x 10

4

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

0.5

1

1.5

2

x 104

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

1.75mm

y g

Histogram0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 1 2 3 4 5 6

x 104

0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2x 10

4

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

x 104

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

2mm

y g

Histogram

0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 1 2 3 4 5 6

x 104

0

200

400

600

800

1000

1200

1400

1600

1800

2000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2x 10

4

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

0.5

1

1.5

2

x 104

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

123

Page 6: A hybrid particle swarm optimization and artificial immune system algorithm for image enhancement

P. K. Mahapatra et al.

Table 1 Fitness value and number of edge pixels of enhanced images

Images Iterations/particles Parameters Original HE LCS PSO Hybrid Improvement (in %)

Reference 40/30 Fitness value 0.0496 0.2461 0.0520 0.3806 0.5970 56.85

No of edgels 1,547 11,354 1,549 11,351 17,958 58.2

0.25 mm 40/30 Fitness value 0.0470 0.2600 0.0497 0.3924 0.6410 63.35

No of edgels 1,478 12,146 1,478 11,808 20,341 72.26

0.5 mm 40/30 Fitness value 0.0465 0.2522 0.0486 0.3923 0.6200 58.04

No of edgels 1,454 11,771 1,458 11,583 19,030 64.29

1 mm 40/30 Fitness value 0.0464 0.2600 0.0484 0.3834 0.5950 55.19

No of edgels 1,451 11,729 1,452 11,443 17,861 56.08

1.5 mm 40/30 Fitness value 0.0476 0.2501 0.0499 0.3864 0.7029 81.9

No of edgels 1,478 11,391 1,480 11,430 2,1391 87.14

1.75 mm 40/30 Fitness value 0.0473 0.2686 0.0491 0.3969 0.6697 68.73

No of edgels 1,476 12,162 1,475 11,813 21,054 78.22

2 mm 40/30 Fitness value 0.0459 0.2599 0.0480 0.3901 0.6809 74.54

No of edges 1,433 11,728 1,436 11,695 21,347 82.53

0 5 10 15 20 25 30 35 400.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

0.55

0.6

0 5 10 15 20 25 30 35 400.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0 5 10 15 20 25 30 35 400.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0 5 10 15 20 25 30 35 40

0.2

0.25

0.3

0.35

0.4

0.45

0.5

0.55

0.6

0.65

Iterations

Reference 0.25mm 0.5mm 1mm

0 5 10 15 20 25 30 35 400.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0 5 10 15 20 25 30 35 400.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0 5 10 15 20 25 30 35 400.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

Iterations

1.5mm 1.75 mm 2mm

Fitness Value

Fitness Value

Fig. 4 Graphs showing the comparison between the performance of the proposed method (in blue) and PSO method (in red) for lathe tool images

4 Results

The proposed algorithm was applied on lathe tool and MAT-LAB library images. The lathe tool images were used becausethe tool is being used by the authors to carry out differ-ent experiments on micro and nano scale movements fordesktop machining. The main aim of the proposed tech-nique is to increase the number of edge pixels, the over-all intensity of the edges and entropy values so that thehistogram of the enhanced image approaches towards therequired uniform distribution. The results of the proposed

method were compared with HE, LCS and standard PSOtechnique.

The gray scale images of lathe tool captured using singleAVT Stingray F125B monochrome camera mounted on Nav-itar lens, and their enhanced images obtained from differentenhancement techniques are shown in Fig. 3 along with theirrespective histogram. The fitness value and number of edgepixels are shown in Table 1.

We observe from the above data that the hybrid algorithmgives better fitness value and more number of edge pixels(edgels) i.e. 0.5970 and 17,958 respectively, for the refer-

123

Page 7: A hybrid particle swarm optimization and artificial immune system algorithm for image enhancement

A hybrid particle swarm optimization

Onion

Histogram

0

50

100

150

200

250

300

350

0 50 100 150 200 250

0

50

100

150

200

250

300

350

400

450

500

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

50

100

150

200

250

300

350

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

50

100

150

200

250

300

350

400

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

50

100

150

200

250

300

350

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Tire

Histogram

0

100

200

300

400

500

600

700

800

900

0 50 100 150 200 250

0

100

200

300

400

500

600

700

800

900

1000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

100

200

300

400

500

600

700

800

900

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

100

200

300

400

500

600

700

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

100

200

300

400

500

600

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pears

Histogram

0

500

1000

1500

2000

2500

3000

3500

4000

4500

5000

0 50 100 150 200 250

0

1000

2000

3000

4000

5000

6000

7000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

2000

2500

3000

3500

4000

4500

5000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

2000

2500

3000

3500

4000

4500

5000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

1000

2000

3000

4000

5000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Images Original HE LCS PSO Hybrid

Cameraman

Histogram

0

100

200

300

400

500

600

700

800

900

1000

0 50 100 150 200 250

0

200

400

600

800

1000

1200

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

100

200

300

400

500

600

700

800

900

1000

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

2000

2500

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

2000

2500

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Fig. 5 MATLAB inbuilt images along with their histogram

ence image of the lathe tool as compared to HE, LCS andPSO based method. The algorithm was further applied to dif-ferent horizontal movements of the tool, whose results were

also found better than other enhancement techniques. Theimprovement using the proposed algorithm with respect tothe PSO is shown in the last column of Table 1. The respec-

123

Page 8: A hybrid particle swarm optimization and artificial immune system algorithm for image enhancement

P. K. Mahapatra et al.

Table 2 Fitness values of enhanced images obtained from different techniques

Images Iterations/particles Parameters Original HE LCS PSO Hybrid PSO/AIS Improvement (in %)

Cameraman 45/30 Fitness value 0.4826 0.4030 0.4800 0.5097 0.7080 38.90

No of edgels 2,503 2,430 2,503 2,791 3,694 32.35

Onion 50/30 Fitness value 0.3486 0.3007 0.3462 0.3910 0.4816 23.17

No of edgels 810 803 811 910 1,098 20.65

Tire 50/30 Fitness value 0.4846 0.4323 0.4805 0.5224 0.5913 13.18

No of edgels 1,859 1,994 1,844 2,052 2,270 10.62

Pears 50/30 Fitness value 0.3185 0.3493 0.3180 0.4458 0.5802 30.14

No of edgels 8,706 10,437 8,694 11,920 15,168 27.24

Table 3 Percentage of improvement of different enhancement techniques

Images Parameters Percentage of improvement

HE LCS PSO Hybrid

Cameraman Fitness value −16.49 −0.5 4.02 39.37

No. of edges −3.9 0 7.5 42.22

Onion Fitness value −13.74 −0.68 12.16 38.15

No. of edges −0.86 0.12 12.34 35.55

Tire Fitness value −10.79 −0.84 7.8 22.02

No. of edges 7.26 −0.81 10.38 22.12

Pears Fitness value 9.7 −0.15 39.96 82.16

No. of edges 19.88 −0.14 36.91 74.22

0 5 10 15 20 25 30 35 40 450.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0 5 10 15 20 25 30 35 40 45 50

0.2

0.25

0.3

0.35

0.4

0.45

0.5

0 5 10 15 20 25 30 35 40 45 500.2

0.25

0.3

0.35

0.4

0.45

0.5

0.55

0.6

0.65

0 5 10 15 20 25 30 35 40 45 50

0.20.25

0.30.35

0.40.45

0.50.55

0.60.65

Generations

Cameraman Onion Tire Pears

Best so

far

Fig. 6 Graphs showing the comparison between the performance of the proposed method (in blue) and PSO method (in red) for MATLAB inbuiltimages

tive histograms of the images are also shown in Fig. 3. Thehistogram of an enhanced image should be uniformly dis-tributed, which has been achieved by the proposed method.The performance of the proposed method in each iteration iscompared with PSO and is shown in graphs (Fig. 4) whichdepicts the variation of the fitness value so far obtained withrespect to iterations.

The method was also applied to four inbuilt images suchas cameraman, onion, tire and pears present in MATLABto analyze the proposed method and check its effectiveness.The original and enhanced images (obtained from differenttechniques) with their respective histograms are shown in

Fig. 5. The fitness values and number of edge pixels (edgels)obtained from the above mentioned methods are shown inTable 2.

It may be observed from Table 2 that the fitness value andthe number of edge pixels for each of the above-mentionedMATLAB inbuilt images obtained from LCS and HE methodare inferior to the PSO and hybrid method. When the resultsof PSO and Hybrid are compared, it is found that the pro-posed method is far better than the PSO technique of imageenhancement. For the cameraman image, the fitness valueand edgels obtained from PSO method are 0.5097 and 2,791,respectively, whereas for the same parameters, they are found

123

Page 9: A hybrid particle swarm optimization and artificial immune system algorithm for image enhancement

A hybrid particle swarm optimization

to be 0.7080 and 3,694, respectively for the hybrid method.Similarly, for other inbuilt images, the proposed method isfound better than other techniques of image enhancement.The improvement percentage shown in Table 3 also provesthat the enhancement achieved from the hybrid techniqueis better. The results of the comparison of proposed methodwith the PSO based method for inbuilt MATLAB images andthe fitness value obtained in each iteration are shown in thein Fig. 6.

In both the cases of tool images and MATLAB inbuiltimages, the fitness value and number of edgels are found bet-ter in the hybrid algorithm which confirms that this methodyields better quality of the image compared to PSO, HE andLCS techniques.

5 Conclusions

In this paper, a hybrid algorithm based on PSO and NSA ispresented to improve the quality of image by enhancing itscontrast. The theory is well explained with data, graphs andhistograms of the images. It is observed that in each caseof the lathe tool and MATLAB inbuilt images, the fitnessvalue and the number of edge pixels of the enhanced imagesobtained from the proposed method are better than other tech-niques viz. HE, LCS and PSO based image enhancement.

Acknowledgments The authors would like to thank Director, CSIR-CSIO for giving the opportunity to work on this Network Project (ESC-0112) funded by Council of Scientific and Industrial Research (CSIR),New Delhi.

References

Afshinmanesh F, Marandi A, Rahimi-Kian A (2005) A novel binaryparticle swarm optimization method using artificial immune system.In: IEEE international conference on computer as a tool, pp 217–220

Aickelin U, Chen Q (2008) On affinity measures for artificial immunesystem movie recommenders. In: proceedings of the 5th internationalconference on recent advances in soft computing, Nottingham, UK

Aickelin U, Dasgupta D (2005) Artificial immune systems. In: searchmethodologies: introductory tutorials in optimization and decisionsupport techniques, 2nd edn. Springer, pp 1–29

Al-Samaraie MF, MFA-S (2011) A new enhancement approach forenhancing image of digital cameras by changing the contrast. IntJ Adv Sci Technol 32:13–22

Braik M, Sheta AF, Ayesh A (2007) Image enhancement using particleswarm optimization. In: world congress on engineering, pp 696–701

De Castro LN, Timmis J (2002) Artificial immune systems: a new com-putational intelligence approach, 1st edn. Springer, London

Ge H-W, Sun L, Liang Y-C, Qian F (2008) An effective PSO and AIS-based hybrid intelligent algorithm for job-shop scheduling. Syst ManCybern part A Syst Human IEEE Trans 38(2):358–368

Gonzalez RC, Woods RE, Eddins SL (2009) Digital image processingusing MATLAB. Gatesmark Publishing, USA

Gorai A, Ghosh A (2009) Gray-level image enhancement by particleswarm optimization. In: proceedings of the IEEE world congress onnature & biologically inspired computing (NaBIC). pp 72–77

Hashemi S, Kiani S, Noroozi N, Moghaddam ME (2010) An imagecontrast enhancement method based on genetic algorithm. PatternRecogni Lett 31(13):1816–1824

Hassanzadeh T, Vojodi H, Mahmoudi F (2011) Non-linear grayscaleimage enhancement based on firefly algorithm. In: Panigrahi B, Sug-anthan P, Das S, Satapathy S (eds) Swarm, evolutionary, and memeticcomputing, vol 7077. Lecture Notes in Computer Science. Springer,Berlin, pp 174–181. doi:10.1007/978-3-642-27242-4_21

Hendtlass T (2007) Fitness estimation and the particle swarm optimi-sation algorithm. In: IEEE congress on evolutionary Computation,pp 4266–4272

Ji Z, Dasgupta D (2007) Revisiting negative selection algorithms. EvolutComput 15(2):223–251

Kaur M, Kaur J, Kaur J (2011) Survey of contrast enhancement tech-niques based on histogram equalization. Int J Adv Comp Sci Appl2(7):138–141

Kennedy JF, Kennedy J, Eberhart RC (2001) Swarm intelligence. Mor-gan Kaufmann

Kwok NM, Ha QP, Liu D, Fang G (2009) Contrast enhancement andintensity preservation for gray-level images using multiobjective par-ticle swarm optimization. Autom Sci Eng IEEE Trans 6(1):145–155

Mahapatra PK, Kaur M, Sethi S, Thareja R, Kumar A, Devi S (2013)Improved thresholding based on negative selection algorithm (NSA).Evolutionary Intelligence, pp 1–14

Maini R, Aggarwal H (2010) A comprehensive review of imageenhancement techniques. J Comput 2(3):8–13

Mange J, Adviser-Kountanis D (2013) Artificial immune systems andparticle swarm optimization for solutions to the general adversarialagents problem. Western Michigan University

Merkle D, Middendorf M (2005) Swarm intelligence. In: searchmethodologies. Springer, pp 401–435

Mitra P, Venayagamoorthy GK (2008) Empirical study of a hybrid algo-rithm based on clonal selection and small population based PSO. In:IEEE swarm intelligence symposium, pp 1–7

Mohan S, Ravishankar M (2013) Optimized histogram based contrastlimited enhancement for mammogram images. ACEEE Int J InfTechnol 3(1):66–71

Nejad SB, Elyas SH, Khamseh A, Moghaddam IN, Karrari M (2012)Hybrid CLONAL selection algorithm with PSO for valve-point eco-nomic load dispatch. In: 16th IEEE electrotechnical conference, pp1147–1150

Sedighizadeh M, Fallahnejad M, Alemi M, Omidvaran M, Arzaghi-Haris D (2010) Optimal placement of distributed generation usingcombination of PSO and clonal algorithm. In: IEEE internationalconference on power and energy (PECon), pp 1–6

Sun C, Zeng J, Pan J, Xue S, Jin Y (2013) A new fitness estimationstrategy for particle swarm optimization. Inf Sci 221:355–370

Thangaraj R, Pant M, Abraham A, Bouvry P (2011) Particle swarm opti-mization: hybridization perspectives and experimental illustrations.Appl Math Comput 217(12):5208–5226

Zheng H, Li L (2007) An artificial immune approach for vehicle detec-tion from high resolution space imagery. Int J Comp Sci Netw Secur7(2):67–72

123