Safe and Sound: The Applications of Computer Vision in Road Safety in East Africa

Road safety is a key facet of developing safer cities and improving civilian quality of life. They are universally used by members of society and are frequently the site of accidents that lead to injury or death – with road accidents as the leading cause of death for children and young adults globally. They are especially frequent and lethal in East Africa. Kenya’s traffic mortality rate, for example, is 28.2, the ninth-highest in the world; in Uganda, over 21,000 people were victims of road accidents in 2022.  

Road accidents take lives and cause families and communities devastating grief and financial burden, but they also beget economic impacts. 75% of Kenya’s road casualties are economically productive young adults and care for accident victims places adds strain on already overwhelmed healthcare systems. East Africa transports 90-95% of all goods by road, so freight accidents negatively impact enterprises. The fallout of road accidents costs East Africa up to 9% of its GDP

Road accidents are attributable to poor road infrastructure, which spurs circumstantial traffic law breaches such as pedestrians crossing motorways at undesignated points due to a lack of nearby alternatives. Intentional traffic law breaches also cause road accidents. For example, in Ethiopia, driver misconduct accounts for 83.3% of all accidents.  

Somewhat unique to East Africa is the widespread popularity of motorbikes, which have grown to outsell cars. Motorbikes move at high speeds and render riders vulnerable to direct impact during collisions. They also tend to carry more passengers than is advisable. With this in mind, it is no surprise that motorbikes spurred 53% of Rwanda’s road accidents in 2023. 

While a myriad of factors can lead to road accidents, the impact of insufficient or absent road safety technology cannot be understated. East African roads are largely unsupervised, making it difficult to monitor traffic and identify deviant actors. Several attempts have been made but to little avail. Uganda recently scrapped its $126 million nationwide surveillance initiative in its infancy due to concerns over data privacy. Kenya's 2014 anti-terrorism efforts saw 2000 CCTV cameras installed around Nairobi, an endeavour rendered futile by weak police response. Police deployment strategies require addressing, but the sheer magnitude of footage requiring review means human labour alone will not suffice to pinpoint and tackle traffic crimes on a large scale. Surveillance technology and subsequent law enforcement responses are ineffective if not supplemented with artificial intelligence models.  

Considering the prevalence of road accidents in East Africa, artificial intelligence (AI) solutions must be explored to achieve much-needed improvements to the region’s road safety. 

Computer Vision 

Computer vision technology allows computers to identify objects in images and can be used to analyse footage from road cameras. Thus, it is an invaluable tool for gathering insight into the common causes of road accidents. It allows for 24/7 surveillance and analysis of traffic activity, ultimately providing faster and more accurate assessments of accident hotspots, while requiring significantly less manpower. This expands the horizons of traffic monitoring, allowing authorities to access virtually infinite data sets to determine and address the factors that undermine road safety – from recognising accident “black spots” to noting the license plates and semblances of unruly drivers.  

After multi-year manual research on the causes of road accidents in Tanzania, improvements were made to road infrastructure in Dar es Salaam. These improvements reduced speeding by up to 40% in 2017. Computer vision would aid in making similar future endeavours much less time-consuming and resource-intensive, allowing for such positive impacts on road safety to be felt more promptly and universally. 

Computer vision can also be used to monitor highway traffic congestion state. This data can then inform road expansions to accommodate more traffic on congested highways, or guide traffic light regulations to allow for extended flow along congested lanes/directions. When paired with traffic light automation algorithms, computer vision can even allow for traffic lights to be controlled based on real-time data on congestion states at a given intersection. Given that road accidents cost governments worldwide close to $1.8 billion annually, and that investment in road safety technology has shown a 50% return on investment between 2000 and 2018 in several countries, improving road safety via computer vision could save East African governments millions in expenditure.  

A wide variety of computer vision models are available: semantic segmentation maps out the exact boundaries of objects within images, while generative adversarial networks (GANs) facilitate image generation and allow for edited footage to be identified. 

Convolutional Neural Networks 

