Skip to content

AliRafiee7/SeConvNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SeConvNet

This repository contains the Python codes for the implementation of the paper "A deep convolutional neural network for salt-and-pepper noise removal using selective convolutional blocks."

Citation

Rafiee, A.A., Farhang, M. A deep convolutional neural network for salt-and-pepper noise removal using selective convolutional blocks. Applied Soft Computing (2023). https://doi.org/10.1016/j.asoc.2023.110535

Download citation as RIS
Download citation as BibTeX

DOI

https://doi.org/10.1016/j.asoc.2023.110535

Abstract

In recent years, there has been an unprecedented upsurge in applying deep learning approaches, specifically convolutional neural networks (CNNs), to solve image denoising problems, owing to their superior performance. However, CNNs mostly rely on Gaussian noise, and there is a conspicuous lack of exploiting CNNs for salt-and-pepper (SAP) noise reduction. In this paper, we proposed a deep CNN model, namely SeConvNet, to suppress SAP noise in gray-scale and color images. To meet this objective, we introduce a new selective convolutional (SeConv) block. SeConvNet is compared to state-of-the-art SAP denoising methods using extensive experiments on various common datasets. The results illustrate that the proposed SeConvNet model effectively restores images corrupted by SAP noise and surpasses all its counterparts at both quantitative criteria and visual effects, especially at high and very high noise densities.

MSCF Architecture

SeConvNet Architecture

Requirements

Python Python-3.8

TensorFlow TensorFlow-2.4.1

NumPy NumPy-1.19.2

OpenCV OpenCV-4.5.1

scikit-image scikit-image-0.19.2

Training

Use this command to train the SeConvNet. You can change options (arguments) to your desired ones.

$ python train.py --noise_density 0.95 --image_channels 1 --epoch 50 --batch_size 128 --lr 1e-3 --train_dir data/Train --steps 2000

Arguments

  • noise_density
    Noise density for salt-and-pepper noise. It should be in the interval [0, 1]. The default is 0.95.
  • image_channels
    Number of channels in noisy images. It is 1 for gray images and 3 for color images. The default is 1.
  • epoch
    Number of epochs in training. The default is 50.
  • batch_size
    Number of batches in training. The default is 1.
  • lr
    Initial learning for Adam optimizer. The default is 0.001.
  • train_dir
    Path of training data. The default is data/Train.
  • steps
    Number of steps per epoch in training. The default is 2000.

Testing

Use this command to test the SeConvNet. You can change options (arguments) to your desired ones.

$ python test.py --noise_density 0.95 --image_channels 1 --model_name model_050.hdf5 --test_dir data/Test --dataset BSD68 --result_dir results --save_result 0

Arguments

  • noise_density
    Noise density for salt-and-pepper noise. It should be in the interval [0, 1]. The default is 0.95.
  • image_channels
    Number of channels in noisy images. It is 1 for gray images and 3 for color images. The default is 1.
  • model_name
    Filename of the model's weights. The default is model_050.hdf5. You can use the trained weights which are available in the weights folder.
  • test_dir
    Path of test data containing test datasets. The default is data/Test.
  • dataset
    Name of test dataset. The default is BSD68.
  • result_dir
    Path of saving denoised images. The default is results.
  • save_result
    Whether to save denoised images or not. It is 0 for not saving and 1 for saving. The default is 0.