A research project that explores the relationships between deprivation and litter in Glasgow City.
- Identify the relationships between the key indicators of deprivation in areas of Glasgow City and the amount of litter on its streets.
- Discover if an automated approach to counting litter on a city scale could be achieved using deep learning object detection methods.
The project's data sources can be found in the data
directory and are described in DATA.md.
A companion web application is included that allows users to interactively explore the litter objects detected throughout the city.
More information can be found in APP.md.
The notebooks in the models/yolov5
directory are used to develop YOLOv5s object detection models for the purposes of litter detection.
Similarly, the notebooks in the models/detectron2
directory are used to train Faster R-CNN models with the same objective.
The notebook in the regression
directory applies count data regression models such as Poisson and Negative Binomial to the extended SIMD data set described in DATA.md.
This repository contains two submodules as dependencies. Use the following command to clone this repository and the submodules it references:
# If you're cloning for the first time.
git clone --recurse-submodules https://github.com/Garee/glasgow-litter.git
# If you have already cloned the repository.
git submodule update --init --recursive
- Python 3.9.6
- CUDA Toolkit 11.3
- PyTorch 1.11.0 for YOLOv5 models
- Detectron2 for Faster R-CNN models
# Create the virtual environment
python -m venv venv
# Activate the virtual environment
source venv/Scripts/activate # source venv/bin/activate # linux/macOS
# Install dependencies
pip install -r requirements.txt
# If you want to use yolov5
pip install -r models/yolov5/yolov5/requirements.txt
Open the object detection and regression notebooks in Visual Studio Code or JupyterLab.
There are utility scripts within the scripts
directory that can be used for data collection and preparation.
More information can be found in the header comment of each script.
The source code for the report can be found in the report
directory.
Image annotations were added using Label Studio.
Image augmentations were applied using Roboflow.
Icons sourced from iconmonstr.