CNN浣滀负denoiser鐨勪紭鍔挎€荤粨

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CNN浣滀负denoiser鐨勪紭鍔挎€荤粨相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/deep_2_cnn' title='deep cnn'>deep cnn   cal   min   涓冨眰   simple   strong   妯$硦   浠跨湡   璁烘枃   

鍥惧儚鎭㈠鐨凪AP鎺ㄧ悊鍏紡锛?/p>

$hat{x} ext{}= ext{}$arg min$_{x}frac{1}{2}|| extbf{y} ext{}- ext{} extbf{H}x||^{2} ext{}+ ext{}lambdaPhi(x)$

姝e垯鍖栭」$Phi(x)$瀵瑰簲鎭㈠鐨勮〃鐜版壆婕斾簡鑷冲叧閲嶈鐨勮鑹诧細

$ extbf{z}_{k+1} ext{}= ext{}Denoiser( extbf{x}_{k+1},sqrt{lambda/mu})$

鐒跺悗浠嬬粛鐜板湪鐨勯檷鍣厛楠屽彧瑕侀噰鍙杕odel-based 浼樺寲鏂规硶鍘昏В鍐砳nverse problem锛屽寘鎷細

-- total variation(TV)娉?nbsp;  ==銆?甯稿父鍒堕€爓atercolor-like 楝煎奖銆佷吉褰?/p>

-- 楂樻柉娣峰悎妯″瀷(Gaussian mixture model锛孏MM)

-- K-SVD ==銆嬮珮璁$畻娑堣€?/p>

-- 闈炲眬閮ㄥ潎鍊?Non-local means) ==銆嬪鏋滃浘鍍忎笉鍏锋湁鑷浉浼煎睘鎬э紝浼氳繃搴﹀钩婊戜笉瑙勫垯鐨勭粨鏋?/p>

-- BM3D==銆?濡傛灉鍥惧儚涓嶅叿鏈夎嚜鐩镐技灞炴€э紝浼氳繃搴﹀钩婊戜笉瑙勫垯鐨勭粨鏋?/p>


 鍥惧儚鐨勯鑹插厛楠屾槸涓€涓崄鍒嗛噸瑕佺殑鑰冭檻鍥犵礌锛屽洜涓哄浘鍍忓ぇ澶氭暟鍥惧儚鏄疪GB鏍煎紡銆?/p>

鑰岀敱浜庝笉鍚屽浘鍍忛€氶亾涔嬮棿鐨勭浉鍏虫€э紝鑱斿悎澶勭悊鍥惧儚鐨勪笉鍚岄€氶亾甯稿父浼氫骇鐢熸洿濂界殑琛ㄧ幇姣旂嫭绔嬪鐞嗘瘡涓鑹查€氶亾銆?/strong>

璁稿宸ヤ綔閮藉彧瀵圭伆搴﹀浘鍍忚繘琛屽缓妯★紝鑰屽浜庡僵鑹插浘鍍忕殑寤烘ā杈冨皯锛?/p>

浣滆€呮寚鍑篊BM3D 鍥犱负鑱斿悎澶勭悊浜哛GB閫氶亾锛屾敹鑾蜂簡涓嶉敊鐨勬晥鏋滐紝鍚屾椂浣滆€呮彁鍑哄彲浠ヤ娇鐢ㄥ垽鍒涔犳柟娉曞幓鑷姩鍖栫殑鎻ず娼滃湪鐨勫僵鑹插浘鍍忓厛楠岋紝鑰屼笉鏄緷闈犳墜宸ヨ璁$殑pipeline锛?/strong>

CNN闄嶅櫔鍏堥獙鍏锋湁閫熷害銆佽〃鐜般€佸垽鍒僵鑹插浘鍍忓缓妯$殑浼樺娍锛屽悓鏃禖NN鍘诲涔犲垽鍒紡闄嶅櫔鍣?discriminative denoiser)鏈変竴浜涘師鍥狅細

--  CNN 鐨勫墠鍚戜紶鎾敱浜嶨PU鐨勫瓨鍦ㄨ€屽苟琛岃绠?/p>

--  CNN 琛ㄧ幇鍑轰簡寮哄ぇ鐨勫厛楠屽缓妯¤兘鍔泈ith deep architecture

--  CNN鍒╃敤澶栭儴鍏堥獙锛屼綔涓轰簡BM3D涓轰唬琛ㄧ殑鍐呴儴鍏堥獙鐨勮ˉ鍏?/p>

