Self-Supervised Methods for Noise-Removal

Related tags

Deep LearningSSMNR
Overview

SSMNR | Self-Supervised Methods for Noise Removal

Image denoising is the task of removing noise from an image, which can be formulated as the task of separating the noise signal from the meaningful information in images. Traditionally, this has been addressed both by spatial domain methods and transfer domain methods. However, from around 2016 onwards, image denoising techniques based on neural networks have started to outperfom these methods, with CNN-based denoisers obtaining impressive results.

One limitation to the use of neural-network based denoisers in many applications is the need for extensive, labeled datasets containing both noised images, and ground-truth, noiseless images. In answer to this, multiple works have explored the use of semi-supervised approaches for noise removal, requiring either noised image pairs but no clean target images (Noise2Noise) or, more recently, no additional data than the noised image (Noise2Void). This project aims at studying these approaches for the task of noise removal, and re-implementing them in PyTorch.

This repository contains our code for this task. This code is heavily based on both the original implementation of the Noise2Void article available here, on other implementations and PyTorch/TensorFlow reproducibility challenges here and here, on the U-NET Transformer architecture available here, as well as some base code from our teachers for a project on bird species recognition.

Data

Data used to train and evaluate the algorithm consists mostly in:

No noiseless data was used to train the models.

Usage

To reproduce these results, please start by cloning the repository locally:

git clone https://github.com/bglbrt/SSMNR.git

Then, install the required libraries:

pip install -r requirements.txt

Denoising images (with provided, pre-trained weights)

To denoise an image or multiple images from a specified directory, run:

python main.py --mode denoise --model "model" --images_path "path/to/image/or/dir" --weights "path/to/model/weights"

Provided pre-trained weights are formatted as: "models/model_"+model_name+_+noise_type+sigma+".pth".

Available weights are:

  • weights for the N2V model:
    • models/model_N2V_G5.pth
    • models/model_N2V_G10.pth
    • models/model_N2V_G15.pth
    • models/model_N2V_G25.pth
    • models/model_N2V_G35.pth
    • models/model_N2V_G50.pth
  • weights for the N2VT (N2V with U-NET Transformer) model:
    • models/model_N2V_G5.pth (please contact us to obtain weights)
    • models/model_N2V_G10.pth (please contact us to obtain weights)
    • models/model_N2V_G25.pth (please contact us to obtain weights)

Options available for denoising are:

  • --mode: Training (train), denoising (denoise) or evaluation (eval) mode
    • default: train
  • --images_path: Path to image or directory of images to denoise.
    • default: None
  • --model: Name of model for noise removal
    • default: N2V
  • --n_channels: Number of channels in images - i.e. RGB or Grayscale images
    • default: 3
  • --weights: Path to weights to use for denoising, evaluation, or fine-tuning when training.
    • default: None
  • --slide: Sliding window size for denoising and evaluation
    • default: 32
  • --use_cuda: Use of GPU or CPU
    • default: 32

Evaluation

To evaluate a model using a dataset in a specified directory, run:

python main.py --mode eval --model "model" --images_path "path/to/image/or/dir" --weights "path/to/model/weights"

Note that the data located at path/to/image/or/dir must include a folder named original with noiseless images.

Evaluation methods include:

  • N2V (Noise2Void with trained weights)
  • N2VT (Noise2VoidTransformer with trained weights)
  • BM3D (Block-Matching and 3D Filtering)
  • MEAN (5x5 mean filter)
  • MEDIAN (5x5 median filter)

Provided pre-trained weights for N2V and N2VT are formatted as: "models/model_"+model_name+_+noise_type+sigma+".pth".

Available weights are:

  • weights for the N2V model:
    • models/model_N2V_G5.pth
    • models/model_N2V_G10.pth
    • models/model_N2V_G15.pth
    • models/model_N2V_G25.pth
    • models/model_N2V_G35.pth
    • models/model_N2V_G50.pth
  • weights for the N2VT (N2V with U-NET Transformer) model:
    • models/model_N2V_G5.pth
    • models/model_N2V_G10.pth
    • models/model_N2V_G25.pth

Options available for evaluation are:

  • --mode: Training (train), denoising (denoise) or evaluation (eval) mode
    • default: train
  • --images_path: Path to image or directory of images to evaluate.
    • default: None
  • --model: Name of model for noise removal
    • default: N2V
  • --n_channels: Number of channels in images - i.e. RGB or Grayscale images
    • default: 3
  • --weights: Path to weights to use for denoising, evaluation, or fine-tuning when training.
    • default: None
  • --slide: Sliding window size for denoising and evaluation
    • default: 32
  • --use_cuda: Use of GPU or CPU
    • default: 32

Training

To train weights for the N2V and N2VT models using data located in the data folder, run:

python main.py data "data" --model "N2V" --mode train"

Note that the data folder must contain two folders named train and validation.

Options available for training are:

  • --data: Folder where training and testing data is located.
    • default: data
  • --mode: Training (train), denoising (denoise) or evaluation (eval) mode
    • default: train
  • --model: Name of model for noise removal.
    • default: N2V
  • --n_channels: Number of channels in images - i.e. RGB or Grayscale images
    • default: 3
  • --input_size: Model patches input size
    • default: 64
  • --masking_method: Blind-spot masking method
    • default: UPS
  • --window: Window for blind-spot masking method in UPS
    • default: 5
  • --n_feat: Number of feature maps of the first convolutional layer
    • default: 96
  • --noise_type: Noise type from Gaussian (G), Poisson (P) and Impulse (I)
    • default: G
  • --ratio: Ratio for number of blind-spot pixels in patch
    • default: 1/64
  • --from_pretrained: Train model from pre-trained weights
    • default: False
  • --weights: Path to weights to use for denoising, evaluation, or fine-tuning when training
    • default: None
  • --weights_init_method: Weights initialization method
    • default: kaiming
  • --loss: Loss function for training
    • default: L2
  • --batch_size: Batch size for training data
    • default: 64
  • --epochs: Number of epochs to train the model.
    • default: 300
  • --steps_per_epoch: Number of steps per epoch for training
    • default: 100
  • --sigma: Noise parameter for creating labels - depends on distribution
    • default: 25
  • --lr: Learning rate
    • default: 4e-4
  • --wd: Weight decay for RAdam optimiser
    • default: 1e-4
  • --use_cuda: Use of GPU or CPU
    • default: 32
  • --seed: Random seed
    • default: 1

