Elitist Selection Schemes for Genetic Algorithm ... - Semantic Scholar

6 downloads 0 Views 2MB Size Report
s.mashohor@ sms.ed.ac.uk. Abstract- This paper .... increases the maximum fitness values, resulting nearly ac- .... Wesley longman Inc, twentieth ed., 1999.
974

Elitist Selection Schemes for Genetic Algorithm based Printed Circuit Board Inspection System S. Mashohor, J. R. Evans and T. Arslan Department of Electronics and Electrical Engineering University of Edinburgh, Edinburgh EH9 3JL, Scotland. s.mashohor@ sms.ed.ac.uk

Abstract- This paper presents the implementation of a number of elitist schemes for a low cost printed circuit board (PCB) inspection system. This strategy also aims to explore the role of tournament and roulettewheel in improving the existing system when using a deterministic selection scheme. In this system, GA is used to detect rotation angle and displacement of PCB placed arbitrarily on a conveyor belt passing under the camera. Deterministic, tournament and roulette-wheel selection scheme have been compared in terms of maximum fitness, rate of accuracy and computation time. The finding shows that deterministic out-performed the other two schemes in all categories and still prove to be an ideal candidate for GA-based PCB inspection system. The modifications on population size and implementation of center block image matching technique also contributed to the improvement of computational time of the system.

1 Introduction Accurate placing of the complete board on the conveyor belt under the camera is a delicate task during physical defect inspection as illustrated in Figure 1. Any misorientation of board's placement may lead to wrong analysis especially for reference-based method [1]. For this reason, [2] has implemented GA to estimate the rotation angle and displacement value of the board based on image captured, while detecting any physical defects on the inspected board. This work used deterministic elitist selection scheme and it shows the ability of GA in searching for the best transformation values referring to [2]. CCD camera

Computer

PCB

[3]. The outstanding advantage of this environment is it always preserve the best solutions in every generation. Discussions on exploitation and exploration trade-off by [3] has initiated the idea to investigate tournament and roulettewheel schemes other than deterministic in elitism strategy. The researcher [3] has used tournament in this discussion and [4] used roulette-wheel successfully in his evolvable hardware system for Automatic Optical Inspection. Section 2 briefly explains implementation of the system and categories of comparison for these selection techniques. The modifications that have been made to optimize the first prototype has been highlighted in section 3 together with experimental setup details. The results of comparison are presented in section 4 while section 5 contains the discussion of these findings in detail. 1.1 GA in machine-vision inspection

Previously, [5] has used GA to find misorientation parameter values of individual Integrated Circuits (IC) on board to determine the board has no defects and implemented the technique on System-On-Chip (SOC) platform. [6] also has used GA to estimate surface displacements and strains for autonomous inspection of structures. GA and distance transform has been combined in object recognition in a complex noisy environment in [7]. This research shows the combination has produced fast and accurate matching and has scaling and rotation consistency. Feature selection and creation in two pattern classification are also a difficult problem in inspection process. Therefore, [8] has used GA to solve this problem and successfully reduced classifications error rate but it requires much more computation than neural net and neighbor classifiers.

2 Implementation /

/

C+e~~~~yor belt

Figure 1: Illustration of printed circuit board inspected arbitrarily

on conveyor belt

In elitist strategy, the offspring have to compete with the parents to gain admission for next generation of GA

0-7803-9363-5/05/$20.00 ©2005 IEEE.

The proposed technique uses a perfect board to act as reference image and the inspected board as the test image. In this work, GA is used to derive the transformation between test and reference images based on the simple GA as presented in [9] in order to find out the board is good or faulty. It is essential to determine the type of encoding and the fitness function which will be used in the GA to optimize the parameters. Many encoding schemes have been proposed, for example, integer coding and gray coding. There is no standard 974

975

%t

3"

