Implementation paper of Traffic Signal Detection and Recognition using deep learning

Traffic boards and traffic signals are used to maintain proper traffic through busy roads. They help to recognize the rules to follow when driving the vehicle. These signs warn the distracted driver, and prevent his/her actions which could lead to an accident. We have proposed a system which can help recognize these boards and signals at real time thus avoiding major mishap. A real-time automatic sign detection and recognition can help the driver, significantly increasing his/her safety. Lately traffic sign recognition has got an immense interest lately by large scale companies such as Google, Apple and Volkswagen etc. which is driven by the market needs for intelligent applications such as autonomous driving, driver assistance systems (ADAS), mobile mapping, Mobil eye, Apple, etc. Hence, here, we have implemented to do the same with cost efficient manner using Raspberry Pi. The proposed system detects the traffic board or traffic signals, capture its image which through deep learning approach recognizes the same to give result on dashboard as well it gives the measures of distance from front obstacle which helps to implement brake system if obstacle is near. PiCam is used to capture images of traffic sings and is connected to RaspberryPi. Monitor is used to display required output, showing type of sign and distance of collision. This proposal will avoid large number of accidents occurring at bridges and work in progress area due to automated braking system and simultaneous reduce death ratio.


Introduction
Road transport is dominant means of transport in India. It plays a vital role in social and economic integration and development of the country. Road accidents are major which hamper to this progress. According to world accident report statistics India is slated at highest position for road accidents. In 2017, 4,64,910 number of accidents occurred with 1,47,913 number people killed. In 2018, 4,67,044 number of accidents happened with killing of 1,51,417 number of people [14]. Most of these accidents occur due to collisions and other by people not following traffic rules. So, it becomes more import to increase security at traffic road to avoid such hazards. We must make vehicle driver more aware about traffic signs and breaking distance. Sometimes driver has all knowledge about traffic signs but while driving they neglect traffic signs which result in accidents. For the similar reason first objective of the system is to detect traffic signals and sign boards to assist the driver and give warnings through audio as feedback to driver, thus helping to decrease the number of accidents. Overall objective of work is to formulate a system for traffic signal detection and detection of traffic sign boards. The method helps to detect distinguishing traffic light colors such as red and green, and different boards of signs such as forward, turn left, turn right and turn back. Lately, the traffic sign recognition systems have become an integral part of Advanced Driver Assistance Systems (ADAS). For collisional type of accident prevention, vehicle in front of us applies break suddenly due to any reason and we are unable to respond it so fast and front collision occurs. Hence, we have proposed a system using raspberry pi and PiCam with ultrasonic sensor, which will alert driver about traffic signs coming on road and simultaneously avoid front collision using automatic breaking after vehicle enters in breaking distance zone.

