Require a code for plant recognition using Singular Value Decomposition (SVD) and Sparse Co-efficient methods.
显示 更早的评论
Hi,
I'm asking this question after spending a lot of days researching without getting a solution for my problem (the good thing is that I've learned a lot). I am using Flavia leaf database.
Can anyone help me out with the code for the following algorithm.
Input: N-two-dimensionality leaf images number; k-class number; y-testing image sample; ԑ-error threshold
Output: the label of testing image sample.
1. Dimensionality reduction: Conduct SVD on each image and produce a diagonal matrix as the original image, extract the nonnegative singular values in decreasing order and use the top maximum singular values to approximate the original image, obtain the reconstructed image.
2. Vectored images: Reshape each reconstructed two-dimensionality leaf images as a vector, called as a vectored image. Then, randomly select the vector training set and the vectored testing set.
3. Construct the dictionary W: Normalize the columns of W. Given a training set with k classes, W is composed of every sub matrix.
W = [W1, W2, ..., Wk] ∈ Rm×n, where Wi = vi,1, vi,2, . . ., vi,ni vi,j is the jth sample of the ith class, ni isthe sample number of the ith class.
4. Solve Optimization Problem: For the given vector test image, solve the optimization problem defined by the following equation.
J(x, ε) = min{ǁWx − yǁ2 + εǁxǁ1}
where ε > 0 is an adjusting parameter which can be determined experimentally, W is the dictionary of coding atoms,xis the coding vector of y over W and ǁxǁ2 =(Σ |x |2)1/2 denotes the l2-norm.
5. Compute the Residuals: Let δi (xj ) Є Rn keep only non zero entries in x1 that are associated with class i. approximate the test vector using only the coefficients of x1 which corresponds to the class i. For each class, compute the residuals ri(y) between y and estimate y1.
6. Check the acceptance condition: The acceptance condition is simply defined as the ratio between the two smallest residuals.
7. Repeat the steps 3-6 Iterative Process.
Please check the attachment for the detailed explanation of the algorithm.
Thank you in advance.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Biomedical Imaging 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!