--  鍒╃敤鍒ゅ埆寮忓涔犵殑浼樺娍


 

鎶€鏈浘鐗? src=

妯″瀷缁撴瀯

CNN denoiser 濡備笂鍥炬墍绀猴紝缃戠粶鍖呭惈涓冨眰锛屽叾涓涓€灞傛槸"鎵╁紶鍗风Н(鎵╁紶鎸囨爣涓?锛屾劅鐭ュ煙杩樻槸3*3)+RELU"锛?-6灞備负“鎵╁紶鍗风Н(鎵╁紶鎸囨爣鍒嗗埆涓? 3 4 3 2)+BN+RELU”锛?鏈€鍚庝竴灞備负“鎵╁睍鍗风Н(1)锛岀浉褰撲簬姝e父鐨勫嵎绉繍绠楋紝涓旀瘡涓腑闂村眰鐨勭壒寰佸浘鐨勬暟閲忛兘涓?4

鎵╁紶鍗风Нfilter and 澧炲ぇ鐨勬劅鐭ュ煙

-- 鍦ㄥ浘鍍忛檷鍣腑锛屼笂涓嬫枃鐨勪俊鎭兘澶熶績杩涙瘉鍧忓儚绱犵殑閲嶅缓锛?/p>

-- 涓轰簡鎹曡幏涓婁笅鏂囩殑淇℃伅锛岄€氳繃鍓嶅悜鐨勫嵎绉搷浣滃幓澧炲ぇ鎰熺煡鍩熸槸涓€涓垚鍔熺殑鏂规硶锛?/p>

鏈変袱绉嶅熀鏈殑澧炲ぇ鎰熺煡鍩熺殑鏂规硶锛?/p>

-- 涓€涓槸澧炲ぇfilter size  寮婄锛氫細寮曞叆鏇村鐨勫弬鏁帮紝澧炲ぇ浜嗚绠楄礋鎷?/p>

-- 涓€涓槸澧炲ぇ妯″瀷鐨勬繁搴?/p>

浣跨敤鎵╁紶鍗风Н鍘昏幏鍙杅ilter size 鍜屾ā鍨嬫繁搴︾殑骞宠 锛?鍦ㄤ繚鎸?3*3 filter 鐨勫熀纭€涓?澧炲ぇ鎰熺煡鍩燂紝 鏁翠釜7灞傜綉缁滃疄鐜颁簡 33*33 鐨勬劅鐭ュ煙锛?鐩稿綋浜?6灞傜殑3*3鏅€氬嵎绉紱

鍏朵腑鎵╁紶鍗风Н鐨刦ilter size 鍜?鎵╁紶鎸囨爣s 涔嬮棿鐨勫叧绯讳负锛?nbsp;size = (2s+1)*(2s+1)

浣跨敤BN鍜屾畫宸涔犲姞蹇缁?/strong>

瀵逛簬楂樻柉闄嶅櫔闂锛岀粨鍚圔N鍜屾畫宸涔犳槸鍗佸垎鏈夊府鍔╃殑锛屼粬浠兘鑳藉浜掔浉鐨勮幏鐩?鍦ㄤ粬鐨勮鏂囦腑鏈夎Residual learning of deep CNN for image denoising.锛?瀵逛簬妯″瀷鐨勮縼绉讳篃鏈夌敤锛?/p>

娈嬪樊瀛︿範鏂瑰紡锛屽氨鏄ā鍨嬬殑鐩爣涓嶆槸鐩存帴瀛︿範浜х敓闄嶅櫔鐨勫浘鐗囷紝鑰屾槸瀛︿範鍣0鍗虫畫宸紝鍗宠緭鍏ョ殑甯﹀櫔澹扮殑鍥剧墖鍜屽共鍑€鍥剧墖鐨勫樊銆?/p>

浣跨敤灏忓昂瀵哥殑鍥惧儚浣滀负璁粌闆嗗幓閬垮厤杈圭紭浼奖

-- 鐢变簬CNN鐨勭壒鐐癸紝濡傛灉娌℃湁鍚堥€傜殑澶勭悊锛孋NN鐨勯檷鍣浘鐗囧皢浼氫骇鐢熻竟缂樹吉褰憋紱

-- 瀵圭Оpandding 鍜?zero padding鏄袱绉嶈В鍐宠繖涓棶棰樼殑鏂规硶