Literature Survey
Research and Application of Traffic Sign Detection and Recognition Based on Deep Learning, now days, with the rapid development of society and economy, automobiles have become almost one of the convenient modes of transport for every house-hold. This types the road traffic environment more and more complex, and people expect to have an intelligent Vision-assisted application that provide drivers with traffic sign information, regulate driver operations, or assist in vehicle control to ensure road safety. As one of the more important functions, traffic sign detection and recognition, has become a hot research direction of researchers at home and abroad. It is mainly the use of vehicle cameras to capture real time road images, and then to detect and identify the traffic signs encountered on the road, thus providing accurate information to the driving system. However, the road conditions in the actual scene are very complicated. After many years of hard work, researchers have not yet made the recognition system practical, and further research and improvement are still needed. Traditionally, traffic signage has been detected and categorized using standard computer vision methods, but it also takes considerable time to manually process important features of the image. With the development and progress of science and technology, more and more scholars use deep learning technology to solve this problem. The main reason that the deep learning method is generally known is that the model can learn the deep features inside the image originally from the training samples, especially for many cases that do not know how to design the feature extractor, such as expression recognition, target detection Wait. Based on the application of road traffic sign detection and recognition, this article focuses on the correctness and high efficiency of detection and recognition [1]. Traffic Light and Sign Detection for Autonomous Land Vehicle Using Raspberry Pi, this work aims to implement traffic light and sign detection using Image processing technique for an autonomous and vehicle. Traffic Sign Recognition system is used to normalize traffic signs, warn a driver and command certain actions. Fast robust and real time automatic traffic sign detection and recognition can support the driver and significantly increase driving safety. Automatic recognition of traffic signs is also important for an automated intelligent driving vehicle or for a driver assistance system. This is a visual based project i.e., the input to the system is video data which is always captured from the web cam which is interfaced to the Raspberry Pi. HSV (hue,saturation,value) techniques are used to pre-process the images. Color space model technique is arranged for traffic light detection, for sign detection again HSV color space model and Contour Algorithm is used. The signs are detected based on Region of Interest (ROI). The ROI is detected based on the features like geometric shape and color of the object in the image having the traffic Signs [2]. The system of Real-Time Traffic Sign Detection and Classification, Traffic sign recognition plays a vital role in driver assistant systems and intelligent autonomous vehicles. With traffic sign recognition doing the same in real time is most required as an addon feature. This paper aims to deal with real-time traffic sign recognition, i.e., localizing what type of traffic sign looks in which area of an input image at a fast processing time. To achieve this goal, the authors first propose a really fast detection module, which is 20 times faster than the existing best detection module. The authors detection module is based on traffic sign suggestion extraction and classification built upon a color probability model and a color HOG. Then, they harvest from a convolution neural network to extra classify the detected signs into their sub classes within each super class. Experimental results on both German and Chinese roads show that both their detection and classification methods realize comparable performance with the state-of theart methods, with significantly improved computational efficiency [3]. Road Sign Recognition System on Raspberry Pi, the paper describes the speed signs Characteristics, requirements and problems late applying a real-time road sign recognition base system with embedded system, and how to deal with numbers using image processing techniques based on shape and dimension analysis. The techniques used for classification and recognition of images is noted in the paper. Color analysis plays crucial role in road sign detection, this paper points to many problems regarding stability of color detection due to daylight conditions, so absence of color model can have led a better solution. In this system lightweight techniques were mainly used due to limitation of real time based application and Raspberry Pi capabilities. Raspberry Pi is the main target for the implementation, as it provides an interface between sensors, database, and image processing results, while also performing functions to manipulate peripheral units (sub dongle, keyboard etc.) [4].
A Survey of Traffic Sign Recognition, Advanced Driver Assistance Systems (ADAS) raise to various hightech in better cognizance of the road and its potential hazards as well as other drivers around them. The design of traffic sign recognition, one important subsystem of ADAS, has been a challenge problem for many years and hence become an important and active research topic in the area of intelligent transport systems. The realization of a real-time traffic sign recognition system is usually divided into three stages: detection, tracking and classification. This paper introduces the main difficulties in road sign recognition and briefly surveys the stateof-the-art technologies in this field with further discussions on the potential trend of development of road sign recognition [5]. "A Road Sign Detection and the Recognition for Driver Assistance Systems", this paper explores the effective approach of road sign detection and recognition for Driver Assistance Systems (DAS). World of today sees much changed roads and road facilities then the last decade, the facility of express highways is equipped with increased lane size made up with cement concrete, thus the speed of vehicles have also increased so from driver view sometimes he might happen to neglect the traffic signs which are mandatory. This paper illustrates proposed system to help driver about the road sign detection to avoid road accidents. The automation of road-signs recognition is an integral part of Driver Assisting Systems which helps to safety of driver as well to driving comfort.
In this paper an efficient approach for the detection and recognition of the road sign in the road and acquiring the traffic scene images from a moving vehicle is present. DAS system is made up two parts which includes recognition of traffic sign and then detection. For recognition, as the vehicles these days are at high speed, real time performance counts for capturing the image of signs. These images are cropped as per the requirement and then detection is done through the available dataset for naming the particular traffic sign. In the detection module segments, the input image in a YCBCR colour space, and then it detects road signs by using the shape filtering method. The classification module present determines the type of detected road signs by using an artificial neural network (ANN). The extensive experimentation has shown that the proposed system approach is robust enough to detect and the recognize road signs under varying lighting, rotation and translation conditions [6]. The Paper "Towards Reliable Traffic Sign Recognition", Describes robust system architecture for the reliable recognition of circular traffic signs. Authors system employs complementing approaches for the different stages of current TSR systems. This introduces the application of local SIFT features for content-based traffic sign detection along with widely applied shape-based approaches. They further add a technique called contracting curve density (CCO) to refine the localization of the detected traffic sign candidates and therefore increase the performance of the subsequent classification module. Finally, the recognition stage based on SIFT and SURF descriptions of the candidates executed by a neural net provides a robust classification of structured image content like traffic signs. By applying these steps they compensate the weaknesses of the utilized approaches, and thus, improve the system's performance [7]. Collision Detection and Avoidance System for Vehicle, Introduce an alarming and response system for moving vehicle using ultrasonic ranging device (URD) which is a combination of a transmitter, a receiver and a single processing device and a microcontroller. The system calculates the minimum safety distance and alarm the driver if distance is low. And if driver doesn't slow down the vehicle then the system will itself apply the brakes and slow the vehicle [8]. Intelligent Transportation System for detection of accident and prevention facility is intelligent system provided for two wheeler for safety of human life. The prevention facility involves, Smart Helmet detection, which checks whether the person is wearing the helmet and has not been drinking while driving. The relay configuration does not ON the engine if these two conditions are not satisfied. The function of relay is controlled by microcontroller, thus the ignition does not start. The intelligent system detects an accident at any place and reports about the same is send to predefined numbers with GSM module. The continuous records are recorded by microcontroller thus determining all the parameters of automobile for smart prevention and detection of accident [9]. A Practical Animal Detection and Collision Avoidance System Using Computer Visualization Technique, in this paper, we discussed the necessity of automatic animal detection system and our algorithm for animal detection based on HOG and cascade classifier. The algorithm can notice an animal in different conditions on highways.
The proposed system realizes an accuracy of almost 82.5 regarding animal (cow) detection. Estimation of estimated animal distance from the testing vehicle is also done. Though the proposed work has been focused on automatic animal detection in context to Indian highways, it will work in other countries also. The proposed method can easily be extended for detection of other animals too after proper training and testing. The proposed system can be used with other available, efficient pedestrian and vehicle detection systems and can be offered as a complete solution (package) for preventing collisions and loss of human life on highways [10]. Normal human can simply identify any written or typed or scanned text, numbers, etc. but when it comes to a device, it is not easy to find out what accurately that given text or numbers. It will be not easy to identify a handwritten digit for a device. Many machine learning methods used to fix the handwritten digit recognition problem. It is growing in more not easy domains, so its training complexity is also increasing. To beat this complexity problem, many algorithms have been implemented. In this paper, the Convolution Neural Network (CNN) and Particle Swarm Optimization (PSO), those two approaches use for recognition of the isolated handwritten digit. Customized PSO is used to reduce the overall computation time of the proposed system [11]. In this paper mangoes are graded in four types like Green Mango, Yellow Mango and Red Mango which are based on machine learning method. This system considers RGB values size and shape of mangoes. Following analysis is used to obtain good probability. This helps to train system to identify appropriate maturity of mangoes. This research is conducted on two machine learning method i.e. Naive Byes and SVM (Support Vector Machine) [12]. Handwritten digits look different due to writing styles and sizes. There is a wide scope of research on regional languages like Kannada. As Kannada digits symmetric as well as curvy, they are difficult to recognize accurately. Customized convolutional neural network architecture is proposed in this paper for Kannada digits' classification which are handwritten. This provides automatic learning feature facility of handwritten digit and predicts its class [13].

