Você está na página 1de 6

Automated Traffic Violation Apprehension System

Using Genetic Algorithm and Artificial Neural


Network
Aaron Christian P. Uy, Ana Riza F. Quiros, Rhen Anjerome Bedruz, Alexander Abad, Argel Bandala, Edwin Sybingco, Elmer P.
Dadios
Gokongwei College of Engineering
De La Salle University
Manila, Philippines
christiaparayno_14@yahoo.com, epdadios@gmail.com

Abstract— Developing countries face the problem of crowded transport systems are on the improvement of systems which
and congested roads because of inefficient implementation of manage the interaction between road components such as private
traffic rules. Motorists ignore the rules because they are not or public transportation, pedestrians and existing traffic systems
apprehended and can get away easily. This paper proposes an [8], [9]. This covers areas of interest such as traffic violation
intelligent traffic system that is able to automatically detect and detection, vehicular plate localization and plate character
apprehend traffic violators, specifically motorists who either recognition [10]. A real time system can be created which can
swerve or block the pedestrian lane. The system is designed by apprehend violators immediately after committing traffic
integrating three processes: violation detection, plate localization violations. Numerous researches have implemented intelligent
and plate recognition. The violation detection and plate
traffic systems as can be seen in [11], [12], and [13].
localization were realized using genetic algorithm while the plate
recognition process was performed using an artificial neural This paper focuses on simulation of an intelligent traffic
network. The recognition of the plate number is highly dependent system with automated vehicular apprehension system. With the
on the position of the detected vehicle with respect to the camera. system, traffic violators can be detected and apprehended in real-
Thus, the recognized plate number will only be supplementary time. The system is able to display the cropped picture of the car
information about the violator; the physical attributes of the violators to notify the traffic enforcer which vehicles are needed
vehicle which is captured by the violation detection process will be to be apprehended. The system was able to process and detect
the main information on the violator. Based on the results of 48
plate numbers according to the car’s position with respect to the
images tested, the overall system was able to detect the mentioned
camera. The detected plate numbers shall serve as additional
violations and to identify the plate number of the vehicles that
were detected as traffic violators, with an average accuracy of
information to the traffic enforcer, along with the cropped
90.67%, and program runtime of 1.34 seconds. picture of the car which describes the physical feature of the
violator.
Index Terms— genetic algorithm, artificial neural networks,
violation detection, plate localization, plate recognition, intelligent
II. GENETIC ALGORITHM
traffic systems Recognizing, tracing and categorizing automobiles in real-
time are challenging issues met by researchers in the field of
I. INTRODUCTION image processing. The background difference method is an
One of the leading causes of road accidents and the image processing technique which can be used to implement and
worsening condition of traffic congestion is the rampant and simulate an automated vehicle apprehension using CCTV
advertent violation of the traffic rules of motorists. Effectiveness cameras [14]. Vehicles can be recognized by binarization of the
of traffic enforcers in apprehending these traffic violators has resulting output image of the method. The technique is
become an issue. Since there are no current policies or computationally fast but the reference image needs to be
technology being implemented that could infallibly minimize, if periodically updated because the environment changes
not totally eradicate the traffic violation rate, undisciplined intermittently [15]. There are existing algorithms for which the
drivers tend to ignore the rules. Emerging studies and trends system automatically gathers a reference image update and
focus on creating or improving different existing image sustains the reliability of the method.
processing techniques [1]. Some examples of the applications of A typical method which is used for optimization is the
such algorithms are object detection and identification in images genetic algorithm [16]. Genetic algorithm through image
[2]. For plate recognition problems, optical character thresholding and segmentation will be used for the plate
recognition (OCR) algorithms are the most popular solutions. localization process done by the system. Artificial neural
Artificial neural networks are powerful tools for pattern network is employed for the plate recognition subprocess of the
recognition [3] and thus, for OCR as well [4], [5], [6]. system. Figure 1 shows the block diagram of the whole system.
Intelligent traffic systems deal with an automated and
efficient way of managing road traffic using technology instead
of traffic enforcers which is needed for securing safety of lives,
property, time and economy [7]. The main focus of intelligent