-- 瀵逛簬鎵╁紶鎸囨暟涓?鐨勬搷浣滐紝鍦ㄨ竟缂榩ads 4 zeros,閭e叾浠栫殑鎵╁紶鎸囨暟鍛紵

-- 缁忛獙涓讳箟鐨勪娇鐢ㄤ簡灏忓昂瀵哥殑璁粌鏍锋湰 鍘婚伩鍏嶈竟缂樹吉褰憋紝鍘熷洜鍖呮嫭锛?/strong>

-- 灏嗗ぇ灏哄鐨勫浘鍍廲rop 鎴愬皬灏哄鐨刾atches,鏈夊埄浜嶤NN鍘荤湅鍒版洿澶氱殑杈规部淇℃伅锛屾瘮濡傚皢70*70鐨刾atches crop鎴愬洓涓潪閲嶅彔鐨?5*35鐨刾atches,杈圭紭淇℃伅琚墿澶т簡锛?/p>

-- 灏眕atch鐨勫ぇ灏忓彲浠ヤ綔瀵规瘮璇曢獙杩涜楠岃瘉锛?/p>

-- 褰撹缁冪殑patch灏哄灏忎簬鎰熺煡鍩熷悗锛岃繖涓€ц兘浼氫笅闄嶏紱

瀛︿範瀹為檯鐨勯檷鍣櫒妯″瀷with 灏忛棿闅旂殑鍣0姘村钩

-- 鎯宠寰楀埌绮剧‘鐨勫瓙闂鐨勮В鏄潪甯稿洶闅句笖time-consuming鐨勫幓浼樺寲鐨勶紝浣跨敤涓嶇簿纭絾鏄揩閫熺殑瀛愰棶棰樼殑瑙h兘澶熷姞蹇敹鏁?涓ょ瘒鏂囩尞锛歍he augmented lagrange multiplier method for exact recovery of corrupted low-rank matrices.鍜?nbsp;From learning models of natural im age patches to whole image restoration.)

-- 鎵€浠?娌℃湁蹇呰鍘诲涔犲緢澶氬垽鍒紡闄嶅櫔妯″瀷for 姣忎釜鍣0姘村钩銆?/p>

-- 灏界$ extbf{z}_{k+1} ext{}= ext{}Denoiser( extbf{x}_{k+1},sqrt{lambda/mu})$ 鏄竴涓檷鍣櫒锛屼絾浠栦笌浼犵粺鐨勯珮鏂檷鍣湁鐫€涓嶅悓鐨勭洰鏍囥€?/p>

-- 浼犵粺鐨勯珮鏂檷鍣槸鎭㈠鍑烘綔鍦ㄧ殑骞插噣鍥惧儚锛屾棤璁鸿鍘诲櫔鐨勫浘鍍忕殑鍣0绫诲瀷鍜屽櫔澹版按骞冲浣曪紝杩欓噷鐨勫幓鍣櫒閮戒細鍙戞尌鑷繁鐨勪綔鐢ㄣ€備篃灏辨槸璇达紝涓嶇杩欎釜鍥惧儚鏈夋病鏈夊櫔澹帮紝閮戒細鍙戞尌浣滅敤锛?/strong>

--  鎵€浠ヤ竴涓悊鎯崇殑鍒ゅ埆闄嶅櫔鍣ㄥ簲璇ヤ娇鐢ㄥ綋鍓嶇殑鍣0姘村钩杩涜璁粌锛?/p>

銆€璁粌浜嗕竴绯诲垪鐨勫櫔澹版按骞冲湪0-50鍚屾椂鐙珛鐨勪互2涓洪棿闅旂殑妯″瀷锛屼骇鐢熶簡25涓ā鍨嬩负鍥惧儚鐨勫厛楠岃繘琛屽缓妯★紱杩唬鏂规鐨勫瓨鍦紝浣夸粬鎭㈠瓒充互婊¤冻銆?/strong>


 

 瀹為獙

 鍥惧儚闄嶅櫔锛?/strong>

-- 灏嗘瘡涓浘鐗?crop 鎴愪簡35*35鐨刾atches,鍥犱负浣跨敤娈嬪樊瀛︿範鐨勬柟寮?鎹熷け鍑芥暟锛?/p>