Convolutional neural networks (CNNs) are a powerhouse computer vision model. They enable computers to recognise objects in images and classify images based on their content. Each layer of a CNN recognises whether a specified component or motif is present within each pixel of an image. As the image progresses through the layers in the neural network, the motifs convolute into a recognisable object. A computer can be trained to identify a given object by training a CNN model across thousands of labelled photographs; some containing the object in question, and others without. CNNs demonstrate high predictive accuracy, with even early models showing an accuracy of 82%

CNN models can be used to monitor vehicle behaviour in real-time. Frame-by-frame analysis of live footage allows CNN models to ascertain the speed of vehicles as they pass by a particular point on a road. Law enforcement officials can then use these measurements to determine if and/or where drivers are frequently disobeying speeding laws or cautionary road signs. License plate numbers identified in images analysed by the CNN model can also be used to trace and fine irresponsible drivers. This model has been successfully employed in the UK, yielding successful identification of drunk drivers and drug dealing operations.  

CNNs can accurately detect pedestrians, even in ‘busy’ images of crowded urban areas. This expands the scope of their applicability, as they show potential for use within vehicles themselves, to warn drivers of the sudden appearance of pedestrians in a vehicle’s path. Equally valuable is CNN’s ability to identify and warn drivers of fast-moving objects like motorbikes.  

CNNs are already used within self-driving vehicles, to fortify recognition of oncoming obstacles. The ability to detect pedestrians, and the subsequent opportunity to warn drivers to brake or otherwise avoid a collision, would be very helpful in preventing road accidents in East Africa, where motorbikes are common and large swaths of the population – including three quarters of children – are pedestrians on roads without sidewalks, crossing points and other safety infrastructure. 

CNNs can also quickly identify road accidents in live footage, and alert authorities of their occurrence and location. This would greatly reduce the response time of medical attenders, hence increasing the likelihood of survival and full speedy recovery for all involved in any given road accident. Additionally, CNNs can pick up patterns from road camera footage to identify frequent accident sites. They can then predict black spots, and subsequently inform the introduction of well-placed road signs and speed bumps. Augmenting road design near black spots decreased accident rates by nearly 40% between 2003 and 2012 along the Kenyan portion of the Northern Corridor

CNNs are ideal for use in East Africa, where road designs are non-uniform, ranging from single-lane dirt tracks to multi-tier motorways. Tanzania, for example, has only 32% of its national roads and 2% of its local roads fully paved. CNNs can be used to identify objects in surveillance footage across these varying environments, from the most developed urban areas to the most remote rural areas. They can also identify a wide array of objects. This is beneficial for monitoring East African road traffic, which tends to contain a wider variety of traffic elements – pedestrians, handcarts, livestock, bicycles, motorbikes, tuk-tuks, personal vehicles, vans, buses and trucks. 

Among the variety of CNN models available, residual networks (ResNets) and visual geometry groups (VGGs) stand out. VGGs utilise up to 19 convolutional networks. Width and height dimensions of input through each layer is systematically reduced, alongside an increase in the number of channels in each layer.   

ResNets mimic human cerebral cortex pyramid cell structures by deploying ‘shortcuts’ which skip some layers of the neural network.

Deep neural networks at times struggle to sustain activations and efficient parameters from early layers as the network progresses. ResNets and VGGs both address this issue, making them ideal CNN models for object identification. VGGs contain the optimal number of layers for error rate minimisation, while ResNets incorporate a skip connection or a ‘shortcut’ between every two layers along with using direct connections among all the layers, allowing for much deeper neural networks while still sustaining the integrity of prior layers. 

However, while highly useful, CNNs require a consistent power supply – to keep cameras active and to maintain the street lighting necessary to obtain useful footage – and internet access. These two prerequisites are not widely available in East Africa’s rural areas. 49% of households in Rwanda and 60% of households in Ethiopia do not have access to grid electricity.  

