MATLAB做卷积字典学习

所需积分/C币:14 2018-10-22 22:17:23 459KB PDF

使用MATLAB做卷积字典学习当处理高维信号时,解决字典学习问题在计算上变得不可行,并且学习模型遭受维数问题的困扰。传统上,这个问题是通过训练从X中提取的块的局部模型并独立处理它们来避免的。这种方法由于其简单性和高性能而获得了广泛的普及和成功[10,21,30,8,19]。一种新的方法是卷积稀疏编码(CSC)模型
S. Soltani A Matlab Package for DL Approach to CT the tomographic reconstruction problem and compute the best approximation error of a given test image by the obtained dictionary. For an advanced use of the routines, we invite the reader to carefully read 56, as well as this documentation and the descriptions in the. m files provided in this package 1.2 Toolbox and Software Dependencies The following toolboxes and software routines are required for this package to be run smoothly on a computer systerm Matlab: The package has been implemented in Matlab version 2014a AIR Tools 4 is a Matlab software package for tomographic reconstruc- tion consisting of tomographic test problems and a number of algebraic iterative reconstruction methods. The user can download aIR. Tools in a zipformatfilefromhttp://uww2.computedtudk/-pcha/airtools/ TFOCS I is a suite of programs and routines designed lo help construct ing of first-order methods for a variety of convex optimization problems arise in compressed sensing, sparse recovery, and low rank matrix com- olction c.g.(BPDN and Lasso). The uscr can download TFOCS in a zip formatfilefromhttp://cvxr.com/tfocs/download/ The user may download and unpack the software routines in a scparatc folder while the paths to those folders can be added to the Matlab's current path by including addpath sta tement s 1.3 Test lmages A collection of gray scale test images has been provided in the package, lo- cated in the folder " Testlmages"? There are 6 built-in test problems in this version namely:"Peppers, Matches, Binary, D53, Zirconium and Steel The higll-resolulion photos of Peppers and Matches are provided by profes- sor Samuli Siltanen from University of Helsinki. The Zicronium test image is courtesy of Dr. Hamidrcza Abdolvand from Univcrsity of Oxford. The stccl microstructure image is from 8 and the D53 test image is chosen from the normalized brodatz texture database 7. The binary test image is generated by means of phantomgallery m function from A/R Tools. The user should update Matlab's path with links to the subdirectories/'Testlmage and/ TestResults 1. 4 Notation The linear tomographic reconstruction problem is formulated as Ax a b where the vector E R" represents the unknown image of size M N, the vector b∈R” is the given noisy data. and the matrix a∈ IRmin represents the forward model. We use the following notation where b is an arbitrary matrix f|sum=∑|B2 S. Soltani A Matlab Package for DL Approach to CT 2 Package Details 2.1 Dictionary Learning problem dl demo, m Demo and exanple script for the dictionary learning(DL) problem in the matrix form D The function routinc to learn a matrix dictio- nary with the given parameters Lea_Algorithm_D2.m Performs the amm algorithm in k iterations for the dictionary learning problem in the Ma trix form such that D E D2 Lea algorithm Dinf m Perforins the ADMM algorithIn in k iteratiOns for the dictionary learning problem in the Ma trix form such that D E Do dykstra.m Finds a point in the intersection of two convex sets by iteratively projecting onto each of the onvex sets montageplotm This function is a tool to illustrate the dictio- mary elements as images 2.1.1 dl demo. m Description: Demo script for the dictionary learning(DL) probleIn ill the matrix form Limit: The test images are predefined in the codes Dependencies: DicLear_M, Lea_Algorithm_D2, Lea_Algorithm_Dinf montageplot, dykstra Usage: DL deme 2.1.2 DicLear mm Dcscription: The function loads the test images, extract training patches from those images and computes a dictionary with the given parameters by finding a local optimum to min2,Y-DH+ ALlIum s:t.D∈B,H∈R,(1) where Isum-∑;|1; B×={D∈R4511∞≤1}andb2={D∈R4|d≤√分} The patches of the dictio e code accepts a range of different values for A This function can also run without any input parameter and with default values defined in the code Dcpcndcncics: Lea_ Algorithm_D2, Lea_ Algorithm_ Dinf, dykstra S. Soltani A Matlab Package for DL Approach to CT [D,H, Norm1H, Norm1HCol, Density, NrNZero, t_end, output] DicLear_M(TImage, patch_ size, s, Lambda, DSet, t, Outdisplay) Inp TImage: The name of the test image. the test image options are Peppers, Matches, Binary, D53, Zirconium, steel patch_size: The training pi s: Number of dictionary elements Lambda: The regularization parameter, The code accepts a range of different values for入 Set: The name of the compact and convex set which the dictionary belongs lo, the options are: D_inf and D_2 t:Nunber of training patches Outdisplay: The display option on the screen, when set to 0 no display on the screen, when set to 1 prints progress of the algorithm default value =0 Outputs D: The matrix dictionary(ics) of sizc p by s for cach A whore patch_size(1)patch_size(2) H: The representation matrix(ces)of size s by t for each X Norml:‖H Norm1HCol:H un/t Density: The density percentage(s) of the matrix(ces)H NrNZero: The absolute number of nonzeros in the representation matrix(ces)H t end: Total time used by the amm algorithm to find a, solution ific入 output: Structured ouLput array of the following fields k Objective: The objective funclion value(s)for each iteration of the ADMM algorithm: 1/2lY-DH F+HSun k Residual: The residual value(s) for each iteration of the ADMM algorithIm: Y- DhF criteria values at each iteration of the ADMM algorith opping k StopCr1, StopCr1, StopCr1, StopCr1, StopCr1: The st Example TImage=P atch size=[55] t=10000; s=100 Lambda= 1 DSet='d 2 Outdisplay=1 [D, H]=DicLear_M(TImage, patch_size, s, Lambda, DSet, t, Outdisplay) S. Soltani A Matlab Package for DL Approach to CT 2.1.3 Lea_Algorithm_D2.m Description: This function performs the ADMM algorithm in k itera tions for the dictionary learning problem in the Matrix form, for one value of A, where the dictionary D belongs lo the sel D2. DSet='D_2 · Usage [W, H, Rs1, Rs2, Rs3, Rs4, Rs5, fobjec, ResF] Lea_Algorithm_D2(X, tol, maxiter, s, Cof_ Lambda, U,V, Cof_rho, Outdisplay): ● Input: X: Training matrix tol: The tolerance for the adam convergence maxiter: Total number of adm iterations s: The number of dictionary clements Cof_ Lambda: the regularization parameter A in the dictionary learn ing probleM formulation U, V: The initial valuc for the auxiliary variables in the ADMM algo rithm Cof_rho: The augmented Lagrangian parameter Outdisplay: The display option on the scrccn, when sct to 0 no display on the screen, when set to l prints progress of the algorithm default value =0 ● Output W: The dictionary matrix for the corresponding X H: The representation matrix for the corresponding x fobjec: The objeclive lunction value for each ileralion of the ADMM algorithm: bY-DH F+AHsum ResF. The residual value for each iteration of the admm algorithm Y-DH‖ Rs1, Rs 2, Rs3, Rs4, Rs5: The stopping criteria values at each itera- tion of the adam algorithm 2.1.4 Lea_Algorithm_ Dinf.m Description: This function performs the admm algorithm in k itera tions for the dict ionary learning problem in the matrix form,, for one value of A, where the dictionary D belongs to the set Doo, DSet='D_inf 1 [W,H, Rs1, Rs2, Rs3, Rs4, Rs5 Lea algorithm Dinf(X, tol, maxiter, s, Cof Lambda, U,v Cof_rho, Outdisplay); Input, Output: See Lea_Algori S. Soltani A Matlab Package for DL Approach to CT 2.2 Mean Approximation Error MaeM_demo. m Demo script file illustrating how to compute the approximation error of a test problem in y che g MAE M.m Computes the approximation error for the ma trix formulation 2.2.1 maem demo. m Description: This dcmo script filc illustrates how to compute the ap- proximation error of a test problem in the cone defined by the dictionary This code handle various dictionaries for a range of values for X Dcpcndcncics: TFOCS ToolbOx, MAE_M.m .Limit:ThiscodesusesTfoCsoptimizationsolver(http://cvxr.com tfocs/). Make sure TFOCS is properly installed on the computer · Usage: MAeM demo 2.2.2 MAE M.m Description: This function computes the approximation error for the matrix formulation i. e, how well we can represent the exact image in the conc dcfincd by the dictionary. To cvaluate the approximation crror, ic the distance of the exact image .exact to its projection on the cone C [DzlzERfcR+, we compute the solutions o to the q approximation dictionaries for a range ol values co, g in z exact. This code handle various problems for all blocks Dependencies: TFOCS Toolbox Limit: The test images are predefined, the user should modify the test images in the code for other test problem or image sizes. Makc surc TFOCS is properly installed on the computer sase [ Appr_Error_Mean, Appr_Error, Alph, Norm1Alph, SparsityAlph] MAE_M(TrImage, D, Lambda, patch_size, Outdisplay ); Inputs TrImage: The test image, options are: 'Peppers,'Matches 'Binary', '?,?,,?D5 D: The given(learned) dictionary, note that the dictionary should be obtained from a training image similar to the test image Lambda: The regularizaTion parameter in the dictionary learning problem formulation, note that it should be consistence with the dictionary D patch_size: The patch sizes of the dictionary elements, should be provided if the dictionaries patch sizes are rectangular default=[ceil(sqrt(size(D, 1))),ceil(sqrt(size(D, 1)))] S. Soltani A Matlab Package for DL Approach to CT Outdisplay: The display option on the screen, when set to 0 no display on the screen, when set, to I prints progress of the algorit hm default value 0 ● Outputs: ppr_Error_Mean: Mean approximation error Appr_Error: The vector of approximation errors for each block in the image Alph: The best representation/ approximation of the jth block in the Norm1Alph: a*l1 for cach block 3 Sparsity Alph: The sparsity percentage of the representation vector a, for each block Example: IMage= Peppers’; load(Dic.mat’,D) patch_size=[55]: Outdisplay=1; Appr_Error_Mean, Appr_Error 1 MAE_M(TrImage, D, Lambda, patch_size, Outdisplay 2.3 The reconstruction Problem RecM demo Demo script for the tomographic reconstruc- tion problem in the matrix form RecM_ Algorithm Solves the tomographic reconstruction pr leIn in Che matrix form for the asked test age by tFoCs Perm vec Returns the permutation vector which givcs a permutation to the solution. L Matrix Returns the matrix L, used to penalize the block artifacts in the reconstruction formula lon Linear Opr Delines a linear operator for the tomographic reconstruction matrix formulation used by the TFOCS 2.3.1 recm demo.m Dcscription: Dcmo script for the tomographic reconstruction problem in the matrix form. This script illustrates the use of the dictionary learning approach in the discrete tomographic reconstruction problem. Note that, this script solves a large scale sparse approximation problem and many it- erations are needed to converge to the solution and this is not an bug /error f the code Dependencies: TFOCS, RecM_ Algorithm, Perm_Vec, L_ Matrix Linear_ upr S. Soltani A Matlab Package for DL Approach to CT Limit: The test images are predefined. the user should modify the test images in the code for ot her test, problem or image size. This code handles one dictionary for a specific X and s. Make sure TFOCS is properly stalled on the computer Usage: RecM demo 2.3.2 RecM_Algorithmm Description: This function solves the tonographic reconstruction prob len for the given test problem by TFOCS. The problem is given by mna∈Rs Dm lAIr( C D)c-b l2+u 1+82v(II(I& D)a st with regularization parameters u, d>0, where (2) M(MP-1)+N(N/Q-1) L=|2 a is an M x N imagc such that n= MN and q is the total number of non-overlapping patches in the image a. Let T=u/ q The code can handle a range of values for both T and d. Note that this CunctiOn solves a large scale sparse approximation problein and many iler ations are needed to converge to the solution and this is not an bug/error of the codc Dependencies: TFOCS, Perm_Vec, L_Matrix, Linear_Opr Limit: The Lest images are predefined. the user should inodily the lest images in the code for other test problem or image size. This code handles onc dictionary for a spccific A and s. Thc regularization paramctcrs T, 8> O are predefined in the code. The user can easily modify the code for other values of regularization parameter [TrI,X_sol, Alph, Error_Sol, tau, delta, Sparsity, Resudial Fit, alphaNorm1, AlphaNorm1Avr, t end RecM_Algorithm( TrImage, D, patch_size, N_p, Ra, rnl geo, Outdisplay Input TrImage: The test image, options are: 'Peppers','Matches', PBinary', 'Zirconium','Steel,,'D532 D: The given(learned)dictionary, note that the dictionary should be obtained froin a Lraining image similar to the test inage patch_size: The patch sizes of the blocks in the image, note that the is a multiple of the N p: Number of tomographic projections S. Soltani A Matlab Package for DL Approach to CT Ra: Range or the tomographic projections, e.g., full- range[0°,1803], limited-ange0°,20 nl: Gaussian additive noise level in Che monographic data eo: Choose a parallel-beam CT geometry or a fan-beam Ct ge ometry, options -fanbeam' and parallelbeam,, default value parallelbeam Outdispl c display option on the scrccn, when sct to 0 no display on the screen, when set to 1 prints progress of the algorithm default=o Output TrI: The cxact imagc considcrcd in the tomographic problem. The size of the Tri is predefined X_sol: The tomographic reconstruction solulion recovered fro C Alpha: The sparse representation/solution in the given dictionary obt ained by solving our tomographic reconstruction problem Error Sol: Relative reconstruction error tau: The sparsity regularization delta: The block artifacts regularization parameter Sparsity: The sparsity percentage of the representation vector ar Resudial_Fit: The residual of the tomographic data fitting term Alphanorm1:‖l Alphanorm1Ay t end: Tota.I time used by the tfoos to find the representation vector(a) for a specific regularization parameter (T and 8) Example TI Peppers': 1oad(Dic.mt’,D); patch_size=[55 Ra=180 N_.p=25 fanbeam ay=1 [TrI, X sol, Alph RecM_Algorithm( TrImage, D, patch_size, N_P, Ra, rnl, geo, Outdisplay

...展开详情
试读 20P MATLAB做卷积字典学习

评论 下载该资源后可以进行评论 1

sinat_35242662 今天刚开始接触这个概念,求交流啊大佬!
2018-12-10
回复
img

关注 私信 TA的资源

上传资源赚积分,得勋章
    最新推荐
    MATLAB做卷积字典学习 14积分/C币 立即下载
    1/20
    MATLAB做卷积字典学习第1页
    MATLAB做卷积字典学习第2页
    MATLAB做卷积字典学习第3页
    MATLAB做卷积字典学习第4页
    MATLAB做卷积字典学习第5页
    MATLAB做卷积字典学习第6页

    试读已结束,剩余14页未读...

    14积分/C币 立即下载 >