$ extit{l}(Theta) ext{}= ext{}frac{1}{2N}sum_{i=1}^{N}||f(y_{i};Theta) ext{}- ext{}(y_{i} ext{}- ext{}x_{i})||^{2}$ 

-- 璁粌缁撴潫鐨勬爣蹇?璁粌鎹熷け鍦ㄤ簲涓繛缁殑epoch鍥哄畾

-- 浣跨敤浜嗘棆杞炕杞瓑鏁版嵁鎵╁厖鎶€宸э紱

-- 浠庝笉鍚屾柟娉曠殑PSNR 杩涜浜嗗姣旓紝 鍒嗗埆涔︾伆搴﹀浘鍜屽僵鑹插浘

-- 浠庝笉鍚屾柟娉曠殑杩愯鏃堕棿杩涜浜嗗姣?/p>

 鍥惧儚鍘绘ā绯婏細

妯$硦鏍哥殑閫夋嫨锛?/p>

-- 涓€涓父瑙佺殑妯$硦鐨勯珮鏂ā绯婃牳锛屾爣鍑嗗樊涓?.6锛?鏉ヨ嚜璁烘枃(Understanding and evaluating blind deconvolution algorithms)鐨勫墠涓や釜鐨勭湡瀹炴ā绯婃牳锛?/p>

-- 鎴戜滑鍙渶灏嗛鑹插幓鍣櫒鎻掑叆鍒癏QS妗嗘灦涓紱

-- 鍦ㄥ叕寮?涓細

鎶€鏈浘鐗? src=

-- 涓や釜鍙傛暟涓紝$lambda$ 涓?sigma^{2}$鐩歌仈绯诲悓鏃跺湪杩唬涓繚鎸佸浐瀹氾紝鍏朵腑$mu$鎺у埗鐫€闄嶅櫔鍣ㄧ殑鍣0姘村钩锛?/p>

鍏紡6(a)鐨勫揩閫熻В娉曪細

$x_{k+1}=(H^{T}H+mu I)^{-1}(H^{T}y+mu z_{k}) ext{ } ext{ } ext{ } ext{ } ext{ } ext{ }(7)$

-- 鐢变簬hqs妗嗘灦鏄熀浜庡幓鍣殑锛屽洜姝ゆ垜浠皢姣忔杩唬涓幓鍣殑鍣0绾ч殣寮忕殑纭畾涓?mu;銆?/p>

-- 鍦ㄦ垜浠殑瀹為獙璁剧疆涓紝鏍规嵁鍣0姘村钩锛屽畠浠ユ寚鏁板舰寮忎粠49琛板噺鍒癧1锛?5]涓殑鍊笺€?/p>

-- 瀹為獙浠g爜鏍稿績杩唬閮ㄥ垎