978-1-5090-2597-8/16/$31.00 2016
c IEEE 2094
In particular the genetic algorithm is applied by letting the
set of cropped image with equal dimensions be the population
set of chromosomes. Afterwards, each will be evaluated by the
fitness function. The fitness function to be used in this section is
shown below. Equation 1 implies an average of the total white
pixels over the target image. The chromosomes filtered in the
Figure 1. Automated Traffic Violation Apprehension System fitness test will then undergo to the crossover process to
Block Diagram reproduce more solutions.
஼ ோ
III. METHODOLOGY ͳ
‫ ݋݅ݐܽݎ‬ൌ ෍ ෍ ‫ ܫ‬ሾͳሿ
A. Violation Detection ‫ܴܥ‬
௜ୀ଴ ௝ୀ଴
The main objective of this paper is to be able to simulate an where ratio is the white to total pixel ratio of pixels in a
automated vehicle apprehension system, by creating a system chromosome image, R is the number of row vectors in the
which is capable of detecting violation with an advanced feature chromosome image, C is the number of column vectors in the
of plate recognition, if applicable. Thus the traffic enforcers have chromosome image, and I is the chromosome images.
adequate information about violator, in addition to the physical
Subsequently, the reproduction process would be
feature of the car. Specifically, the system must detect vehicles
that are either swerving or blocking the pedestrian lane. The converting each image chromosome to a bit stream of 20 bits.
created system will have its input to be the captured photos from This is so since the cropped image came from a 480 by 850
the CCTV camera with 480 by 850 pixel resolution. Shown in pixel image, and to be able to represent them with equal number
Figure 2 is a sample photo gathered from the said camera. On of bits per dimension, each is represented by 10 bits. A
the other hand, the system will have its output data to be the concatenation is performed to derive a row matrix. Moreover,
cropped pictures of the car violators, the violation description, the crossover is achieved in such a way that a random integer,
and the plate number, if possible. The cropping size for the n, from 1 to 20 shall assign how many bits from chromosome
output will be constant and set at 116 by 161 pixels, since this is A is used to develop to a child, while 20-n bits from
the estimated dimension of an average car with respect to the chromosome B. Lastly, the stopping criteria for this section is
whole photo. the one that distinguishes the type of violation. The threshold of
white is to total pixel ratio for blocking the pedestrian lane was
discovered to be greater than 0.1, while between 0.01 to 0.1 for
swerving, and 0.01 means the noise floor level in the image.
B. Plate Localization
Given a vehicle image output from the violation detection
system, the vehicle’s plate area will be detected by the plate
localization part of the program. As mentioned, the image will
be converted to its digital equivalent. The threshold value for
conversion will be determined experimentally. The main factor
Figure 2. Sample Photo Captured from a CCTV Camera for determining the preset threshold value is that the number of
white pixels in the output digital image must be minimal as
The initial procedure of the system with respect to the possible while having its plate area readable. The digital image
violation detection section is the car detection. After which the will be subjected to genetic algorithm in order to localize the
system shall recognize which area in the road they have plate area.
obscured with respect to the background image, for this study
Figure 3 is the background image used and is initialized in the The genetic algorithm will take advantage of the plate’s
system. Finally, genetic algorithm is used to know whether the height to width ratio which has a value of 0.4. The genetic
vehicles had violated any of the stated traffic rules. algorithm will generate chromosomes which contains the pixel
location of the top-left corner of the plate. Using a standard
height of 12 pixels, the algorithm will search for possible plate
pixel locations using genetic algorithm by having crossover and
mutation on the chromosomes for each algorithm. In order to
deduce the correct plate area, the test pixel location will be
subjected to a fitness function. The fitness function used in the
algorithm initially creates a test plate area for the current pixel.
Subsequently, the test plate area will be segmented into 12
different areas. Each area will undergo comparison between the
expected B/W ratio for the certain plate area. It will be then
subjected into the fitness function:

Figure 3. Reference Image

2016 IEEE Region 10 Conference (TENCON) — Proceedings of the International Conference 2095
ଵଶ from the CCTV camera and the output cropped images after
‫ ܨ‬ൌ ෍ሺ݊௜ െ ߜ௜ ሻଶ ሾʹሿ executing the system.
௜ୀଵ