Even in urban areas, electricity access is often unreliable, especially in informal settlements, where crime tends to be more rampant. National power supply parastatals tend to struggle with maintaining full-time electricity supply to households, leading to frequent outages necessitating load shedding; at times, power supply cannot even support airports, hospitals, manufacturing industries, and other high-stakes operations. Burundi and Rwanda are particularly vulnerable, given that they produce less electricity than they consume.  

Internet access is also a challenge in East Africa, with only about 23% of the region having regular access to the internet. While companies like Mawingu, a rural internet provider in Kenya, are working to bridge this gap, it still stands that rural internet access in the region is highly unreliable, making CNNs impractical in most environments outside of major cities. 

CNNs also require high computational power and must be run on machines with expensive hardware. These high-cost apparatus - typically operating within a price radius of $4000 per PC - are impractical in low-income settings and are highly unlikely to be widely implemented given that Kenya and Uganda, among other East African nations, have not only made cuts to their national budgets but also significantly decreased spending on police operations and domestic security. 

Additionally, the use of CNNs would warrant the collection and storage of hyper-specific, highly localised data sets on road conditions, traffic patterns and vehicle behaviours to tailor unique solutions to the safety concerns on each road within the East African region. This in-depth data acquisition frequently raises concerns over data privacy in the region, and these concerns are only compounded by a history of malevolent data use by outside powers. Given that most infrastructure projects in East Africa are funded by foreign governments or corporations, many East Africans harbour fears of abuse of personal data like facial features and detailed knowledge of commute times and routes. The public’s fears are compounded by the region’s history of terrorist acts in public transport vehicles. This public apprehension is partly what led Uganda to suspend its nationwide surveillance initiative after an outcry over privacy and third-party access to data collected by road cameras. 

The Future of Road Safety Technology 

Despite its shortcomings, CNN technology has massive potential to improve road safety in East Africa. Computer vision could support real-time traffic monitoring that would make the smart city dream a reality. Traffic data generated by CNNs could be utilised by integrated operations centres to transform coordination, management, and governance. Measures like dimming streetlights while roads are empty, automating traffic lights to extend pedestrian crossing time allocations when intersections have more on-foot traffic, alerting drivers when they are approaching the site of a road accident, or blaring a warning sound to pedestrians when an unanticipated fast vehicle is approaching could all be features of smart cities where CNN models are active and exploited to their full potential.  

Growth in the prevalence of 5G connectivity would propel East Africa towards the reality of smart cities, as 5G networks allow for faster and more reliable internet connections that would facilitate real-time processing for CNN models. There exists the challenge of storing and accessing CNN data. Collating data in a centralised cloud system before re-distributing it for use would slow down the processing speed of computer vision networks. However, edge computing would allow road camera data to bypass the cloud and be processed as close as possible to the point of collection, reducing latency and hence expediting the analysis of road footage for road safety applications. 

Partnerships between local governments and NGOs are a pragmatic avenue to begin building smart cities in East Africa. Initialisation programmes could see low-cost computer vision equipment introduced at the county level and then be scaled up nationally. Collaboration between governments and tech startups is an alternate route, one which would draw in abundant starting capital from angel investors.  

Conclusion 

Road safety remains a pressing concern in East Africa, with current governmental strategies failing to minimise injuries and fatalities from road accidents. The unstandardised nature of East African road networks, coupled with the diverse array of vehicles, humans and livestock using the roads, presents a challenge to traditional surveillance and law enforcement methods. The use of computer vision AI models presents a solution to this challenge by allowing for road camera footage to be analysed to identify locations, causes and proponents of road accidents. CNNs in particular allow for real-time object recognition with impressively high accuracy. Government partnerships with NGOs and investors are a gateway towards the application of CNNs to road surveillance, which could see East Africa’s towns transform into smart cities with license plate detection for traffic offenders, alert systems for pedestrians and drivers, and traffic controlled according to congestion states, among other possibilities.

Previous
Previous

Wind Beneath East Africa’s Wings: Harnessing the Power of Nature for a Renewable Future

Next
Next

Crude Ambitions: The Financing Hurdles Facing East Africa’s Crude Oil Pipeline