%妯℃嫙浠跨湡鐨勬ā绯婂櫔澹板浘鐗?
k = fspecial(鈥榞aussian鈥? 25, 1.6);%鐩稿綋浜庢槸妯$硦绠楀瓙
y = imfilter(im2double(x), k, 鈥榗ircular鈥? 鈥榗onv鈥? + sigma*randn(size(x));

%denominator 琛ㄧず鏄疕^{T}H, H妯$硦绠楀瓙涓庝粬鐨勫叡杞煩闃电浉涔?
V = psf2otf(k,[w,h]);%psf2otf(PSF) 鍏朵綔鐢ㄦ槸灏嗕竴涓┖闂寸偣鎵╂暎鍑芥暟杞崲涓洪璋遍潰鐨勫厜瀛︿紶閫掑嚱鏁帮紝鎵ц鐨勪篃鏄PSF鐨凢FT鍙樻崲锛屽彉涓轰簡棰戝煙锛?
denominator = abs(V).^2;%y = abs(3+4i) y=5 

%H^{T}*y H鐨勫叡杞煩闃典箻浠ヨ緭鍏
upperleft   = conj(V).*fft2(y); % conj(V) V=5-2i ==> 5+2i

%璁粌鐨勭壒鐐瑰櫔澹版按骞砛sigma鐨勪竴缁刣enoiser锛屽叾sigma浠ユ寚鏁板舰寮忕殑琛板噺鐨勪笉鍚屾ā鍨嬶紱
modelSigmaS = logspace(log10(modelSigma1),log10(modelSigma2),totalIter);
%lamba涓庡櫔澹版按骞砛sigma^2鏈夊叧涓斿湪杩唬涓繚鎸佸浐瀹氾紝mu鎺у埗鐫€闄嶅櫔鍣ㄧ殑鍣0姘村钩锛?rho闅愬紡鐨勮〃绀篭mu锛岃涓嬮潰鐨勮绠楁柟娉曚笌闄嶅櫔鍣ㄧ殑鍣0姘村钩鍜屽櫔澹版按骞虫湁鍏?
rho = lamda*255^2/(modelSigmaS(itern)^2);%[243.742,267.099,292.694,320.742,351.476]

upperleft = 
for itern = 1:totalIter
            %%% step 1
            rho = lamda*255^2/(modelSigmaS(itern)^2);
            z = real(ifft2((upperleft + rho*fft2(z))./(denominator + rho)));
            if ns(itern+1)~=ns(itern)
                [net] = loadmodel(modelSigmaS(itern),CNNdenoiser);
                net = vl_simplenn_tidy(net);
                if useGPU
                    net = vl_simplenn_move(net, 鈥榞pu鈥?;
                end
            end
            %%% step 2
            res = vl_simplenn(net, z,[],[],鈥榗onserveMemory鈥?true,鈥榤ode鈥?鈥榯est鈥?;
            residual = res(end).x;
            z = z - residual;
        end

鐪熷疄妯$硦鍥惧儚鐨勬祴璇?/strong>

璁剧疆浜嗕袱涓噸瑕佺殑浼拌鍥惧儚鍣0姘村钩 鍜?闄嶅櫔鍣ㄥ幓鍣按骞崇殑 瓒呭弬鏁帮細
% There are two important parameters to tune:
% (1) image noise level of blurred image: Isigma and
% (2) noise level of the last denoiser: Msigma.

%浣跨敤浜?鍒汉鐨勬柟娉?浜х敓鐨勬ā绯婃牳 鍥惧儚浣滀负鍏堥獙鐨勬潯浠?
%% read blurred image and its estimated kernel
% blurred image
Iname = 鈥榠m01_ker01鈥?
y  = im2single(imread(fullfile(folderTestCur,[Iname,鈥?png鈥榏)));
% estimated kernel
%k  = imread(fullfile(folderTestCur,[Iname,鈥榑kernel.png鈥榏));
k  = imread(fullfile(folderTestCur,[Iname,鈥榑out_kernel.png鈥榏));

if size(k,3)==3
    k = rgb2gray(k);
end
k  = im2single(k);
k  = k./(sum(k(:))); %褰掍竴鍖?

%姣旇緝閲嶈鐨勯儴鍒嗘槸杈圭紭鐨勫鐞?
%% handle boundary
boundary_handle = 鈥榗ase2鈥?
switch boundary_handle
    case {鈥榗ase1鈥榼 % option (1), edgetaper to better handle circular boundary conditions, (matlab2015b)
        % k(k==0) = 1e-10; % uncomment this for matlab 2016--2018?
        ks = floor((size(k) - 1)/2);
        y = padarray(y, ks, 鈥榬eplicate鈥? 鈥榖oth鈥?;
        for a=1:4
            y = edgetaper(y, k);
        end
    case {鈥榗ase2鈥榼 % option (2)
        H = size(y,1);    W = size(y,2);
        y = wrap_boundary_liu(y, opt_fft_size([H W]+size(k)-1));
end

 闇€瑕佹槑鐧戒负浠€涔堥渶瑕佽繘琛岃竟缂樻潯浠剁殑鍙樺寲锛屾槸璁╂ā绯婃牳瀹屽叏閲嶅悎鍜屽浘鍍忥紝鎵€浠ラ渶瑕佺敤妯$硦鏍?杩涜 涓€浜?padding 鎿嶄綔

 

以上是关于CNN浣滀负denoiser鐨勪紭鍔挎€荤粨的主要内容,如果未能解决你的问题,请参考以下文章

SEO浼樺寲锛氬叧浜庣綉绔欎紭鍖栦箣URL闈欐€佸寲鐨勪紭鍔垮拰鏂规硶

SSM+Oracle鑷姩鐢熸垚uuid浣滀负涓婚敭

鏇挎崲OSD鎿嶄綔鐨勪紭鍖栦笌鍒嗘瀽

鍦ㄥ伐浣滀腑浣犲彲鑳戒細閬囪鐨勪簨鎯呭搱

(c)2006-2024 SYSTEM All Rights Reserved IT常识