PROPOSED SYSTEM
The system includes two sensors attached to Raspberry Pi. The first sensor is ultrasonic sensor which helps to detect any vehicles or obstacles in front of our vehicle. The second sensor includes Pi Cam which captures images. These images are analyzed perform the analysis for image, features extraction is done using following steps: Capture input images using pi camera Crop the area of Sign board.
1. Extract parameters like arrows by threshold segmentation (remove noises, Morphological operations). 2. Calculate geometrical properties (Area and perimeter) calculate the roundness value. 3. Classification algorithm to identify Traffic Signs. Thus, deep learning is used to identify the Traffic signal and signify the same. 4.An ongoing sign recognizable proof and acknowledgment can support to the driver, basically growing driver security. Traffic sign acknowledgment is used to recognize traffic signs, alert the involved drivers, and hinder driver exercises that can lead a mishap.

Figure 1. Block Diagram
Give us a chance to consider framework have two ultrasonic sensors where one is placed in the front and another behind the vehicle. With the assistance of this sensor, we can figure the separation of the various vehicles nearing us. Along these lines, framework can discover various vehicles and framework can driver from mishaps. The vehicle mishaps evasion structures dodge the road mishaps that will regularly occurring on interstates and in city traffic. These mishaps are generally happened by preoccupation, conspicuousness, and partitions darken between our vehicles.

K-Means Algorithm
Input: A dataset of points P=p1,..,pn, a number of cluster k. Output: centers c1,...,ck implicitly dividing p into k clusters. 1) choose k initial centers C= c1,...,ck 2) while stopping criterion has not been met 3) do assignment Steps: 4) for i=1,...,N 5) do find closest center cK E C to Instance pi 6) do find closest center cK E C to Instance pi 7) assign instance pi to set ck 8) update step: 9) for i=1,...,k 10) do set ci to be center of mass of all points in ci

Grayscale Algorithm
Steps: 1. Get the red, green, and blue values of a pixel. 2. Use fancy math to turn those numbers into a single gray value. 3. Replace the original red, green, and blue values with the new gray value.

Traffic Sign Detection:
In proposed system, Traffic Sign is captured through Pi Cam and detection of specific sign is done with help of Raspberry Pi. Different sign shown in following figure are detected when captured though Pi Cam.

Traffic Sign Recognition:
The following figure shows the traffic sign detected and its output after recognition. Using this detected sign system has controlled a robot for now.

Accident Avoidance:
Ultrasonic sensor attached to the front of prototype model is used to determine the distance of vehicle from next vehicle thus avoiding the accident by applying brakes when the next vehicle is very close the vehicle. This is proposing prototype model for traffic sign detection and vehicle accident avoidance system model. The prototype contains Raspberry pi, pi camera, ultrasonic sensor and robot chassis.

Conclusion
In this paper, PiCAM is recognizing the traffic sign on street and alert to the driver. On the off chance that the driver has disregarded the traffic sign, at that point automatic braking system will be actuated by Raspberry Pi microcontroller. Then again, framework will consistently track front vehicle distance utilizing ultrasonic sensor, and breaks will be connected by distance. This will keep away from the vehicle accidents because of sign board carelessness, likewise this will drivers to keep up safe distance between the vehicles. This will likewise maintain a strategic distance from the accidents happening because of head-on impact. The alarm on dashboard will make driver constantly mindful of the street status.