All Projects → lidq92 → LinearityIQA

lidq92 / LinearityIQA

Licence: other
[official] Norm-in-Norm Loss with Faster Convergence and Better Performance for Image Quality Assessment (ACM MM 2020)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to LinearityIQA

code-review-estimator
Estimate cost of code review using Machine Learning
Stars: ✭ 49 (-32.88%)
Mutual labels:  regression
ugtm
ugtm: a Python package for Generative Topographic Mapping
Stars: ✭ 34 (-53.42%)
Mutual labels:  regression
hierarchical-categories-loss-tensorflow
A loss function for categories with a hierarchical structure.
Stars: ✭ 26 (-64.38%)
Mutual labels:  loss-functions
pycsou
Pycsou is a Python 3 package for solving linear inverse problems with state-of-the-art proximal algorithms. The software implements in a highly modular way the main building blocks -cost functionals, penalty terms and linear operators- of generic penalised convex optimisation problems.
Stars: ✭ 37 (-49.32%)
Mutual labels:  loss-functions
regression-stock-prediction
Predicting Google’s stock price using regression
Stars: ✭ 54 (-26.03%)
Mutual labels:  regression
XCloud
Official Code for Paper <XCloud: Design and Implementation of AI Cloud Platform with RESTful API Service> (arXiv1912.10344)
Stars: ✭ 58 (-20.55%)
Mutual labels:  image-quality-assessment
stylegan-encoder
StyleGAN Encoder - converts real images to latent space
Stars: ✭ 694 (+850.68%)
Mutual labels:  loss-functions
R4Econ
R Code Examples Multi-dimensional/Panel Data
Stars: ✭ 16 (-78.08%)
Mutual labels:  regression
Machine-Learning-Specialization
Project work and Assignments for Machine learning specialization course on Coursera by University of washington
Stars: ✭ 27 (-63.01%)
Mutual labels:  regression
piven
Official implementation of the paper "PIVEN: A Deep Neural Network for Prediction Intervals with Specific Value Prediction" by Eli Simhayev, Gilad Katz and Lior Rokach
Stars: ✭ 26 (-64.38%)
Mutual labels:  regression
R-Machine-Learning
D-Lab's 6 hour introduction to machine learning in R. Learn the fundamentals of machine learning, regression, and classification, using tidymodels in R.
Stars: ✭ 27 (-63.01%)
Mutual labels:  regression
brglm2
Estimation and inference from generalized linear models using explicit and implicit methods for bias reduction
Stars: ✭ 18 (-75.34%)
Mutual labels:  regression
BAS
BAS R package https://merliseclyde.github.io/BAS/
Stars: ✭ 36 (-50.68%)
Mutual labels:  regression
3D-face-reconstruction
3D Face Reconstruction from a Single Image using Direct Volumetric CNN Regression.
Stars: ✭ 28 (-61.64%)
Mutual labels:  regression
NCE-loss
Tensorflow NCE loss in Keras
Stars: ✭ 30 (-58.9%)
Mutual labels:  loss-functions
WaDIQaM
[unofficial] Pytorch implementation of WaDIQaM in TIP2018, Bosse S. et al. (Deep neural networks for no-reference and full-reference image quality assessment)
Stars: ✭ 119 (+63.01%)
Mutual labels:  image-quality-assessment
machine learning from scratch matlab python
Vectorized Machine Learning in Python 🐍 From Scratch
Stars: ✭ 28 (-61.64%)
Mutual labels:  regression
Universal Head 3DMM
This is a Project Page of 'Towards a complete 3D morphable model of the human head'
Stars: ✭ 138 (+89.04%)
Mutual labels:  regression
RADN
[CVPRW 2021] Codes for Region-Adaptive Deformable Network for Image Quality Assessment
Stars: ✭ 49 (-32.88%)
Mutual labels:  image-quality-assessment
onelearn
Online machine learning methods
Stars: ✭ 14 (-80.82%)
Mutual labels:  regression

Norm-in-Norm Loss with Faster Convergence and Better Performance for Image Quality Assessment

License

Description

LinearityIQA code for the following paper:

Norm-in-Norm Loss Framework

How to?

Install Requirements

conda create -n reproducibleresearch pip python=3.6
source activate reproducibleresearch
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple > install_0.log
git clone https://github.com/NVIDIA/apex.git
cd apex
# source switch_cuda.sh 10.2 # [optional] if your cuda version for torch is 10.2
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ > install.log 
cd ..
rm -rf apex
# source deactive