Figure 2: The allocation of parameter in bit string for every individual way to choose these schemes and the choice really depends expression of the problems. In this work, binary coding has been chosen since it is straight-forward and suitable for this problem. There are 19 bits allocated in each individual as shown in Figure 2. Nine bits are allocated for rotation with value from 0 to 360 degree, five bits allocated for displacement of x-axis with value between -10 to 10 pixels and another five for displacement of y-axis with value between -10 to 10 pixels. The fitness value is created to evaluate the individual. The fitness function in this work is evaluated from total similarities values in each pixels between test image and reference image divided by total pixels in reference image assuming that both images are the same size. The fitness value can be defined as below: if f(xa,Ya) == g(xb,yb), counter ++ fitness = counter/(W x H) where f(xa,ya) is pixel intensity of reference image, g(xb,yb) is pixel intensity of test image, in condition of Xa - Xb, Ya Yb where x and y is pixel location at x-axis and y-axis. W is width of the reference image and H is height of the reference image. A number of image processing operations are applied to both images to enhance the images and highlight the details. The reference image will be transformed using random rotation and displacement values to create initial population for GA. Then, every transformed reference image is compared with the test image to evaluate the fitness value. Center block matching of size 40 x 40 pixels is used in this work to reduce the number of pixels compared and directly decrease computational time requirement. Previously, full search block matching is implemented in [2] which compared the whole size of image to evaluate the fitness value. In elitism strategy of this work, deterministic, tournament and roulette-wheel selection methods are implemented. Four samples of artificially transformed and defected test image has been compared to the reference image using these selection methods to evaluate the performance in terms of maximum fitness, accuracy and computing time. This investigations aims to develop a better understanding of their capabilities to improve the strength of existing GA framework in finding the optimum solution. In this simulation, all individuals from previous and current generation are considered for these survival selections. Deterministic selection depends on rank of the individuals which based on their fitness values. Only the top ranked individuals will survive for the next generation. For tournament, two individuals are selected randomly and they will compete with each other in term of fitness value. The winner will be included as one of the next generation population. The roulette-wheel selection depends on the on the nature

975

weight of each individual, defined as their fitness value over the total fitness of all individuals. Higher weight gives larger opportunity to be selected in a random selection for next generation. The selection schemes will be compared under three different categories: * Maximum fitness: this is the maximum value of fitness found at the end of the search; the ideal value is 1. * Accuracy:

this is calculated using this formula,

1(

Xm) where xi is the ideal value of transformation parameter, xm is the transformation value gained from the maximum fitness and n is the total experiment for each sample. error =

=

* Computing time: this is assessed by the number of generation evaluations to reach the maximum fitness. For each scheme and sample, 10 experiments are performed with initial transformation values taken at random. The values given in the results are average values, computed over these 10 experiments. The following assumptions has been made in this simulation as listed below: 1. Both test and reference image have the same size. 2. Camera position, focus of the camera and lighting setup are constant across the samples.

3 Environment and Parameters

Figure 3: Image of reference board Table 1: GA parameters

Ya:lu:e:s

Parameters ISetting Generations 200 Population size 18 Crossover probability 0.5 Mutation probability 0.01

Performance study of GA-based printed circuit board inspection is conducted on a Linux-based PC and the image

976

of the printed circuit board is captured by a black and white CCD camera. The basic image processing functions such as single global thresholding [10] and transformation is built using Edinburgh University Vision Group's image library [ 11 ] and ImageMagick image library [ 12]. The thresholding is applied on every pixel by setting the value of object point, T equals to 100. A thresholded image defined as: g(x,y) = 0 if f(x,y) < T g(x,y) = 255 if f(x,y) > T where f(x,y) is the gray level of point (x, y) in the image. Fitness value is derived by comparing every pixel value in a 40 x 40 pixels center block of both images (reference and test) and divided by the total pixel of block, in this case is 1600 pixels. The reference image is displayed in Figure 3 and the test images are shown in Figure 4 to Figure 7. The details of the GA parameters setting is shown in Table 1.

Figure 4: Test image 1 (TI). Image is rotated 329 degree anticlockwise, displacement at x-axis is 0 pixel and displacement at y-axis is 0 pixel.

Figure 6: Test image 3 (T3). Image is rotated 60 degree anticlockwise, displacement at x-axis is -6 pixel and displacement at y-axis is -4 pixel.

Figure 7: Test image 4 (T4). Image is rotated 75 degree anticlockwise, displacement at x-axis is -4 pixel and displacement at y-axis is -6 pixel.

ulation size compared to [2]. The main reason is the previous population size has redundant individuals which only increases the computational time. The new population size has reduced time consumption with the same performance as the previous setting and prove to be viable for this 'soft' real-time system.

4 Results and discussion

Figure 5: Test image 2 (T2). Image is rotated 269 degree anticlockwise, displacement at x-axis is 8 pixels and displacement at y-axis is 8 pixels.

Gray-coded mutation is also added in this implementation to produce more variant individuals while the first prototype [2] used binary-coded mutation. The variance produced by Gray value leads to better estimation of transformation values. Another modification is a smaller pop-

Deterministic selection has the ability to reach the highest maximum fitness, followed by roulette-wheel and tournament for all test images as shown in Figure 8. Preserving strong individuals in deterministic method has effectively increases the maximum fitness values, resulting nearly accurate transformation values of inspected images. Roulettewheel and tournament method that provide chances for weak individuals to be selected prove to be ineffective for this work. Deterministic scheme also produced least errors in estimating rotation, x-axis displacement and y-axis displacement parameters as shown in Figure 9 to Figure 11. Roulette-wheel outperformed tournament in most 976