Required libraries

The files present on this repository require the following libraries (also listed in requirements.txt):

I will implement Fastai in each projects present in this repository.

DEEP LEARNING FOR CODERS WITH FASTAI AND PYTORCH The repository contains a list of the projects which I have worked on while reading the book Deep Lea

Thinam Tamang 43 Dec 20, 2022
Official implementation of the ICCV 2021 paper: "The Power of Points for Modeling Humans in Clothing".

The Power of Points for Modeling Humans in Clothing (ICCV 2021) This repository contains the official PyTorch implementation of the ICCV 2021 paper: T

Qianli Ma 158 Nov 24, 2022
FlingBot: The Unreasonable Effectiveness of Dynamic Manipulations for Cloth Unfolding

This repository contains code for training and evaluating FlingBot in both simulation and real-world settings on a dual-UR5 robot arm setup for Ubuntu 18.04

Columbia Artificial Intelligence and Robotics Lab 70 Dec 06, 2022
Alternatives to Deep Neural Networks for Function Approximations in Finance

Alternatives to Deep Neural Networks for Function Approximations in Finance Code companion repo Overview This is a repository of Python code to go wit

15 Dec 17, 2022
Synthetic structured data generators

Join us on What is Synthetic Data? Synthetic data is artificially generated data that is not collected from real world events. It replicates the stati

YData 850 Jan 07, 2023
paper list in the area of reinforcenment learning for recommendation systems

paper list in the area of reinforcenment learning for recommendation systems

HenryZhao 23 Jun 09, 2022
Source codes of CenterTrack++ in 2021 ICME Workshop on Big Surveillance Data Processing and Analysis

MOT Tracked object bounding box association (CenterTrack++) New association method based on CenterTrack. Two new branches (Tracked Size and IOU) are a

36 Oct 04, 2022
Any-to-any voice conversion using synthetic specific-speaker speeches as intermedium features

MediumVC MediumVC is an utterance-level method towards any-to-any VC. Before that, we propose SingleVC to perform A2O tasks(Xi → Ŷi) , Xi means utter

谷下雨 47 Dec 25, 2022
In the AI for TSP competition we try to solve optimization problems using machine learning.

AI for TSP Competition Goal In the AI for TSP competition we try to solve optimization problems using machine learning. The competition will be hosted

Paulo da Costa 11 Nov 27, 2022
Pytorch implementation of One-Shot Affordance Detection

One-shot Affordance Detection PyTorch implementation of our one-shot affordance detection models. This repository contains PyTorch evaluation code, tr

46 Dec 12, 2022
Large-scale language modeling tutorials with PyTorch

Large-scale language modeling tutorials with PyTorch 안녕하세요. 저는 TUNiB에서 머신러닝 엔지니어로 근무 중인 고현웅입니다. 이 자료는 대규모 언어모델 개발에 필요한 여러가지 기술들을 소개드리기 위해 마련하였으며 기본적으로

TUNiB 172 Dec 29, 2022
Diverse Branch Block: Building a Convolution as an Inception-like Unit

Diverse Branch Block: Building a Convolution as an Inception-like Unit (PyTorch) (CVPR-2021) DBB is a powerful ConvNet building block to replace regul

253 Dec 24, 2022
CAR-API: Cityscapes Attributes Recognition API

CAR-API: Cityscapes Attributes Recognition API This is the official api to download and fetch attributes annotations for Cityscapes Dataset. Content I

Kareem Metwaly 5 Dec 22, 2022
ContourletNet: A Generalized Rain Removal Architecture Using Multi-Direction Hierarchical Representation

ContourletNet: A Generalized Rain Removal Architecture Using Multi-Direction Hierarchical Representation (Accepted by BMVC'21) Abstract: Images acquir

10 Dec 08, 2022
Python Wrapper for Embree

pyembree Python Wrapper for Embree Installation You can install pyembree (and embree) via the conda-forge package. $ conda install -c conda-forge pyem

Anthony Scopatz 67 Dec 24, 2022
Official code for "Focal Self-attention for Local-Global Interactions in Vision Transformers"

Focal Transformer This is the official implementation of our Focal Transformer -- "Focal Self-attention for Local-Global Interactions in Vision Transf

Microsoft 486 Dec 20, 2022
Official repository of the paper Learning to Regress 3D Face Shape and Expression from an Image without 3D Supervision

Official repository of the paper Learning to Regress 3D Face Shape and Expression from an Image without 3D Supervision

Soubhik Sanyal 689 Dec 25, 2022
MiraiML: asynchronous, autonomous and continuous Machine Learning in Python

MiraiML Mirai: future in japanese. MiraiML is an asynchronous engine for continuous & autonomous machine learning, built for real-time usage. Usage In

Arthur Paulino 25 Jul 27, 2022
Adversarial Adaptation with Distillation for BERT Unsupervised Domain Adaptation

Knowledge Distillation for BERT Unsupervised Domain Adaptation Official PyTorch implementation | Paper Abstract A pre-trained language model, BERT, ha

Minho Ryu 29 Nov 30, 2022