Lost Property Detection by Genetic Algorithm with Local Search

In this paper, we propose a method in which pictures of security cameras are administered automatically. The administered target is lost property. In case of searching objects with security camera, there are infinitely various sizes and orientations of the object to be searched. Therefore, we propose an object search method which is adapted to transformation of the object. We use a template matching using Genetic Algorithm (GA) for detection of lost property. Moreover, GA is suitable for global search problems, but it is not necessarily suitable for local search problems. Therefore the local search technique is included to improve GA property. Object search in our proposed method is divided into two parts, global search and local search. In the local search, we use a simple random search. According to experimental results, in the global search, search accuracy is relatively good in the almost experiments, but the local search is not so effective in almost experiments. In the future, we need to improve a fitness function in the global and local search.


Introduction
Recently many public facilities are equipped with security cameras to prevent a crime.The security cameras pay attention to persons with suspicious behavior and doubtful objects which are left.However the security cameras are administered by humans.Therefore, the administrators can make mistakes such as careless oversight.In addition, it might take a long time to search objects.A simple and efficient system is then required, such that it automatically operates and alerts.In general, background subtraction and template matching are often used to search objects.In case of searching objects with security camera, the object to be searched has a lot of kinds and can have infinitely various sizes and orientations.Moreover, when a remote function camera such as pan-tilt camera is used, there is a change in the background.Background subtraction needs to prepare a background image.Such an approach cannot be adapted to varying background and light environment.On the other hand, template matching is not influenced by change of background because it performs the matching between a template image and an input image.However, when an object shape is changed, search accuracy by a simple template matching is low.It needs to prepare template images of various sizes and orientations to be adapted to transformation of the object.Thus, in matching a large amount of processing is needed.In order to overcome this drawback, our proposed system has to be adapted by oneself to change of size and orientation using few template images.In this paper, the objective is therefore to find a lost property by a template matching using Genetic Algorithm (GA) (1,2) .GA can find a solution from an enormous amount of solution space.It is therefore suitable to find an optimal solution in global domain.This system needs to optimize object's location, size, and orientation.Then template matching by GA is used.However, GA is not necessarily suitable to find an optimal solution in local domain.In such a case, it is necessary to use a technique that is specialized in the local search.The present system optimizes the object's location and size in the global search using GA and optimizes the object's size and orientation in the local search using random search.In this paper, a target image is defined as one obtained using security cameras in public facilities.Moreover, an object is defined as lost property in public facilities, and a template image is one stored in a digital camera or smartphone.

Proposed method
Our proposed method searches an object using template matching.As mentioned above, we use GA because it is necessary to be adapted to transformation of the object.GA is a technique to imitate an evolution of creatures for solving an optimization problem.GA's features are as follows; it can be applied to many areas, and is suitable for global search problems.However, GA is not necessarily suitable to find an optimal solution in local domain (3) .Therefore, object search is divided into two parts, global search and local search.Global search is to find an object location and size using GA.Local search is to find an object size and orientation using random search.A detail of proposed method is shown below.

Color system
There are various types of color systems to compose a color space.In this paper, HSV color system which checks hue is used and is more similar to human's sense than RGB color system.HSV color system is composed of three elements; hue, saturation, and value.Moreover, three elements are respectively independent.

Chromosome in each individual
In GA, each individual has a chromosome with real numbers.The chromosome is composed of 4 elements; coordinate values that match a template image in a target image, template image's scaling rate and rotation angle.The chromosome structure is shown in Fig. 1.

Fitness function
A fitness function in GA defines the adequacy of each individual.The quality as a solution in each individual is evaluated using the fitness function.This evaluation value is defined as similarity used for template matching (4) .There are some similarities such as SAD and NCC.These are calculated as follows: where N and M are image's width and height respectively.I is a pixel value of a point on coordinate (, ) in the target image, and T is that in the template image.We carried out comparative experiments using them (5) .In the global search, search accuracy of NCC has become higher than that of SAD.Therefore, we define the fitness function as NCC in the global search.

Gene operation
The next generation in GA is produced by GA operators; selection, crossover, and mutation.In this paper, the selection operator uses a roulette wheel selection.The selection probability is calculated by the fitness function.It is higher when the value of the fitness function is higher.On the other hand, the individual whose value of fitness function is low can be selected in a low probability.In the crossover, selected individuals are used to generate new individuals.The BLX_α is used in crossover (6) .In this technique, new individuals are generated by random numbers within the range that is calculated by parents.Fig. 2 shows the aspect of crossover by BLX_α.At the mutation, a chromosome is renewed with a random number rarely.(1)

Global search and local search
(2) Fig. 2. BLX_α.fitness function value is calculated by selected parameters.When the fitness function value is improved compared to the former value, the parameters in the chromosome are updated.After having carried out the random search several times, its process returns to the global search in this system.
In the local search, we define the fitness function as SAD.The reason is that the search accuracy of SAD is higher than that of NCC in comparative experiments (5) .

