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):

Code for "Unsupervised Source Separation via Bayesian inference in the latent domain"

LQVAE-separation Code for "Unsupervised Source Separation via Bayesian inference in the latent domain" Paper Samples GT Compressed Separated Drums GT

Michele Mancusi 30 Oct 25, 2022
Lightweight tool to perform MITM attack on local network

ARPSpy - A lightweight tool to perform MITM attack Using many library to perform ARP Spoof and auto-sniffing HTTP packet containing credential. (Never

MinhItachi 8 Aug 28, 2022
A PyTorch implementation of the Relational Graph Convolutional Network (RGCN).

Torch-RGCN Torch-RGCN is a PyTorch implementation of the RGCN, originally proposed by Schlichtkrull et al. in Modeling Relational Data with Graph Conv

Thiviyan Singam 66 Nov 30, 2022
Indices Matter: Learning to Index for Deep Image Matting

IndexNet Matting This repository includes the official implementation of IndexNet Matting for deep image matting, presented in our paper: Indices Matt

Hao Lu 357 Nov 26, 2022
Compute execution plan: A DAG representation of work that you want to get done. Individual nodes of the DAG could be simple python or shell tasks or complex deeply nested parallel branches or embedded DAGs themselves.

Hello from magnus Magnus provides four capabilities for data teams: Compute execution plan: A DAG representation of work that you want to get done. In

12 Feb 08, 2022
Securetar - A streaming wrapper around python tarfile and allow secure handling files and support encryption

Secure Tar Secure Tarfile library It's a streaming wrapper around python tarfile

Pascal Vizeli 2 Dec 09, 2022
DNA sequence classification by Deep Neural Network

DNA sequence classification by Deep Neural Network: Project Overview worked on the DNA sequence classification problem where the input is the DNA sequ

Mohammed Jawwadul Islam Fida 0 Aug 02, 2022
Discovering Dynamic Salient Regions with Spatio-Temporal Graph Neural Networks

Discovering Dynamic Salient Regions with Spatio-Temporal Graph Neural Networks This is the official code for DyReg model inroduced in Discovering Dyna

Bitdefender Machine Learning 11 Nov 08, 2022
Fader Networks: Manipulating Images by Sliding Attributes - NIPS 2017

FaderNetworks PyTorch implementation of Fader Networks (NIPS 2017). Fader Networks can generate different realistic versions of images by modifying at

Facebook Research 753 Dec 23, 2022
Implementation of Auto-Conditioned Recurrent Networks for Extended Complex Human Motion Synthesis

acLSTM_motion This folder contains an implementation of acRNN for the CMU motion database written in Pytorch. See the following links for more backgro

Yi_Zhou 61 Sep 07, 2022
The repository offers the official implementation of our paper in PyTorch.

Cloth Interactive Transformer (CIT) Cloth Interactive Transformer for Virtual Try-On Bin Ren1, Hao Tang1, Fanyang Meng2, Runwei Ding3, Ling Shao4, Phi

Bingoren 49 Dec 01, 2022
✔️ Visual, reactive testing library for Julia. Time machine included.

PlutoTest.jl (alpha release) Visual, reactive testing library for Julia A macro @test that you can use to verify your code's correctness. But instead

Pluto 68 Dec 20, 2022
RCT-ART is an NLP pipeline built with spaCy for converting clinical trial result sentences into tables through jointly extracting intervention, outcome and outcome measure entities and their relations.

Randomised controlled trial abstract result tabulator RCT-ART is an NLP pipeline built with spaCy for converting clinical trial result sentences into

2 Sep 16, 2022
image scene graph generation benchmark

Scene Graph Benchmark in PyTorch 1.7 This project is based on maskrcnn-benchmark Highlights Upgrad to pytorch 1.7 Multi-GPU training and inference Bat

Microsoft 303 Dec 27, 2022
A library built upon PyTorch for building embeddings on discrete event sequences using self-supervision

pytorch-lifestream a library built upon PyTorch for building embeddings on discrete event sequences using self-supervision. It can process terabyte-si

Dmitri Babaev 103 Dec 17, 2022
This project is the PyTorch implementation of our CVPR 2022 paper:

Requirements and Dependency Install PyTorch with CUDA (for GPU). (Experiments are validated on python 3.8.11 and pytorch 1.7.0) (For visualization if

Lei Huang 23 Nov 29, 2022
Repository for MeshTalk supplemental material and code once the (already approved) 16 GHS captures our lab will make publicly available are released.

meshtalk This repository contains code to run MeshTalk for face animation from audio. If you use MeshTalk, please cite @inproceedings{richard2021mesht

Meta Research 221 Jan 06, 2023
🚀 PyTorch Implementation of "Progressive Distillation for Fast Sampling of Diffusion Models(v-diffusion)"

PyTorch Implementation of "Progressive Distillation for Fast Sampling of Diffusion Models(v-diffusion)" Unofficial PyTorch Implementation of Progressi

Vitaliy Hramchenko 58 Dec 19, 2022
This repo is a C++ version of yolov5_deepsort_tensorrt. Packing all C++ programs into .so files, using Python script to call C++ programs further.

yolov5_deepsort_tensorrt_cpp Introduction This repo is a C++ version of yolov5_deepsort_tensorrt. And packing all C++ programs into .so files, using P

41 Dec 27, 2022
Pre-trained models for a Cascaded-FCN in caffe and tensorflow that segments

Cascaded-FCN This repository contains the pre-trained models for a Cascaded-FCN in caffe and tensorflow that segments the liver and its lesions out of

300 Nov 22, 2022