where F is the fitness value, n is the black and white ratio per
segment, and į is the expected black to white ratio per segment.
The point which will yield the minimum value will be
considered the generation’s best fit. The expected black to white
ratio was obtained experimentally from different inputs
garnering the mode of B/W ratio in all trials.
C. Plate Recognition
The plate number recognition process is subdivided into two
subprocesses, namely the plate segmentation and the character
recognition. However, the detected plate from the plate
localization process should be preprocessed first before the plate
number recognition process can be performed, so as to improve Figure 4. Input and Output of the System
the image quality and remove noise from the image.
Figures 5 and 6 describe the genetic algorithm properties
The preprocessing of the image can be carried out by resizing used in obtaining the corresponding outputs. Figure 5 depicts
first the detected plate. Since the vehicle's plate is small the best fitness plot of the blocking the pedestrian lane
compared to the whole image, scaling the height so as to increase violation, the curve overshoots but steadied at the 11th iteration
it and changing the width according to the detected plate's aspect at a value of 0.126, which verifies the fitness value of greater
ratio will improve the size of the plate image to be observed. To than 0.1 for the blocking the pedestrian lane whereas, the
improve the lighting of the plate image, its brightness is adjusted crossover performance plot provides the number of
by clipping the image intensity. Sharpening the image also gives
chromosomes through each generation. The plot shows a
emphasis and distinguishes the plate characters from the plate
background. Using a pixel-wise adaptive Wiener method, the convergence in the 586th generation which provides the solution
noise from the plate image can be filtered. Lastly, the plate at that point. The plots show the convergence which provides
image is converted to a black and white image for the plate that the solution is derived by using genetic algorithm. The
segmentation process for it to become a bit matrix. crossover performance curve is similar for the specified
violation, as this means that the system converges to an answer,
Through genetic algorithm, the plate segmentation process is in this case it is the cropped photo of the car that violated.
optimized, wherein the area of individual plate character is
captured. The fitness function of the genetic algorithm is given
by Equation 2. The algorithm will continue to iterate and create
offspring chromosomes until six chromosomes satisfy the
stopping criterion, which signifies the six individual characters
in the plate number. The process of initializing and creating new
chromosomes is similar to that mentioned in the violation
detection process.
To recognize the character for each segmented image, an
artificial neural network is designed and trained. The training
input of the artificial neural network contains sample
alphanumeric character images. Before feeding these training
data, they are first segmented into nine blocks, to increase the (a) (b)
reliability of the pattern recognition. The network is trained for Figure 5. (a) Best Fitness Plot and Crossover Performance of
it to learn the distinct characteristics of each character through the Blocking the Pedestrian Lane Violation
its nine blocks. To test the network, individual plate character
images are divided into nine blocks as well and are fed to it as Likewise, Figure 6 is the best fitness plot of the swerving
testing data. detection of the system; one can observe that the curve gradually
stabilized at the 2nd iteration at 0.088, which is expected for
IV. EXPERIMENT RESULTS swerving violation. This further attests that the fitness value for
swerving lies in between the 0.01 to 0.1. On the other hand, the
A. Violation Detection crossover performance plot in Figure 10 shows an identical
After the system was designed, the researcher have tested the curve to that of blocking the pedestrian lane as clarified earlier
reliability of the system, shown in the proceeding discussions are but converged at the 365th generation. The prompt convergence
the input. The outputs of the system was collected and for swerving was reasonable as the reiterations acquired for
examined, because the output also included the crossover detecting swerving was less than the blocking of pedestrian lane.
performance and the best fitness plot besides the violator and
plate number. Shown in Figure 4 is the original data captured

2096 2016 IEEE Region 10 Conference (TENCON) — Proceedings of the International Conference
(c) (d)
Figure 8. Blocking the Pedestrian Lane Violation’s (a)
Crossover Performance and (b) Best Fit Plot; Swerving
(a) (b) Violation’s (c) Crossover Performance and (d) Best Fit Plot
Figure 6. (a) Best Fitness Plot and Crossover Performance of
the Swerving Violation In order to evaluate the fitness function, the deduced plate
B. Plate Localization must be segmented. Every segment will be subjected to the
fitness function having the expected B/W ratio on Table 1.
For the system, the experimental threshold value is
0.392157. Figure 7 shows the output digital image for the TABLE 1. Expected B/W ratio
acquired threshold values in the outputs in Figure 3. Segment Expected B/W ratio Segment Expected B/W ratio

1 0.566666 7 0.566666

2 0.466666 8 0.766666

3 0.633333 9 0.633333

