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>
-- 鍒╃敤鍒ゅ埆寮忓涔犵殑浼樺娍
妯″瀷缁撴瀯
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妗嗘灦涓紱
-- 鍦ㄥ叕寮?涓細
-- 涓や釜鍙傛暟涓紝$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鐨勪紭鍔挎€荤粨的主要内容,如果未能解决你的问题,请参考以下文章