Note: Please install apex from the source. I installed the apex from the source (by following the README.md), and pip freeze > requirements.txt shows that apex version I used is 0.1. Make sure that the CUDA version is consistent. If you have any installation problems, please find the details of error information in *.log file, e.g., if the cuda versions are not consistent between apex and torch, one can use switch-cuda.sh to solve it.

Download Datasets

Download the KonIQ-10k and CLIVE datasets. Here is an alternative link with password 9pwl. Then, run the following ln commands in the root of the repo.

cat your_downloaded_path/KonIQ-10k.tar.gz* | tar -xzf - # your_downloaded_path is your path to the downloaded files for KonIQ-10k dataset
upzip your_downloaded_path/CLIVE(IQA).zip # your_downloaded_path is your path to the downloaded files for CLIVE dataset
ln -s koniq10k/images/ KonIQ-10k 
ln -s ChallengeDB_release/Images/ CLIVE 

Training on KonIQ-10k

CUDA_VISIBLE_DEVICES=0 python main.py --dataset KonIQ-10k --resize --exp_id 0 -lr 1e-4 -bs 8 -e 30 --ft_lr_ratio 0.1 -arch resnext101_32x8d --loss_type norm-in-norm --p 1 --q 2 > exp_id=0-resnext101_32x8d-p=1-q=2-664x498.log 2>&1 & # The saved checkpoint is copied and renamed as "p1q2.pth". 
CUDA_VISIBLE_DEVICES=1 python main.py --dataset KonIQ-10k --resize --exp_id 0 -lr 1e-4 -bs 8 -e 30 --ft_lr_ratio 0.1 -arch resnext101_32x8d --loss_type norm-in-norm --p 1 --q 2 --alpha 1 0.1 > exp_id=0-resnext101_32x8d-p=1-q=2-alpha=1,0.1-664x498.log 2>&1 & # The saved checkpoint is copied and renamed as "p1q2plus0.1variant.pth"

More options can be seen by running the help command python main.py --help.

Visualization

tensorboard --logdir=runs --port=6006 # --host your_host_ip; in the server (host:port)
ssh -p port -L 6006:localhost:6006 user@host # in your PC. See the visualization in your PC

You can download our checkpoints with a password 4z7z (Alternative way: see LinearityIQA/issues/10). Then paste it to checkpoints/.

Note: We do not set drop_last=True where we obtained our results in the paper. However, if the the size of training data % batch size == 1, the last batch only contains 1 sample, one needs to set drop_last=True when prepare the train_loader in line 86-90 of IQAdataset.py. For example, if 80% images of CLIVE are considered as the training data, and the batch size is 8, then based on 929 % 8 == 1, you will have to set drop_last=True. Otherwise, you will get an error in 1D batch norm layer.

Testing

Testing on KonIQ-10k test set (Intra Dataset Evaluation)

CUDA_VISIBLE_DEVICES=0 python test_dataset.py --dataset KonIQ-10k --resize -arch resnext101_32x8d --trained_model_file checkpoints/p1q2.pth
CUDA_VISIBLE_DEVICES=1 python test_dataset.py --dataset KonIQ-10k --resize -arch resnext101_32x8d --trained_model_file checkpoints/p1q2plus0.1variant.pth

Testing on CLIVE (Cross Dataset Evaluation)

CUDA_VISIBLE_DEVICES=0 python test_dataset.py --dataset CLIVE --resize -arch resnext101_32x8d --trained_model_file checkpoints/p1q2.pth
CUDA_VISIBLE_DEVICES=1 python test_dataset.py --dataset CLIVE --resize -arch resnext101_32x8d --trained_model_file checkpoints/p1q2plus0.1variant.pth

Test Demo

CUDA_VISIBLE_DEVICES=0 python test_demo.py --img_path data/1000.JPG --resize -arch resnext101_32x8d --trained_model_file checkpoints/p1q2.pth
# > The image quality score is 10.430044178601875
CUDA_VISIBLE_DEVICES=1 python test_demo.py --img_path data/1000.JPG --resize -arch resnext101_32x8d --trained_model_file checkpoints/p1q2plus0.1variant.pth
# > The image quality score is 16.726127839961094

Remark

If one wants to use the "Norm-in-Norm" loss in his project, he can refer to the norm_loss_with_normalization in IQAloss.py.

If one wants to use the model in his project, he can refer to the IQAmodel.py.

Contact

Dingquan Li, dingquanli AT pku DOT edu DOT cn.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].