The Glasgow CCTV Object Detection project

The Glasgow CCTV Object Detection is a platform that provides half-hourly counts of persons, cyclists, and different types of vehicles, across several locations in Glasgow.

Most cities have an extensive network of CCTV cameras primarily focused on community safety or traffic control. However, most of the cameras are idle or used very infrequently. In association with the Glasgow City Council, this project uses the surplus capacity in the existing CCTV network to capture a regular snapshot, followed by an automatic count of the objects of interest in it.

Logging new data at regular intervals each day, this project aims to improve public understanding of mobility and traffic patterns across Glasgow.

The platform started collecting data in November 2019 with four CCTV cameras and six categories of objects. Since then, the number of cameras increased twentyfold and the categories of objects monitored almost duplicated in January 2023, thus providing a clearer and more thorough picture of the activity in the city.

This project stems from a desire to increase our ability to capture a wide range of information about different forms of mobility in cities, particularly walking and cycling, to support urban planners. The project was originally set up to monitor activity on Glasgow City Council's Avenues project but rapidly evolved to monitor activity levels during the COVID-19 pandemic and more recently, to provide data for the Gallant and Active Travel projects. Furthermore, data has also been provided to the MsC students of Big Data and Urban Analytics to study parking occupancy of vehicles in parking areas and, in a different project, to check the presence of illegally parked vehicles in Bus Stop areas.

The Urban Big Data Centre runs the Glasgow CCTV Object Detection project in partnership with the Glasgow City Council and the Glasgow Centre for Population Health. The Glasgow City Council is responsible for the capture of half-hourly images by all the cameras in the project whereas the Data Science Team at the Urban Big Data Centre is responsible for processing the objects of interest localized on the images and for making this data available to users through their CCTV API.

Aims and objectives

This project aims to develop methods to use CCTV images to produce regular statistics on activity levels in urban areas.

The project team will:

  • Develop object detection software to generate counts of pedestrians and vehicles from still images making use of CCTV systems
  • Use image counts to provide better understanding of how people use space
  • Develop an approach to implementation which does not require sensitive image data to leave the secure CCTV systems and does not interfere with general safety and protection operations
  • Apply the tools to monitor activity on streets and public spaces across Glasgow, producing open data on these
  • Work with city stakeholders to demonstrate the value of these data for a range of policy areas.

How is data collected with CCTV?

Contrary to most data systems, CCTV data is unstructured, that is, it is a large collection of images/videos from which we cannot directly use to perform analysis. We needed to find a way to retrieve the data of interest from the images and convert them to structured data (e.g. Excel file, database, etc.). This is where the magic happens: a computer vision algorithm is run on the images to detect the objects of interest. Afterwards, it encircles them with a bounding box, alongside a label to identify the category of object (e.g. person), and a confidence score (i.e. the confidence that the algorithm identified the object correctly). Finally, these bounding boxes are written into a database and a counting operation is performed every 30 minutes of the day, 7 days of the week to feed the CCTV API.

CCTV Data Collection in Glasgow – categories of objects

Presently there are two algorithms (also known as “object detection models” or simply “models”) collecting data: Tensorflow 2 and Yolo V4, the latter being trained in the UBDC premises. The table below resumes the objects detected by each algorithm.

Prior to September 2023, there is also data available from an older version of the Tensorflow 2 model (Tensorflow 1), which data is also available in the API through an API request.

CCTV Data Collection in Glasgow – access the data

The data is available in the CCTV API website by one of two ways:

  1. CSV download: Manually press the button on the website to download all data in csv format (only Yolo data is available through this way).
A close-up of a logoDescription automatically generated

  1. API request.

Ex.: https://glasgow-cctv.ubdc.ac.uk/api/yolo/records/?date_after=20230224&date_before=20230226


An alternative way to explore the Yolo data is by using the API Dashboard, thus having a first sense of the counts of the objects in different locations, over time.

A graph with different colored linesDescription automatically generated

Finally, the localisation of the objects on the images is also available upon request. The localisation of vehicles used for the MsC projects is an example of this specific type of data.

Files

No items found.

Latest news

IDEAMAPS network launches new platform

The IDEAMAPS Network launches its Data Ecosystem platform - a new digital mapping tool to support improvements in deprived areas in Low- and Middle-Income countries.

Learn More

UBDC team wins a top award at the ACM SIGSPATIAL conference

Researchers examined the 'Optimal Minimum Deployment of Electric Vehicle Charging Station Networks'.

Learn More

Indoor environment and energy use study

UBDC - in collaboration with Understanding Society, the UK Household Longitudinal Study - is launching a new study to provide linked-data on energy usage and indoor environment.

Learn More

Jointly funded by