Disclosure of Invention
Aiming at the problems, the invention provides a robust image classification method and device based on low-rank two-dimensional local discrimination map embedding, which comprehensively considers discrimination information in map embedding and low rank of data in image classification, and is used for solving the technical problems of low classification precision, noise points and singular points in the existing image classification based on a 2DLPP learning model, solving the noise of a sample and considering the category of the sample.
In order to achieve the technical purpose and the technical effect, the invention is realized by the following technical scheme:
a robust image classification method based on low-rank two-dimensional local discrimination map embedding comprises the following steps:
1) Acquiring a standard image library and constructing a new standard image library to be classified;
2) The following processing is carried out on the new standard image to be classified:
21 Calculating an intra-class divergence matrix S of a new standard image to be classified w And an inter-class divergence matrix S b Difference J (P):
wherein, P is a projection matrix,
representing the value of the projection matrix P when the loss function is minimal, gamma being the adjustment parameter and 0 < gamma < 1;
22 Low-rank matrix decomposition is carried out on the acquired image X to obtain a low-rank matrix A and a sparse matrix E):
wherein s.t. represents a constraint sign,
indicating that when the loss function is at a minimum, the values of the low rank matrix a and the sparse matrix, I.I
* The number of kernels is represented by a kernel norm, I.I
1 Represents an L1 norm, β represents an adjustable parameter;
23 Combining the results according to 21) and 22) above to obtain the final objective function:
s.t.X=A+E
wherein α represents an adjustable parameter; rank (a) represents the rank of matrix a;
24 From Y) i =P T X i Obtaining a feature matrix Y= (Y) 1 ,…,Y i ,…,Y N ) T :
wherein ,PT Representing the transposed matrix of P, Y i Representing an ith post-projection sample matrix; n represents the total number of samples; x is X i Representing an ith training sample matrix;
3) And classifying the images by using a nearest neighbor classifier, and outputting the classification result of the images.
Preferably, 21) specifically comprises the following steps:
211 Building an intra-class compactgram, building an intra-class compactgram by embedding the following formulas:
wherein ,
representing sample X
i In the same class K
c Nearest neighbor number of samples, pi
c Representing the number of samples belonging to class c; I.I
2 Represents an L2 norm; d (D)
C and W
C Respectively representing a diagonal matrix and a weight matrix, +.>
Kronecker product, I, representing a matrix
n Representing an identity matrix of order n, L
c =D
c -W
c ;
212 Constructing an edge separation graph by embedding the following graph-embedding formula:
wherein ,
denoted by K
p Recently at
Data pair, K in (a)
p Representation and sample X
i The number of nearest neighbor samples of different classes, pi
t Representing the number of samples belonging to the t-th class, D
p Representing a diagonal matrix, W
p Representing a weight matrix, L
p =D
p -W
p ;
213 Calculating an optimal J (P):
J(P)=mintr[S w -γS b ]
where tr [. Cndot. ] represents the trace of the matrix.
Preferably, 23) specifically comprises the following steps:
231 Constructing a final objective function of a low-rank two-dimensional local discrimination map embedding algorithm:
s.t.X=A+E,A=B,Y i =P T A i
wherein ,
representing low rank matrix a, sparseness when the loss function is minimalValues of matrix E and projection matrix P, +.>
Representing weight matrix in class,/->
Representing an inter-class weight matrix, B representing a noise-free matrix, A
i Representing an ith noise-free sample matrix;
232 Construction of an augmented Lagrange multiplier function L (P, B, E, A, M) 1 ,M 2 ,μ):
Wherein μ > 0 is a penalty parameter, M
1 and M
2 Is the lagrangian multiple multiplier and,
represents F norm, L
w Representing an intra-class Laplace matrix, L
b Representing an inter-class Laplace matrix;
233 Solving for variables B, E, P and a.
Preferably, 3) specifically comprises the following steps:
31 Definition d (Y) 1 ,Y 2 ) The method comprises the following steps:
wherein ,
Y
1 is a feature matrix;
Y
2 Is a feature matrix; y is Y
1 k Is Y
1 Is the kth column feature matrix of (a);
Is Y
2 Is the kth column feature matrix of (a); d is a characteristic value, i.i. |
2 Is the L2 norm;
32 If the total characteristic distance is Y
1 ,Y
2 ,…,Y
N Each image has a class label c
i Corresponds to a new test sample Y, if
And Y is
j ∈c
l Then the classification result is Y ε c
l, wherein ,
To the value of variable j, c when the loss function is minimal
l Is of class I;
33 Solving the final category of all the images and outputting the classification result of the images.
The device comprises:
constructing an image library unit: the method comprises the steps of obtaining a standard image library and constructing a new standard image library to be classified;
a first calculation unit: in-class divergence matrix S for calculating new standard images to be classified w And an inter-class divergence matrix S b A difference J (P);
a first image processing unit: the method comprises the steps of performing low-rank matrix decomposition on an acquired image X to obtain a low-rank matrix A and a sparse matrix E;
a second calculation unit: combining the results of the first computing unit and the first image processing unit to obtain a final objective function:
s.t.X=A+E
a feature matrix calculation unit: for according to Y i =P T X i Obtaining a feature matrix Y= (Y) 1 ,…,Y i ,…,Y N ) T ;
Nearest neighbor classifier unit: the method is used for classifying the images by utilizing the nearest neighbor classifier and outputting the classification result of the images.
Preferably, the first calculation unit includes:
constructing an intra-class compactgram unit: for building a compactgram within a class by a graph embedding formula;
constructing an edge separation graph unit: for constructing an edge separation graph by graph embedding formulas;
a calculation unit: for computing an optimal J (P) from the intra-class compactors and edge separator graphs.
Preferably, the second calculation unit includes:
constructing a final objective function unit: the final objective function is used for constructing a low-rank two-dimensional local identification map embedding algorithm;
constructing an augmented Lagrange multiplier function unit: for constructing an augmented Lagrange multiplier function L (P, B, E, A, M 1 ,M 2 ,μ);
And a solving unit: for solving variables B, E, P and a.
A computer readable storage medium storing a computer program which, when run on a computer, causes the computer to perform the method of any one of the preceding claims.
The beneficial effects of the invention are as follows:
first, in order to overcome the sensitivity of the 2DLPP method, the invention combines low-rank learning with robust learning, introduces low rank into the 2DLPP, and provides a novel dimension reduction method called low-rank two-dimensional local identification map embedding (LR-2 DLDGE), which comprehensively considers the discrimination information in map embedding and the low rank property of data in image classification. First, intra-class graphs and inter-class graphs are constructed, which can retain local neighborhood discrimination information. Second, the given data is divided into a low-order feature encoding section and an error section that ensures noise sparseness. A number of experiments were performed on a number of standard image databases using the present method to verify the performance of the proposed method. Experimental results show that the method has strong robustness to noise points of the image.
Secondly, the invention extracts image recognition features by using a robust image classification method model based on low-rank two-dimensional local discrimination map embedding and a design optimization algorithm, on one hand, the LR-2DLDGE method uses a two-dimensional image matrix, so that the image does not need to be converted into a vector, the method uses a map embedding method to extract features, more image features can be extracted, and the intra-class covariance matrix of the method is reversible, so that the problem of small samples does not exist; on the other hand, the low-rank learning algorithm adopted in the LR-2DLDGE algorithm can well solve the problem that the recognition rate of images is reduced due to changes of illumination, expression, gesture and the like, and can also solve the problem that the recognition rate is reduced when the connection between data sample points which are far away is weak or the overlapping of the data sample points between adjacent domains is insufficient.
Thirdly, the invention uses nearest neighbor classifier to classify, which can effectively improve the image classification precision and promote the further excavation of the sparse characteristic of the image.
Fourth, the existing subspace learning, graph embedding learning and low-rank learning models cannot solve the technical problems of noise points and singular points existing in image classification, the technical problems of low classification precision, noise points and singular points existing in the image classification based on the 2DLPP learning model are solved, the recognition precision is improved, and the method can be used in the fields of national public safety, social safety, information safety, financial safety, man-machine interaction and the like, and has good application prospects.
Detailed Description
The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific examples, so that those skilled in the art can better understand the present invention and implement it, but the examples are not limited thereto.
A robust image classification method based on low-rank two-dimensional local discrimination map embedding comprises the following steps:
1) Acquiring a standard image library and constructing a new standard image library to be classified;
2) The following processing is carried out on the new standard image to be classified:
21 Calculating an intra-class divergence matrix S of a new standard image to be classified w And an inter-class divergence matrix S b Difference J (P):
wherein, P is a projection matrix,
representing the value of the projection matrix P when the loss function is minimal, gamma being the adjustment parameter and 0 < gamma < 1;
22 Low-rank matrix decomposition is carried out on the acquired image X to obtain a low-rank matrix A and a sparse matrix E):
wherein s.t. represents a constraint sign,
indicating that when the loss function is at a minimum, the values of the low rank matrix a and the sparse matrix E represent, I.I
* The number of kernels is represented by a kernel norm, I.I
1 Represents an L1 norm, β represents an adjustable parameter;
23 Combining the results according to 21) and 22) above to obtain the final objective function:
s.t.X=A+E
wherein α represents an adjustable parameter; rank (·) represents the rank of matrix a;
24 From Y) i =P T X i Obtaining a feature matrix Y= (Y) 1 ,…,Y i ,…,Y N ) T :
wherein ,PT Representing the transposed matrix of P, Y i Representing an ith post-projection sample matrix; n represents the total number of samples; x is X i Representing an ith training sample matrix;
3) And classifying the images by using a nearest neighbor classifier, and outputting the classification result of the images.
According to the method, the image recognition features are extracted by utilizing a robust image classification method model based on low-rank two-dimensional local discrimination map embedding and a design optimization algorithm, on one hand, the LR-2DLDGE method uses a two-dimensional image matrix, so that an image is not required to be converted into a vector, the image features can be extracted more by utilizing a map embedding method to extract features, and the intra-class covariance matrix of the method is reversible, so that the problem of a small sample is avoided; on the other hand, the low-rank learning algorithm adopted in the LR-2DLDGE algorithm can well solve the problem that the recognition rate of images is reduced due to changes of illumination, expression, gesture and the like, and can also solve the problem that the recognition rate is reduced when the connection between data sample points which are far away is weak or the overlapping of the data sample points between adjacent domains is insufficient. The following is a detailed description with reference to fig. 1-5.
First, data acquisition and preprocessing are performed: and acquiring a standard image library (such as an AR face, a USPS handwriting and a PolyU palm print), taking the standard AR face image library as an example, and cutting the standard image library to construct a new standard image library to be classified.
Secondly, feature extraction and feature selection are carried out on the new standard face image to be classified: as shown in fig. 2, a training and testing face image library is obtained, and the optimal image features are obtained by embedding a feature extraction model into a low-rank two-dimensional local identification map, which specifically comprises:
21 Calculating an intra-class divergence matrix S of a new standard image to be classified w And an inter-class divergence matrix S b Difference J (P):
wherein, P is a projection matrix,
representing the value of the projection matrix P when the loss function is minimal, gamma being the adjustment parameter and 0 < gamma < 1;
preferably, 21) specifically comprises the following steps:
211 First, it is introduced that the intra-class map can be intra-class data compression, and the intra-class map is constructed by the following map embedding formula:
wherein ,
representing sample X
i In the same class K
c Nearest neighbor number of samples, pi
c Representing the number of samples belonging to class c; I.I
2 Represents an L2 norm; d (D)
C and W
C Respectively representing a diagonal matrix and a weight matrix, +.>
Kronecker product, I, representing a matrix
n Representing an identity matrix of order n, L
c =D
c -W
c ;
212 Constructing an edge separation graph by embedding the following graph-embedding formula:
wherein ,
the representation represents K
p Recently at
Data pair (i.e. two samples not in the same class), K
p Representing book X
i The number of nearest neighbor samples of different classes, pi
t Representing the number of samples belonging to the t-th class, D
p Representing a diagonal matrix, W
p Representing a weight matrix, L
p =D
p -W
p ;
213 Embedding: the optimal projection can be obtained by:
J(P)=mintr[S w -γS b ]
where tr [. Cndot. ] represents the trace of the matrix.
In order to improve the precision of sparse representation in the face recognition process, 22) performing low-rank matrix decomposition on the acquired image X to obtain a low-rank matrix A and a sparse matrix E:
assuming that matrix X can be decomposed into two matrices, i.e. (in other words) x=a+e, a being a low rank matrix, E being a sparse (noise) matrix, low rank matrix recovery aims to find a low rank a approximation representing X, low rank matrix recovery can be regarded as the following optimization problem:
wherein ,
representing when the loss function is the mostThe values of the low rank matrix a and the sparse matrix E, for hours, lambda is the variable parameter that is to be adjusted, I.I
0 Representing the L0 norm.
The above is an NP-hard problem that can be equivalent to solving if matrix a is low rank and E is a sparse matrix:
wherein s.t. represents a constraint sign, I A I * Denoted as the core norm of a, the kernel norm can approximate the rank of a, I E I 1 For L1 norm, it can be approximated to replace E 0 ;
23 Combining the results according to 21) and 22) above to obtain the final objective function:
s.t.X=A+E
wherein α represents an adjustable parameter; rank (·) represents the rank of matrix a;
preferably, 23) specifically comprises the following steps:
231 Constructing a final objective function of a low-rank two-dimensional local discrimination map embedding algorithm:
s.t.X=A+E,A=B,Y i =P T A i
wherein ,
representing the values of the low rank matrix A, the sparse matrix E and the projection matrix P when the loss function is minimal, < >>
Representing weight matrix in class,/->
Representing an inter-class weight matrix, B representing a noise-free matrix, A
i Representing an ith noise-free sample matrix;
232 Construction of an augmented Lagrange multiplier function L (P, B, E, A, M) 1 ,M 2 ,μ):
The augmented Lagrange multiplier function of the LR-2DLDGE algorithm is:
wherein μ > 0 is a penalty parameter, M
1 and M
2 Is the lagrangian multiple multiplier and,
represents F norm, L
w Representing an intra-class Laplace matrix, L
b Representing an inter-class Laplace matrix;
233 Solving variables B, E, P and a:
(1) Solving the variable B:
fixing all variables except B, the solution equation for B can be expressed as:
the solution of the above equation can be found by singular value decomposition SVD:
wherein ,
Σ=diag(σ
1 ,…,σ
r ). U is an m×m unitary matrix; Σ is a half-positive definite m×n order diagonal matrix; v is an n×n unitary matrix, σ
j And r is a matrix rank, which is a positive singular value.
(2) Solving the variable E:
fixing all variables except E, the solution equation for E can be expressed as:
we can solve the above directly with the contraction operator, we define the soft threshold operator S ε [X]=sign (X). Max (x| -epsilon, 0), there is a solution of the following closed form:
where sign is a sign function and ε is a constant.
(3) Solving a variable P:
fixing all variables except P, the solution equation for P can be expressed as:
the above equation is rewritten:
adding a constraint is as follows:
P T (X-E)(D w -D b )(X-E) T P=1
finally, the final equation can be obtained:
the above solution can be obtained by the following generalized eigenvalue problem:
where Λ represents a set of eigenvalues, L W Representing intra-class Laplace matrix, I representing identity matrix, D W Representing intra-class diagonal matrix, D B Representing an inter-class diagonal matrix.
(4) Solving the variable A:
fixing all variables except a, the solution equation for a can be expressed as:
by setting the derivative
The method can obtain:
wherein
and
A is essentially by solving the Sylvester equation.
3) The method and the device can effectively improve the image classification precision and promote the further mining of the sparse characteristics of the images by classifying the images by using the nearest neighbor classifier and outputting the classification result of the images. Preferably, 3) specifically comprises the following steps:
31 Definition d (Y) 1 ,Y 2 ) The method comprises the following steps:
wherein ,
Y
1 is a feature matrix;
Y
2 Is a feature matrix; y is Y
1 k Is Y
1 Is the kth column feature matrix of (a);
Is Y
2 Is the kth column feature matrix of (a); d is a characteristic value, i.i. |
2 Is the L2 norm;
32 If the total characteristic distance is Y
1 ,Y
2 ,…,Y
N Each image has a class label c
i Corresponds to a new test sample Y, if
And Y is
j ∈c
l Then the classification result is Y ε c
l, wherein ,
To the value of variable j, c when the loss function is minimal l Is of class I;
33 According to 31) and 32) above, solving the final category of all face images, and outputting the classification result of the face images.
The invention solves the technical problems of low classification precision, noise points and singular points in the existing image classification based on a 2DLPP learning model, and improves the recognition precision.
Correspondingly, a robust image classification transpose based on low-rank two-dimensional local identification map embedding, adopting the classification method, the device comprises:
constructing an image library unit: the method comprises the steps of obtaining a standard image library and constructing a new standard image library to be classified;
a first calculation unit: for gaugesCalculating new intra-class divergence matrix S of standard image to be classified w And an inter-class divergence matrix S b A difference J (P);
a first image processing unit: the method comprises the steps of performing low-rank matrix decomposition on an acquired image X to obtain a low-rank matrix A and a sparse matrix E;
a second calculation unit: combining the results of the first computing unit and the first image processing unit to obtain a final objective function:
s.t.X=A+E
a feature matrix calculation unit: for according to Y i =P T X i Obtaining a feature matrix Y= (Y) 1 ,…,Y i ,…,Y N ) T ;
Nearest neighbor classifier unit: the method is used for classifying the images by utilizing the nearest neighbor classifier and outputting the classification result of the images.
Preferably, the first calculation unit includes:
constructing an intra-class compactgram unit: for building a compactgram within a class by a graph embedding formula;
constructing an edge separation graph unit: for constructing an edge separation graph by graph embedding formulas;
a calculation unit: for computing an optimal J (P) from the intra-class compactors and edge separator graphs.
Preferably, the second calculation unit includes:
constructing a final objective function unit: the final objective function is used for constructing a low-rank two-dimensional local identification map embedding algorithm;
constructing an augmented Lagrange multiplier function unit: for constructing an augmented Lagrange multiplier function L (P, B, E, A, M 1 ,M 2 ,μ);
And a solving unit: for solving variables B, E, P and a.
A computer readable storage medium storing a computer program which, when run on a computer, causes the computer to perform the method of any one of the preceding claims.
In order to overcome the sensitivity of the 2DLPP method, the invention combines low-rank learning with robust learning, introduces a low rank into the 2DLPP, and provides a novel dimension reduction method called low-rank two-dimensional local identification map embedding (LR-2 DLDGE), which comprehensively considers the discrimination information in map embedding and the low rank property of data in image classification. First, intra-class graphs and inter-class graphs are constructed, which can retain local neighborhood discrimination information. Second, the given data is divided into a low-order feature encoding section and an error section that ensures noise sparseness. A number of experiments were performed on a number of standard image databases using the present method to verify the performance of the proposed method.
In order to verify the effectiveness of the embedding algorithm in image recognition based on the low-rank two-dimensional partial authentication map, the experiments of recognition are respectively carried out on an AR face database, a USPS handwriting and a PolyU palmprint image database, and the classification recognition performances of the algorithm and 2DPCA,2DPCA-L1, 2DLPP-L1 and LRR are compared, wherein all the algorithms are operated for 10 times and Euclidean distance and nearest neighbor classifiers are adopted. Experimental environment: dell PC, CPU: interAthlon (tm) 64Processor, memory: 1024M,Matlab 7.01.
1. Experiments on ORL face database
The ORL standard face library (http:// www.uk.research.att.com/facedatabase. Html) consists of 40 people, each of which consists of 10 grayscale images of 112 x 92 size, some of which are taken at different times, the facial expression, face details, face pose and face dimensions of the person varying to different extents, e.g. smiling or smiling, eyes or open or close, with or without glasses; depth rotation and plane rotation can reach 20 degrees; there is also a variation in scale of up to 10%. In this experiment, the image was processed in the form of a gray scale of 56×46. Fig. 3 is 10 images of a person in the ORL face library.
In the experiment, l (l=2, 3,4, 5) images of each person are selected for training, and the rest 10-l images are tested, wherein the test results are shown in table 1:
TABLE 1 maximum average recognition rate results for different algorithms on ORL face library
2. Experiments on a USPS handwriting database
The USPS hand-written digital image library (http:// www.cs.toronto.edu/-roweis/data.html) has images with numbers 0-9, each number has 1100 samples, and the image size is 16 multiplied by 16. We selected 100 samples per number for the experiment. Fig. 4 shows a portion of an image of the number "2".
In the experiment, l (l=20, 30,40, 50) samples were randomly selected as training samples, and the remaining 100-l were test samples. The maximum recognition rate and the corresponding dimension are listed in table 2 below.
TABLE 2 maximum average recognition rate results for different algorithms on the USPS handwriting library
3. Experiments on PolyU palmprint database
In the experiment we selected a sub-library of the PolyU palmprint database of the university of hong Kong's university, which contains 600 images of 100 different palmprints, 6 images per palmprint. The 6 images were taken during two time periods, the first 3 taken during the first time period and the second 3 taken during the second time period, with the two time periods being separated by an average of 2 months. The central region of the image is cropped, scaled to a 128 x 128 pixel size and histogram equalized.
Training is performed by using 3 images obtained in the first time period, and 3 images obtained in the second time period are tested, and table 3 shows the maximum recognition rate and the corresponding dimension.
TABLE 3 maximum average recognition rate results for different algorithms on PolyU palmprint library
Through the experimental analysis, the method can effectively improve the image classification precision, has the advantage of high recognition rate, can be used in the fields of national public safety, social safety, information safety, financial safety, man-machine interaction and the like, and has good application prospect.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures disclosed herein or modifications in equivalent processes, or any application, directly or indirectly, within the scope of the invention.