4 0.533333 10 0.866666
(a) (b)
Figure 7. Digital Images for the (a) Blocking the Pedestrian 5 0.400000 11 0.833333
Lane and (b) Swerving Violations
6 0.233333 12 0.466666
It is seen that Figure 7a shows no plate area; it will still be
subjected to the algorithm which is expected to be rejected by
the plate localization algorithm. The crossover performance Final fitness values greater than 0.2 will not be considered a
was also obtained by plotting the number of chromosomes per plate area. So, the blocking the pedestrian line image will not
generation. Some of the chromosomes will be rejected due to output a plate area at that current frame. On the other hand, for
the fact that it may be out of bounds. The current population is swerving violation Figure 9 shows the output of the plate
based on the accepted chromosomes and it will be the parents localization system. This will be subjected to plate recognition
for the next generation. Figure 8a and 8c shows the crossover processes.
performance of each plate localization genetic algorithm
respectively. For each generation, the best fitness values were
also calculated and plotted. Figure 7b and 7d show the plot for
the best fit values for the images. Figure 9. Localized plate area
C. Plate Recognition
Through the preprocessing of the extracted plate image, the
following improvements on the plate image were obtained. The
figure shows how the plate image changed as it underwent
resizing, brightness adjustment, sharpening, filtering and
conversion to black and white. The next figure shows how the
black and white plate image was segmented into the six
individual characters that was detected.
(a) (b)

Figure 10. Segmented Plate Image


Before feeding each character to the artificial neural
network, each plate character image was divided into nine

2016 IEEE Region 10 Conference (TENCON) — Proceedings of the International Conference 2097
blocks as shown below. Lastly, the following matches has been average program runtime was computed as the sum of the
made by trained artificial neural network. average runtimes of each sections of the system, which was
found to be 1.34 seconds hence the system is not applicable for
high frame rate camera.
VI. CONCLUSION AND RECOMMENDATION
The modeled automated traffic apprehension system was
able to detect the type of violation stated on this paper namely,
swerving, and blocking the pedestrian lane. The convergence of
detection for the two kinds of traffic violations mentioned is not
identical, because of distinct threshold conditions for the
different types of violation. The system was able to provide
detection for both violation and in addition to that, one of the
plate number was recognized. Moreover, the detection of
swerving violations require less time than blocking the
pedestrian lane violations, due to the fact that the stopping
criteria was smaller in swerving. Also, the program runtime was
observably slow, and can be enhanced by using a computer with
faster speed processor specifications.
The plate localization process which was used in the study
was able to detect correctly the expected plate area. It was
Figure 11. Image Plate Characters matched with Sample Plate evident that the algorithm has a high accuracy and a good
Characters computation time which yields to the creation of an efficient
system. There are also other techniques in order to do this system
V. DISCUSSION AND ANALYSIS OF RESULTS such as the fitness function can be varied and applied with
In the violation detection process, it was observed that the different techniques. Another variation can be done on the
swerving violation was detected after 365 generations whereas system is by using different number of initial chromosomes and
the blocking the pedestrian lane was identified after 586 the number of generations of the program.
generations. This means that the algorithm for the swerving Upon performing the plate recognition process, it can be
violation detection converged faster than that of the blocking the observed that the trained artificial neural network successfully
pedestrian lane violation detection. This difference in mapped the segmented character images into the corresponding
convergence time can be attributed to the fitness requirement sample character images. Even though the relationships were
difference between the two. Thus, the system took less highly nonlinear, it was able to correctly recognize the
iterations, generations, and program runtime to converge in characters. Moreover, the robustness of the algorithm was
detecting swerving. It can also be concluded that swerving verified because even though the black and white plate image
detection is simpler to converge than blocking the pedestrian has improved the original plate image, it can be observed that
lane detection. the plate was not perfectly recreated as the image still contains
For the plate localization process, it was seen how the genetic noise though minimized.
algorithm was able to converge to the desired fitness value. An For future studies, it can be recommended that the overall
advantage of using the algorithm is that it can converge to the algorithm can be improved for better algorithm speed
value faster compared to analyzing every pixel in the image performance. Future researches can also focus on the
itself. It was faster since it has a fewer number of pixels to be applicability of the modelled genetic algorithm for other
evaluated. In addition, the plate localization successfully complex image processing techniques because this will boost the
isolated the plate area and the average time of calculation was program runtime of the system by disregarding unimportant
recorded to be 0.846 seconds. The accuracy of the algorithm was procedures done in a background difference method.
computed to have a 91.6667 %.
REFERENCES
For the plate recognition process, it can be observed that the
original plate image is too small, blurred and of poor quality.
Straightforwardly subjecting it to the plate segmentation and
character recognition processes will be futile because the [1] Broumandnia and H. Moghassemi, "Iranian license
algorithm will not be able to properly distinguish the characters plate recognition using connected component and
in it. Hence, through the use of the mentioned preprocessing
clustering technique," in 7th International
techniques, a much clearer black and white version of the plate
image was obtained. As such, the images can undergo plate Conference on Networked Computing and
segmentation as well as character recognition. Advanced Information Management (NCM),
In, general, the system was tested to 47 more image with an Gyeongju, 2011.
overall accuracy of 90.67%, and due to lack of space the image
result would not be further presented. Further, the system’s