Process of the proposed method
The process of the proposed method is described below.Fig. 3 shows a flowchart of the proposed method.In preprocessing, a target image and a template image are compressed to reduce a processing time.The termination condition is defined such that the number of generations reaches the predefined number.Moreover, after the local search started, when the fitness value of elite individual is maintained without change for 200 generations, the search is finished.
Step1 : Preprocessing To reduce processing area we compress the target image and the template image in the preprocessing.A compressed value of each pixel in the source image is calculated by using the Gaussian filter.The number of pixels of the target image (612 ×816 pixels) is reduced to the half (306 ×408 pixels).The template image (80×80 pixels) is reduced to the quarter (20 ×20 pixels).
Step2 : Initialization A chromosome of each individual is generated by random numbers.However, the chromosome has the rotation angle of 0 degree and this parameter is fixed.
Step3 : Matching by fitness function The fitness function is calculated by expression (1) in the global search.
Step4 : Selection, crossover and mutation The selection operator uses the roulette wheel selection.In the crossover, selected individuals are used by BLX_α to generate new individuals.At mutation, the coordinate values and scaling rate of a chromosome are renewed with values which are generated by random number according to mutation probability.
Step5 : Condition for starting local search When a global search result exceeds the thresholds, search process advances to Step6.Otherwise the process returns to Step3 Step6 : Local search At local search, the fitness function is calculated by selected parameters, namely scaling rate and rotation angle at random using expression (2).A chromosome of the best individual is updated when the fitness function improves the former value.Its process returns to Step3 Step7 : Condition for the termination of object search When the number of the generations reaches the preset value, the object search is finished.Moreover, after the local search started, when the same elite individual is maintained without change for 200 generations, the object search is finished.Otherwise it returns to Step3.

Experiments
In this section, experiments for static images are described to demonstrate the effectiveness of the present method.

Experimental conditions
Experiments for static images have been carried out to demonstrate the effectiveness of the proposed method.Fig. 4 shows template images.The size of images is 80 × 80 pixels.The target images used in this experiment are shown in Fig. 5.The size of image is 612 ×816 pixels.The photographing condition of the template images is different from the target images.Furthermore, the template image is painted black over a background.Table 1 shows the pairs of a target image and a template image in each experiment.We try 20 times in each experiment.The parameters of GA used in this experiment are shown in Table 2. Scaling rate Fig. 3. Flowchart of the proposed method.and rotation angle is set by random number within the range set at Table 2.

Success conditions
The condition of success in the global search is defined such that the location (coordinate values) of the object are found in the target image.This judgment is inspected visually.In the local search, it is defined such that the scaling rate is found within a range of plus or minus 0.2, and the rotation angle is found within a range of plus or minus 30 degree.Moreover, in order to evaluate the success of object search we calculate the region that an object in a target image and a template image overlap.We define the condition of success as such that the rate of the overlapping region is more than 50%.

Experimental results
This subsection describes experimental results.Table 3 shows the result of calculating the region that an object in a target image and a template image overlap.At experiments other than experiment 4, it is considered that this system can detect rough position of the search object.Tables 4 and  5 show the results of global search and local search.In the global search, the search accuracy is relatively good in almost all experiments.However, at experiment 4, the result does not become exact location at all runs.Fig. 6 shows one of the failure results.The square in the image is the region that this system found as the object.At almost all experiments, this region was obtained by GA.The hue value in this region is similar to that in the template image.Therefore, it is considered that the result of experiment 4 falls into a local solution.In the local search, the results fell short of our expectations.However, at experiment 2, the direction rotated by 180 degree from the actual direction is observed.It is thought that there is no big difference in the upper part of the template image and the lower part of the one.Therefore, we consider that these results don't have a problem.On the other hand, at experiments 5 and 6, the scaling rate becomes smaller than actual values.The reason    Iteration count in random search 20 is because this system calculates the fitness function value using only pixel values.Therefore, a little difference in coordinates makes a large difference of the fitness function value.Therefore, this difference can disturb a matching.In particular, when the region that the fitness function value is calculated becomes smaller, the fitness function value becomes higher.We need to improve the fitness function from the result of global and local search.In the future, we will define a fitness function as histogram similarity calculation.

Conclusions
In this paper, we purposed a method to detect a lost property in template matching using GA.Moreover, object search is divided into two types, global search using GA and local search using random search.In the global search, search accuracy is relatively good at experiments other than experiment 4. On the other hand, the local search is not so effective at experiments other than experiment 1.In the future work, we try to improve the fitness function in this paper.We will define a fitness function as histogram similarity calculation.
In this paper, object search is divided into two parts, global search and local search.In the global search, GA manipulates the coordinate values and scaling rate in the chromosome with fixed rotation angle until the start of local search.Moreover, thresholds for the fitness function and the number of the generations are defined in the global search.When the search result exceeds the thresholds in the global search, the local search is started.However, the fitness function values are different according to searching object.It is necessary to adequately set the threshold for the fitness function value in every object search.In the local search, the scaling rate and rotation angle in the chromosome are changed to find better solution using random search.At the random search, the candidates of a solution are selected from all parameters at random.The optimal solution is regarded as the best solution among all candidates of the solution.In this paper, when the local search starts, we allot plural parameters, namely scaling rate and rotation angle at random to the best individual.The   = ∑ ∑ |(, ) − (, )

Table 1 .
Pairs of target images and template images.

Table 2 .
Parameters in GA.

Table 3 .
Calculate the region that an object in a target image and a template image overlap.

Table 4 .
Results of 20 times run in the global search.

Table 5 .
Results of 20 times run in the local search.