noise2noise | 实验总结


非常好的一篇论文讲解


官方实现
非官方实现
我这里跑的代码是 非官方实现


cuda9.1 GTX 1080 11G


环境搭建(Cuda9.1):


conda create -n n2n366 python=3.6.6

source activate n2n366

tensorflow -GPU的 安装 要使用 共享的编译好的  tensorflow-1.10.1-cp36-cp36m-linux_x86_64.whl

使用 pip install tensorflow-1.10.1-cp36-cp36m-linux_x86_64.whl 来进行安装,安装之后 pip list 查看 显示:
tensorflow         1.10.1    但是 已经可以使用。

pip install Keras==2.1.6

pip install opencv-python

pip install pillow

pip install matplotlib

#官方代码需要 安装这俩
pip install typeguard==2.2.2
pip install nibabel==2.3.0



使用数据( 人证照片 ):
train 500
test 200


第二种 text 噪声 加噪去噪 效果验证:
训练

–nb_epochs 300 训练时长 15h

nohup python train.py --image_dir dataset/train --test_dir dataset/test --image_size 128 --batch_size 4 --lr 0.001 --source_noise_model text,0,50 --target_noise_model clean --val_noise_model text,0,50 --loss mae --output_path text_clean  --nb_epochs 300 &

测试

纯净数据,加噪去噪,效果如下:

python test_model.py --weight_file text_clean/weights.300-1.180-36.05937.hdf5 --image_dir dataset/commonSet --output_dir commonSetOut --test_noise_model text,0,60 

noise2noise | 实验总结_第1张图片

带噪数据,不加噪,去噪 效果如下:

python test_model.py --weight_file text_clean/weights.300-1.180-36.05937.hdf5 --image_dir dataset/commonSet3 --output_dir commonSet3Out --test_noise_model clean

noise2noise | 实验总结_第2张图片
总结:noise2noise 300epoch训练得到的模型,可以较好的去除它本身加的随机 text 噪声,但是对于 其他类型的 文本噪声,并没有去噪效果。
原因如下:
源代码中的 text噪声,虽说是随机生成的,但这些文本都是完整的数字或者字母,而上图 下方的照片里面的噪声 种类 和 训练是 完全 不一致,因此它是没有 消除效果的。





你可能感兴趣的:(计算机视觉)