2098 2016 IEEE Region 10 Conference (TENCON) — Proceedings of the International Conference
[2] W. Wang, "License plate recognition algorithm [10] T. Sirithinaphong and K. Chamnongthai, "The
based on radial basis function neural networks," in recognition of car license plate for automatic
Intelligent Ubiquitous Computing and Education, parking system," in Signal Processing and Its
2009 International Symposium, Chengdu, 2009. Applications, 1999. ISSPA '99. Proceedings of the
[3] J. P. N. Cruz, M. L. Dimaala, L. G. L. Francisco, E. J. S. Fifth International Symposium, Brisbane, 1999.
Franco, A. A. Bandala and E. P. Dadios, "Object [11] G. Ou, Y. Gao and Y. Liu, "Real-Time Vehicular
recognition and detection by shape and color Traffic Violation Detection in Traffic Monitoring
pattern recognition utilizing Artificial Neural Stream," in Web Intelligence and Intelligent Agent
Networks," in Information and Communication Technology (WI-IAT), 2012 IEEE/WIC/ACM
Technology (ICoICT), 2013 International International Conferences, Macau, 2012.
Conference, Bandung, 2013. [12] X. Zhang, Y. Tian, L. Liang, T. Huang and W. Gao,
[4] W. Wu, H. Xinhan, W. Min and S. Yexin, "An "MACRO-BLOCK-LEVEL SELECTIVE BACKGROUND
automatic system of vehicle number-plate DIFFERENCE CODING FOR SURVEILLANCE VIDEO,"
recognition based on neural networks," in Journal in 2012 IEEE International Conference on
of Systems Engineering and Electronics, 2001. Multimedia and Expo, Beijing, 2012.
[5] C. Chen, T. Chen, M. Wu, T. Tang and W. Hu, [13] Y. Artan, O. Bulan, R. Loce and P. Paul, "Passenger
"License plate recognition for moving vehicles Compartment Violation Detection in HOV/HOT
using a moving camera," in Ninth International Lanes," in IEEE Winter Conference in Applications of
Conference on Intelligent Information Hiding and Computer Vision, Steamboat Springs, CO, USA,
Multimedia Signal Processing, Beijing, 2013. 2014.
[6] A. R. F. Quiros, A. Abad, R. A. Bedruz, A. C. Uy and [14] M. Fathy and M. Siyal, "An image detection
E. P. Dadios, "A Genetic Algorithm and Artificial technique based on morphological edge detection
Neural Network-based Approach for the Machine and background differencing for real-time traffic
Vision of Plate Segmentation and Character analysis," Pattern Recognition Letters, vol. 15, no.
Recognition," in 8th IEEE International Conference 3, pp. 1321-1330, 1995.
Humanoid, Nanotechnology, Information [15] L. S. Bartolome, A. A. Bandala, C. Llorente and E. P.
Technology, Cebu, 2015. Dadios, "Vehicle parking inventory system utilizing
[7] S. Islam, K. Dey, M. Islam and M. Alam, "An infrared image recognition through artificial neural
based intelligent Traffic System," in Informatics, networks," in TENCON 2012 - 2012 IEEE Region 10
Electronics & Vision (ICIEV), Dhaka, 2012. Conference, Cebu, 2012.
[8] A. C. P. Uy, R. A. Bedruz, A. R. Quiros and A. [16] J. H. a. M. Oskoei, "Modified genetic algorithm for
Bandala, "Machine vision for traffic violation solving n-queens problem," in Intelligent Systems
detection system through genetic algorithm," in (ICIS), 2014 Iranian Conference, Bam, 2014.
HNICEM, Cebu, 2015.
[9] A. Sharma, R. Chaki and U. Bhattacharya,
"Applications of wireless sensor network in
Intelligent Traffic System: A review," in
International Conference on Electronics Computer
Technology, Kanyakumari, 2011.

2016 IEEE Region 10 Conference (TENCON) — Proceedings of the International Conference 2099

Você também pode gostar