Monitoring vehicle pollution and fuel consumption based on AI camera system and gas emission estimator model
- Manuel Rodriguez Valido
- Oscar Gomez-Cardenes
- Eduardo Magdaleno
emails: {mrvalido,ogomezca,emagcas}@ull.edu.es
affiliation: Department of Industrial Engineering, University of La Laguna, San Cristóbal de La Laguna, Spain
If using this work, please cite us.
Rodriguez Valido, M.; Gomez-Cardenes, O.; Magdaleno, E. Monitoring Vehicle Pollution and Fuel Consumption Based on AI Camera System and Gas Emission Estimator Model. Sensors 2023, 23, 312. https://doi.org/10.3390/s23010312
This code accompanies the paper "Monitoring vehicle pollution and fuel consumption based on AI camera system and gas emission estimator model".
Link to the paper: https://www.mdpi.com/2035034
The software can be represented with the following diagram:
yolov5
in its nano variant is used to localize and classify the vehicles in each frame. Weights and architecture are available through the torch hub
By using -at least- 4 characterized points of the road plane, screen coordinates can be transformed into world coordinates by using a homography matrix:
All the screen coordinates of the vehicles detected by the Localization module are transformed into world coordinates.
An algorithm that takes into account the position and time of the detected vehicles is used to group them into single trajectories:
Once the trajectories of each vehicle are detected, their speed can be calculated, since we now have a set of positions and their relative time for each detected vehicle.
We use the MOVESTAR estimation model, taken from github. The code has only minor modifications to speed up loading times of the csv data. For each detected vehicle we input its speed and vehicle class into the estimator.
In order to run this project, you'll need some data. Currently, the code is fit to run sessions from the BrnoCompSpeed dataset, which is available for research upon request. If using another dataset format, minor modifications must be done to the code.
The inputs needed to feed this system are:
- A traffic camera video recording
- Data that characterizes the geometry of the road
In your python environment, install all the dependencies by running:
pip install -r requirements.txt
python main.py <path to your data directory>
or
python main.py <path to your data directory> -i
for an interactive execution.
See license file
The authors would like to give special thanks to the authors of the BrnoCompSpeed dataset and in particular to Jakub Špaňhel for making it available for the development of this work.