Coder Social home page Coder Social logo

gabrielmittag / bias-aware-loss Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 20.87 MB

Bias-Aware Loss for Training Image and Speech Quality Prediction Models from Multiple Dataset

License: MIT License

Python 100.00%
bias-loss speech-quality image-quality-assessment image-quality pytorch qoe quality-of-experience machine-learning

bias-aware-loss's Introduction

Bias-Aware Loss for Training Image and Speech Quality Prediction Models from Multiple Dataset

This repository is the official implementation of following paper:
Gabriel Mittag, Saman Zadtootaghaj, Thilo Michael, Babak Naderi, Sebastian Möller. "Bias-Aware Loss for Training Image and Speech Quality Prediction Models from Multiple Datasets," arXiv:2104.10217 [eess.AS], 2021. (accepted at QoMEX 2021)

Requirements

To install requirements install Anaconda and then use:

conda env create -f environment.yml

This will create a new enviroment with the name "biasloss". Activate this enviroment to go on:

conda activate biasloss

The reference images to run the synthetic experiments are included in this repo. To run the experiment with the real image quality datasets, the datasets need to be downloaded manually into a folder with following subfolders:

CSIQ: http://vision.eng.shizuoka.ac.jp/mod/page/view.php?id=23
LIVE Challenge: https://live.ece.utexas.edu/research/ChallengeDB/index.html
LIVE IQA R2: https://live.ece.utexas.edu/research/quality/subjective.htm
LIVE MD: https://live.ece.utexas.edu/research/Quality/live_multidistortedimage.html
TID 2013: http://www.ponomarenko.info/tid2013.htm

Note however, that this is not needed to run the basic synthetic experiment.

Experiment 1: Synthetic Image Quality Data

(In the paper this experiment is conducted on synthetic speech samples, instead of images) To train and evaluate the first experiment on synthetic data in the paper, run this command:

python train_image_quality_synthetic.py

The script will plot a number of diagrams and images that can be turned off at the start of the script. For example, to turn off plotting of the results after every training epoch set "plot_every_epoch=False". Basic training options, such as learning rate, can be set in the "opts" dictionary.

The different settings, which were analysed in the paper, can also be set there:

  • bias_fun: The polynomial function that is used to model the biases. Use either "first_order" or "third_order".
  • r_th: The minimum Pearson's correlation between the predicted MOS and subjective MOS of the training dataset that needs to be achieved before the first estimation of the biases is done. Before this threshold, a vanilla MSE loss is used.
  • anchor_db: Name of the dataset to which the MOS predictions are anchored to.
  • mse_weight: Weight of the MSE vanilla loss that is added to the bias loss, in order to anchor the predictions.

To run the experiment without bias-aware loss set "r_th=1", in this case the biases are never updated. The blurriness sigma and the image filenames are already stored in the csv files (e.g. iqb_train.csv).

After (and during) the training, the results of each epoch are saved in a csv file in the "results" subfolder. The csv also contains the training options that were used. In the paper, for each training setting, the training was run several times. The best epoch of each training run was then used (i.e. the column of the csv with the highest "r" value).

Experiment 2: Real Image Quality Data

To train and evaluate the first experiment on synthetic data in the paper, run this command:

python train_image_quality_datasets.py

This script is similar to the first one. However, the Dataset class used is different, since it does not apply synthetic blurriness to the images. The path to the dataset folder, with the manually downloaded datasets, has to be set within the script, for example:

dataset_folder = 'D:/image_quality_datasets/'

The transformed MOS values and the filenames are already stored in "image_datasets.csv". The selection of training and validation sets are made with two lists ("train_dbs", "val_dbs") that contain the dataset names.

bias-aware-loss's People

Contributors

gabrielmittag avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

qulab runngezhang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.