What’s up with traffic on the roads of Bangalore?

In this article, let us dive deeper into the data on traffic of Bangalore, with the objective to gain insights which will help us plan our commute better.

INTRODUCTIONTraffic on roads of Bangalore is not among the best in cities of India, and a recent study by Ola Cabs have confirmed the same — the average speed of vehicles at peak hours is approx 15.

5 KM/hr, which is 3rd from bottom ranking among Indian cities.

But there are pockets where traffic moves at high speed as well, and there are parts of city where number of accidents or potential accidents is high, at the same time at other places it is pretty low.

Through exploratory analysis of this public dataset, let us try to unravel some interesting observations about roads and traffic of Bangalore.

ABOUT THE DATAThis data (downloaded from public dataset in Kaggle) is collected by Collision Avoidance System installed in buses and has mapping of data on imminent collisions in areas in the city of Bangalore.

Information available in the dataset:Device Code: Unique device code for the CAS installed in the vehiclesLatitude: Latitude of the location where the collision warning was generatedLongitude: Longitude of the location where the collision warning was generatedWard Name : BBMP ward in which this location (lat, long) falls underType of Alarm: The type of collision alert generated by the collision avoidance system (more details about that below)Recorded Date and Time : Date and time at which the alert was generatedSpeed: Speed of the vehicle at the time when the collision alert was generated.

Values of all the speed are in km/hr.

Following are the steps followed for analysis:Read data.

Pre-processing and cleanup of data.

Data analysis through visualization.

The complete source code is available here, in case you want to have a look.

Please provide your valuable feedback and suggestions in the comments section below, or write me at the email address provided at the end.

DISCLAIMERBasic analysis of the dataset reveals few limitations, as follows:Data is available only for year 2018.

In 2018, data for only the months of February, March, April, June and July are present.

Over any day, data between 6 AM and 6 PM is only availble.

On roads of a city like Bangalore, data beyond 6 PM and late into the evening is important, which is missing.

To summarize, it is a good one to start basic analysis and understand the high level trends of road related incidents in Bangalore.

BACKGROUND INFORMATIONBefore further deep-dive, it is important to understand the types of alarms captured by CDS or CAS.

More details is available here.

Forward Collision Warnings (FCW)A FCW alerts drivers of an imminent rear-end collision with a car, truck, or motorcycle.

Urban Forward Collision Warnings (UFCW)UFCW provides an alert before a possible low-speed collision with the vehicle in front, thus assisting the driver at a low speed in densely heavy traffic.

This is usually applicable when driving under approx 30 kmph.

Headway Monitoring Warning (HMW)The headway monitoring warning (HMW) helps drivers maintain a safe following distance from the vehicle ahead of them by providing visual and audible alerts if the distance becomes unsafe.

Active above 30 kmph, this sensor generates alarm and displays the amount of time, in seconds, to the vehicle in front when that time becomes 2.

5 seconds or less.

Lane Departure Warnings (LDW)The LDW provides an alert when the vehicle unintentionally departs from the driving lane without using the turn signals.

If the turn signals are used when changing lanes, an alert is not generated.

Usually active above 55 kmph, LDW might not work well if lanes are unmarked or poorly marked.

This is further classified into: (a) LDWL, for lane departures towards left lane and (b) LDWR, for the same towards right lane.

Pedestrians And Cyclist Detection And Collision Warning (PCW)The PCW notifies the driver of a pedestrian or cyclist in the danger zone and alerts drivers of an imminent collision with a pedestrian or cyclist.

PCW works well when vehicle is below 50 kmph.

OverspeedingDetects and classifies various visible speed limit signs and provides visual indication when the vehicle’s speed exceeds the posted speed limit.

VISUALIZATION OF OBSERVATIONS AND RESULTS FROM EXPLORATORY ANALYSISThrough extensive steps of data cleanup, processing and exploratory analysis, few very interesting observations emerged.

Here’s few of those.

Let’s start with a plot of all CAS alarm data on a map of Bangalore/Bengaluru by the co-ordinates specified, to generate a heatmap of locations and speed of vehicles at the time of alarm generation.

On this heatmap, magnitude of speed is represented by color temperatures — cooler (bluish) plots indicate low speeds whereas warmer (reddish) colors represent higher speeds.

An interactive accident heatmap of city of Bangalore.

Hover on and zoom in the map for more details.

The above is an interactive map, so hover on to see the wards and zoom in to find out speed of vehicles in particular locations.

Some of the areas where speed is relatively high:Old Madras Road/Bangalore-Tirupati HighwaySarjapur RoadSome parts of Outer Ring RoadAnekal Main Road etc.

WARD-WISE DISTRIBUTION OF ACCIDENTSSPEED OF VEHICLE WHEN INCIDENT OCCURREDThe speed data that is available in the dataset is the speed recorded by buses at the time of alarm generation, and not overall speed of vehicles/buses on Bangalore roads.

The highest speed that is recorded is 83 kmph, however the average speed is only 22 kmph.

DATE AND TIMEThere’s peak on 19th day of the month, but probably that is a noise.

As far as time of day is concerned, early morning (7 AM) and afternoon (3 PM) doesn’t look like the best time to travel.

However, it needs to be kept in mind that the dataset contains data for only 12 hours of the day.

Hence, we can’t see the situation at evening peak hours.

So far we have explored some of the individual features.

Now, let’s try to unravel few interesting observations, by combining two or more features together.

(1) A HEATMAP OF LOCATIONS IN BANGALORE BY ALARM TYPESNote that here, hour of a day is represented as color-map, such that early hour are presented in cool colors (blueish), and warmer colors represent later parts of the day as the day progresses.

Observation: The above heatmap clearly indicates that all kinds of alarms were generated from all over Bangalore.

Hence, even though certain types of accidents are more frequent in certain areas (for example, over-speeding is more prevalent on highways), accidents are potentially possible all over the city.

(2) A DISTRIBUTION OF SPEED FOR EACH OF THESE ACCIDENT/ALARM TYPESObservations:Low speed collisions happen at an average speed of 11–12 kmph.

High speed collisions happen at an average speed of approx 35 kmph, with many instances of higher speeds.

Overspeeding is reported at an average of 25 kmph speed (which is not really overspeed).

This raises doubt on the quality of overspeeding alarms.

Average speed of lane departures without indicators, and collisions with pedestrians and cyclists is 20 kmph.

(3) WHICH AREAS ARE NOTORIOUS FOR WHICH KIND OF ACCIDENTS?Observations:Most incidents of high and low speed collisions happen in Hagadur.

Overspeeding is most common in Garudachar Playa.

Hagadur is infamous for collisions with pedestrians and cyclist as well, not to mention lane change without indicators.

(4) KNOW THE TOP 10 MOST DANGEROUS WARDS ON A MAP OF BANGALORESUMMARYThe above analysis provides us with quite a few interesting observations of road traffic of Bangalore.

For example, how safe or unsafe each ward is, what time of day is best for travel, average speed of vehicles on road, and so on.

Most interestingly, an interactive map with speed distribution allows us to find out the exact locations where the incidents occurred, along with names of BBMP wards and speed of vehicle at that point of time.

Thank you for reading!.Do you agree to these observations?.Please share your thoughts in comments section below, or drop me a line at supratimh[at]gmail[dot]com.

For other projects I have worked on or currently working on, please stop by http://supratimh.

github.

io.

.

. More details

Leave a Reply