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:
- CSV download: Manually press the button on the website to download all data in csv format (only Yolo data is available through this way).

- 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.

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
Latest news

Brainstorming Data Dive promotes innovative social research
Researchers gathered in Glasgow for an innovative Data Dive, organised by the Urban Big Data Centre in collaboration with ESRC Smart Data Research UK. The aim of the event was to provide researchers with first-hand experience using smart data curated by UBDC and brainstorm new approaches and analyses.

Introducing the Adzuna teaching dataset
UBDC are excited to announce the launch of ‘Adzuna Teaching’, a small and random subset of our main Adzuna dataset. Adzuna Teaching makes Adzuna accessible to a wider audience, specifically students undertaking research projects and lecturers interested in employment or Smart Data. It will also be of interest to researchers thinking of applying for the full Adzuna dataset. Adzuna Teaching preserves the structure, and contains all variables, of our main Adzuna dataset. It therefore includes detailed information on salary, occupation, sector, seniority, skills, location, and job descriptions. See our Adzuna metadata for all variables included. The dataset represents a random 20,000 subsample of all (deduplicated) UK adverts posted on Adzuna.co.uk in the month of September 2021.

UofG social scientists receive UKRI funding for data-driven research
UofG social scientists have received UKRI funding that will enable them to conduct data-driven research aimed at improving lives across Scotland and the UK
Jointly funded by
%20copy.png)
.png)