977

12

0.85

10 x A

U)

6

a)D q

._LI

Ti

T2

T3

Ti

T4

T2

Images

Figure 8: The schemes are compared in terms of maximum fitness

and is slightly favorable

cases

as

deterministic in this

category. Although roulette-wheel permit selection of weak individuals for the next generation, probability of strong

individuals are still dominant. 140

Figure 11: The schemes displacement-y value

100

w

c

0

80

0

f

60

15

0

150 5

0

Images

Figure 9: The schemes rotation value 12

are

compared in terms of

0n

accuracy

of

.- 11-1--%,11",

1-1 -.1-, 1-

Ti

T2

1-111-11- m..,", T3

11 -11--., T4

Images

Figure 12: The schemes time

are

compared in terms of computational

deterministic

tournament

.0.

deterministic tournament roulette-wheel

20

@

c

20

x

of

0

40

10

accuracy

(n

.H

cc

compared in terms of

25

CD

2 :0

are

30

02

Lu

T4

produced best maximum fitness and high accuracy of transformation parameters considering only rotated test image (Ti). However deterministic scheme still prove to be an excellent option if computational time is an essential requirement.

120 ai

T3

Images

5 Conclusions

roulette-wheel

8 6

c]

4

We have presented an improved novel technique using GA for PCB inspection system for faults detection. Deterministic scheme outperformed tournament and roulettewheel schemes in term of maximum fitness, accuracy and computational time Consequently, it has been established as an ideal selection method in elitism for this work. Population size and block matching method modifications improved the computational time considerably. In the future, hill-climbing technique would be implemented to avoid early convergence and gain optimum solutions while reducing the computational time. Correlation technique is a good comparison to GA in finding the image transformation function and the comparison is worth to be done in future. .

llll>.;111-11..'-.-"

Ti

T3

T2

T4

Images

Figure 10: The schemes displacement-x value

are

compared in terms of

accuracy

of

Deterministic scheme requires the least computation to reach maximum fitness compared to other two methods as illustrated in Figure 12. This inspection system indirectly benefited from the early convergence characteristic of deterministic scheme. The small population size and block matching algorithm improvement also contribute to the overall computational time. Tournament scheme has the worst overall performance while roulette-wheel is only a fraction slower than deterministic method considering generation evaluations. Worth noting that all the schemes 977

References [1] N.-H. Kim, J.-Y. Pyun, K.-S. Choi, B.-D. Choi, and S.-J. Ko, "Real-time inspection system for printed circuit boards," in IEEE International Symposium on Industrial Electronics, June 2001. [2] S. Mashohor, J. R. Evans, and T. Arslan, "Genetic algorithm based printed circuit board inspection sys-

978

[3] [4]

[5]

[6]

[7]

[8]

[9]

[10] [ 11]

tem," in IEEE International Symposium on Consumer Electronics, pp. 519-522, September 2004. D. Thierens, "Selection schemes, elitist recombination and selection intensity," in International conference of genetic algorithm, pp. 152-159, 1997. J. Evans, An evolvable hardware system for automatic PhD thesis, University of optical inspection. Edinburgh, March 2004. J. Evans and T. Arslan, "The implementation of an evolvable hardware system for real time image registration on a system-on-chip platform," Proceedings of the 2002 NASA/DOD Conference on Evolvable Hardware (EH'02), 2002. A. P. Ajay Mahajan and T. Chu, "Intelligent image correlation using genetic algorithms for measuring surface deformation in the autonamous inspection of structures," in Proceedings of the american control conference, june 2000. J. Xin, D. Liu, H. Liu, and Y. X. Yang, "Ga-based object recognition in a complex noisy environment," in Proceedings of the First International Conference on Machine Learning and Cybernetics, pp. 1586-1589, November 2002. E. I. Chang, R. P. Lippmann, and D. W. Tong, "Using genetic algorithm to select and create features for pattern classification," in IJCNN International joint conference on neural networks, vol. 3, pp. 747-752, June 1990. D. E. Goldberg, Genetic Algorithms in Search, Optimization and Machine Learning. Addison Wesley longman Inc, twentieth ed., 1999. R. C. Gonzalez and R. E. Woods, Digital Image Processing. Prentice-Hall, second ed., 2002. A. Peacock, Information Fusion for Improved Motion Estimation. PhD thesis, School of Engineering and Electronics, University of Edinburgh, May 2001.

[12] http://www.imagemagick.org.

978

Suggest Documents