Skip to content

tum-esm/inventory-embeddings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project

This repository provides the code accompanying the thesis, "Learning Compressed Representations of Emission Inventories in Urban Environments."

Table of Contents

Method

A variational autoencoder (VAE) is trained to generate urban emission flux fields. The dataset is derived from the TNO-GHGco-v1.1 (2015) and TNO-GHGco-v4 (2018) high resolution inventories by extracting individual cities with a population size of greater than 100,000 citizens.

This generator is then used to generate solutions to an inverse problem using a latent space optimization based on stochastic gradient descent.

image

The inverse problem is the following:

Based on measurements and the atmospheric transport of molecules, derive a emission flux field that best represents these measurements.

Architecture of the VAE:

image Encoder of the VAE

image Decoder of the VAE (Generator Function G)

Results

The following section shows a reconstruction example for Munich emission fluxes. 50 Measurements are taken at 13 sensor locations with a signal to noise (SNR) ratio of 20dB. The atmospheric transport is simulated using a Gaussian plume simulation (advection diffusion equation).

Target

The emission flux field of Munich from 2018 looks as follows:

drawing

Reconstructions

Image 1

VAE (Fine-tuned)

Image 2

VAE

Image 3

Sparse Reconstruction (DCT)

Image 4

Regularized Least Squares

Installation

Dependencies

poetry install

Data

A guide on the required datasets and how to get them will be added in the future. This includes the VAE models weights.

Usage

Note:
The poetry run prefix is not required if the virtual environment is already activated using poetry shell.

Preprocessing of TNO Data (Creation of Dataset)

poetry run preprocess-tno [-h] [-gw W] [-gh H] [-p N] [-v]

Training of VAE

poetry run train-vae [-h] [-e N] [-d N] [-v p] [-t p] [-wandb]

Fine-tuning of VAE

poetry run finetune-vae [-h] [-e N] -c C -b M

Jupyter

There are some Jupyter notebooks, especially for plotting and visualizations. These need to be run either in Jupyter Notebook or Jupyter Lab if the IDE does not support Jupyter notebooks. They can be started as follows:

Jupyter Notebook

poetry run jupyter-notebook

Jupyter Lab

poetry run jupyter-lab

Scripts

There are some scripts in this repository. Notably, in src/experiments, some experiments are located. A script with name <script> can be run as follows:

poetry run python src/experiments/<script> <args>

Development

Installation of pre-commit hooks

poetry run pre-commit install