Disclosure of Invention
In order to solve the problems, the invention provides a robust image classification method and a robust image classification device based on low-rank two-dimensional local identification map embedding, which comprehensively consider discrimination information in map embedding and the low-rank property of data in image classification, are used for solving the technical problems of low classification precision and noise points and singular points in the existing image classification based on a 2DLPP learning model, and not only solve the noise of a sample, but also consider the category of the sample.
In order to achieve the technical purpose and achieve the technical effect, the invention is realized by the following technical scheme:
the robust image classification method based on low-rank two-dimensional local discriminant map embedding comprises the following steps:
1) acquiring a standard image library, and constructing a new standard image library to be classified;
2) and (3) aiming at the new standard image to be classified, performing the following processing:
21) calculating an intra-class divergence matrix S of a new standard image to be classifiedwAnd between-class divergence matrix SbDifference J (P):
wherein, P is a projection matrix,
the value of the minimum loss function P is calculated, gamma is an adjusting parameter, and gamma is more than 0 and less than 1;
22) carrying out low-rank matrix decomposition on the acquired image X to obtain a low-rank matrix A and a sparse matrix E:
wherein s.t. represents a constraint condition symbol,
expressing the value of the minimum loss functions A and E, | · | | non-woven phosphor
*Represents the kernel norm, | ·| luminance
1Represents the norm of L1, β represents the adjustable parameter;
23) combining the results of 21) and 22) to obtain a final objective function:
s.t.X=A+E
wherein α represents the adjustable parameter, rank (A) represents the rank of matrix A;
24) from Yi=PTXiAnd obtaining the characteristic matrix Y ═ Y1,…,Yi,…,YN)T:
wherein ,PTA transposed matrix representing P, YiRepresenting an ith post-projection sample matrix; n represents the total number of samples; xiRepresenting 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) constructing an intra-class compact graph, and constructing the intra-class compact graph through the following graph embedding formula:
wherein ,
represents a sample X
iIn the same class of K
cNumber of nearest neighbor samples, pi
cRepresents the number of samples belonging to class c; i | · | purple wind
2Represents the L2 norm; d
C and W
CThe diagonal matrix and the weight matrix are represented separately,
kronecker product, I, of the representation matrix
nAn identity matrix of order n, L
c=D
c-W
c;
212) Constructing an edge separation graph, and constructing the edge separation graph through the following graph embedding formula:
wherein ,
is represented by K
pMore recently in
Data pair of (1), K
pRepresentation and sample X
iNumber of nearest neighbor samples of different classes, pi
tRepresenting the number of samples belonging to class t, D
pRepresenting a diagonal matrix, W
pRepresenting a weight matrix, L
p=D
p-W
p;
213) Calculating the optimal J (P):
J(p)=mintr[Sw-γSb]
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 discriminant map embedding algorithm:
s.t.X=A+E,A=B,Yi=PTAi
wherein ,
the minimum loss function A, E and P are shown,
a matrix of weights within the representation class,
representing inter-class weight matrices, B representing noiseless matrices, A
iRepresenting the ith noise-free sample matrix;
232) constructing an augmented Lagrange multiplier function L (P, B, E, A, M)1,M2,μ):
Where μ > 0 is a penalty parameter, M
1 and M
2Is a lagrange multi-multiplier and is,
denotes the F norm, L
wRepresents the intra-class Laplace matrix, L
bRepresenting an inter-class laplacian matrix;
233) variables B, E, P and a are solved for.
Preferably, 3) specifically comprises the following steps:
31) definition of d (Y)1,Y2) Comprises the following steps:
wherein ,
Y
1is a feature matrix;
Y
2is a feature matrix;
is Y
1The kth column feature matrix of (1);
is Y
2The kth column feature matrix of (1); d is a characteristic value, | ·| non-woven phosphor
2Is the norm of L2;
32) if the total characteristic distance is Y
1,Y
2,…,Y
NEach image has a class label c
iCorresponding to a new test sample Y, if
And Y is
j∈c
lThen the classification result is Y ∈ c
l, wherein ,
to find the minimum loss function j, c
lIs class I;
33) and solving the final classes of all the images, and outputting the classification result of the images.
The robust image classification transpose based on low-rank two-dimensional local discriminant map embedding comprises the following steps:
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;
the first calculation unit: intra-class divergence matrix S for calculating new standard images to be classifiedwAnd between-class divergence matrix SbThe 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: and 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
feature matrix calculation unit: for according to Yi=PTXiAnd obtaining the characteristic matrix Y ═ Y1,…,Yi,…,YN)T;
A nearest neighbor classifier unit: the system 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 compact graph unit: the method is used for constructing the intra-class compact graph through a graph embedding formula;
constructing an edge separation graph unit: for constructing an edge separation graph by a graph embedding formula;
a calculation unit: for computing optimal j (p) from the intra-class compact graph and the edge separation graph.
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 discriminant map embedding algorithm;
constructing an augmented Lagrange multiplier function unit: for constructing augmented Lagrange multiplier function L (P, B, E, A, M)1,M2,μ);
A solving unit: for solving for variables B, E, P and a.
A computer readable storage medium comprising a computer program which, when run on a computer, causes the computer to perform the method of any one of the above.
A computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any one of the above.
The invention has the beneficial effects that:
firstly, in order to overcome the sensitivity of a 2DLPP method, the invention combines low-rank learning and robust learning, introduces the low rank into the 2DLPP, and provides a new dimension reduction method called low-rank two-dimensional local discriminant map embedding (LR-2DLDGE), wherein the method comprehensively considers the discrimination information in the map embedding and the low rank of data in image classification. First, an intra-class graph and an inter-class graph are constructed, which may retain local neighborhood discrimination information. Secondly, the given data is divided into a low-order characteristic coding part and an error part which ensures the sparseness of noise. A large number of experiments were performed on multiple standard image databases using the method to verify the performance of the proposed method. Experimental results show that the method has strong robustness on noise points of the image.
Secondly, the image recognition features are extracted by using a robust image classification method model and a design optimization algorithm based on low-rank two-dimensional local identification map embedding, on one hand, an LR-2DLDGE method uses a two-dimensional image matrix, so that the image does not need to be converted into a vector, the method performs feature extraction by using a map embedding method, 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 LR-2DLDGE algorithm adopts a low-rank learning algorithm, so that the phenomenon that the recognition rate of the image is reduced due to changes of illumination, expression, posture and the like can be well solved, and the phenomenon that the recognition rate is reduced when the relation between data sample points far away is weak or the data sample points between neighborhoods are not sufficiently overlapped can be solved.
Thirdly, the invention utilizes the nearest neighbor classifier to classify, which can effectively improve the classification precision of the image and promote the further excavation of the sparse characteristic of the image.
Fourth, the technical problems of low classification precision and noise points and singular points in image classification cannot be solved by the existing subspace learning, graph embedding learning and low-rank learning models, the technical problems of low classification precision and noise points and singular points in the existing image classification based on the 2DLPP learning model are solved, the identification precision is improved, and the method can be used in the fields of national public safety, social safety, information safety, financial safety, human-computer interaction and the like, and has a good application prospect.
Detailed Description
The present invention will be better understood and implemented by those skilled in the art by the following detailed description of the technical solution of the present invention with reference to the accompanying drawings and specific examples, which are not intended to limit the present invention.
The robust image classification method based on low-rank two-dimensional local discriminant map embedding comprises the following steps:
1) acquiring a standard image library, and constructing a new standard image library to be classified;
2) and (3) aiming at the new standard image to be classified, performing the following processing:
21) calculating an intra-class divergence matrix S of a new standard image to be classifiedwAnd between-class divergence matrix SbDifference J (P):
wherein, P is a projection matrix,
the value of the minimum loss function P is calculated, gamma is an adjusting parameter, and gamma is more than 0 and less than 1;
22) carrying out low-rank matrix decomposition on the acquired image X to obtain a low-rank matrix A and a sparse matrix E:
wherein s.t. represents a constraint condition symbol,
the value representing the minimum loss function A and E is expressed, | · | | non-calculation
*Represents the kernel norm, | ·| luminance
1Represents the norm of L1, β represents the adjustable parameter;
23) combining the results of 21) and 22) to obtain a final objective function:
s.t.X=A+E
wherein α represents an adjustable parameter, rank () represents the rank of matrix A;
24) from Yi=PTXiAnd obtaining the characteristic matrix Y ═ Y1,…,Yi,…,YN)T:
wherein ,PTA transposed matrix representing P, YiRepresenting an ith post-projection sample matrix; n represents the total number of samples; xiRepresenting an ith training sample matrix;
3) and classifying the images by using a nearest neighbor classifier, and outputting the classification result of the images.
The method extracts image identification characteristics by using a robust image classification method model based on low-rank two-dimensional local identification map embedding and a design optimization algorithm, on one hand, an LR-2DLDGE method uses a two-dimensional image matrix, so that the image does not need to be converted into a vector, the method performs characteristic extraction by using a map embedding method, more image characteristics 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 LR-2DLDGE algorithm adopts a low-rank learning algorithm, so that the phenomenon that the recognition rate of the image is reduced due to changes of illumination, expression, posture and the like can be well solved, and the phenomenon that the recognition rate is reduced when the relation between data sample points far away is weak or the data sample points between neighborhoods are not sufficiently overlapped can be solved. This is described in detail below with reference to fig. 1-5.
First, data acquisition and pre-processing are performed: and acquiring a standard image library (such as an AR face, USPS handwriting and a PolyU palm print), and taking the acquired standard AR face image library as an example, shearing 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, obtaining a face image library for training and testing, and obtaining an optimal image feature through a low-rank two-dimensional local discriminant image embedding feature extraction model specifically includes:
21) calculating an intra-class divergence matrix S of a new standard image to be classifiedwAnd between-class divergence matrix SbDifference J (P):
wherein, P is a projection matrix,
the value of the minimum loss function P is calculated, gamma is an adjusting parameter, and gamma is more than 0 and less than 1;
preferably, 21) specifically comprises the following steps:
211) constructing an intra-class compact graph, firstly introducing intra-class graph compression which can be intra-class data, and constructing the intra-class compact graph through the following graph embedding formula:
wherein ,
represents a sample X
iIn the same class of K
cNumber of nearest neighbor samples, pi
cRepresents the number of samples belonging to class c; i | · | purple wind
2Represents the L2 norm; d
C and W
CThe diagonal matrix and the weight matrix are represented separately,
kronecker product, I, of the representation matrix
nAn identity matrix of order n, L
c=D
c-W
c;
212) Constructing an edge separation graph, and constructing the edge separation graph through the following graph embedding formula:
wherein ,
represents K
pMore recently in
Data pair (data pair, i.e. two samples not in the same class), K
pRepresents this X
iNumber of nearest neighbor samples of different classes, pi
tRepresenting the number of samples belonging to class t, D
pRepresenting a diagonal matrix, W
pRepresenting a weight matrix, L
p=D
p-W
p;
213) Embedding: the optimal projection can be obtained by:
J(p)=mintr[Sw-γSb]
where tr [. cndot. ] represents the trace of the matrix.
In order to improve the precision of sparse expression 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 the matrix X can be decomposed into two matrices, i.e. (in other words) X ═ a + E, a is a low rank matrix and E is a sparse (noise) matrix, the low rank matrix recovery aims to find a low rank a approximate representation X, and the low rank matrix recovery can be considered as the following optimization problem:
wherein ,
expressing the value of the minimum loss functions A and E, lambda expressing the adjustable parameter, | · caldoes |, the Y
0Representing the L0 norm.
The above is an NP-hard problem, which can be solved by the following equation if the matrix a is low rank and E is sparse:
wherein s.t. represents a constraint condition symbol, | | A | | Y*A kernel norm represented as A, which can approximately represent the rank of A, | E | | survival1Is L1 norm, can approximately substitute | | | E | | non-magnetism0;
23) Combining the results of 21) and 22) to obtain a 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 discriminant map embedding algorithm:
s.t.X=A+E,A=B,Yi=PTAi
wherein ,
the minimum loss function A, E and P are shown,
a matrix of weights within the representation class,
representing inter-class weight matrices, B representing noiseless matrices, A
iRepresenting the ith noise-free sample matrix;
232) constructing an augmented Lagrange multiplier function L (P, B, E, A, M)1,M2,μ):
The augmented Lagrange multiplier function of the LR-2DLDGE algorithm is:
where μ > 0 is a penalty parameter, M
1 and M
2Is a lagrange multi-multiplier and is,
denotes the F norm, L
wRepresents the intra-class Laplace matrix, L
bRepresenting an inter-class laplacian matrix;
233) solving for variables B, E, P and A:
(1) solving a variable B:
fixing all variables except B, the solution equation for B can be expressed as:
the solution to the above equation can be found by singular value decomposition SVD:
wherein ,
u is unitary matrix of m × m order, sigma is half positive definite m × n
Diagonal matrix of order V is unitary matrix of order n × n, sigmajIs the positive singular value and r is the matrix rank.
(2) Solving a variable E:
fixing all variables except E, the solution equation for E can be expressed as:
we can solve the above equation directly with a contraction operator, we define a soft threshold operator Sε[X]Max (| X | -epsilon, 0), there is a solution of the following closed form:
wherein sign is a sign function and epsilon is a constant.
(3) Solving a variable P:
fixing all variables except for P, the solution equation for P can be expressed as:
rewriting the above equation:
one constraint is added as follows:
PT(X-E)(Dw-Db)(X-E)TP=1
the final equation can be obtained:
the above solution can be found by the following generalized eigenvalue problem:
wherein Λ denotes a feature value set, LWRepresenting intra-class Laplace matrix, I representing identity matrix, DWRepresenting intra-class diagonal matrices, DBRepresenting an inter-class diagonal matrix.
(4) Solving a variable A:
fixing all variables except A, the solution equation for A can be expressed as:
by setting derivatives
The following can be obtained:
wherein
And
a is essentially by solving the Sylvester equation.
3) The invention utilizes the nearest neighbor classifier to classify the images, and outputs the classification result of the images. Preferably, 3) specifically comprises the following steps:
31) definition of d (Y)1,Y2) Comprises the following steps:
wherein ,
Y
1is a feature matrix;
Y
2is a feature matrix;
is Y
1The kth column feature matrix of (1);
is Y
2The kth column feature matrix of (1); d is a characteristic value, | ·| non-woven phosphor
2Is the norm of L2;
32) if the total characteristic distance is Y
1,Y
2,…,Y
NEach image has a class label c
iCorresponding to a new test sample Y, if
And Y is
j∈c
lThen the classification result is Y ∈ c
l, wherein ,
to find the minimum loss function j, c
lIs class I;
33) according to the above 31) and 32), solving the final classes of all face images, and outputting the classification results of the face images.
The invention solves the technical problems of low classification precision and noise points and singular points in the image classification based on the 2DLPP learning model, and improves the identification precision.
Correspondingly, a robust image classification transpose based on low-rank two-dimensional local discriminant image embedding includes:
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;
the first calculation unit: intra-class divergence matrix S for calculating new standard images to be classifiedwAnd between-class divergence matrix SbThe 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: and 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 Yi=PTXiAnd obtaining the characteristic matrix Y ═ Y1,…,Yi,…,YN)T;
A nearest neighbor classifier unit: the system 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 compact graph unit: the method is used for constructing the intra-class compact graph through a graph embedding formula;
constructing an edge separation graph unit: for constructing an edge separation graph by a graph embedding formula;
a calculation unit: for computing optimal j (p) from the intra-class compact graph and the edge separation graph.
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 discriminant map embedding algorithm;
constructing an augmented Lagrange multiplier function unit: for constructing augmented Lagrange multiplier function L (P, B, E, A, M)1,M2,μ);
A solving unit: for solving for variables B, E, P and a.
A computer-readable storage medium comprising a computer program which, when run on a computer, causes the computer to perform the method of any one of the above.
A computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any of the above.
In order to overcome the sensitivity of the 2DLPP method, the invention combines low-rank learning and robust learning, introduces low rank into 2DLPP, and provides a new dimension reduction method called low-rank two-dimensional local discriminant map embedding (LR-2DLDGE), wherein the method comprehensively considers the discrimination information in the map embedding and the low rank of data in image classification. First, an intra-class graph and an inter-class graph are constructed, which may retain local neighborhood discrimination information. Secondly, the given data is divided into a low-order characteristic coding part and an error part which ensures the sparseness of noise. A large number of experiments were performed on multiple standard image databases using the method to verify the performance of the proposed method.
The following experimental analysis is carried out by combining three commonly used databases and compared with the prior art, in order to verify the effectiveness of the embedding algorithm based on the low-rank two-dimensional local discriminant image in image recognition, the experiments of recognition are respectively carried out on an AR face database, a USPS handwriting and a PolyU palm print image database, the classification and recognition performances of the algorithm and 2DPCA,2DPCA-L1,2DLPP,2DLPP-L1 and LRR are compared, wherein all the algorithms are operated for 10 times and adopt Euclidean distance and nearest neighbor classifiers. The experimental environment is as follows: dell PC, CPU: inter Athlon (tm)64Processor, memory: 1024M, matlab7.01.
1. Experiments on the ORL face database
Html consists of 40 people, each of which consists of 10 112 × size grayscale images, some of which were taken at different times, with different degrees of variation in facial expressions, facial details, facial poses, and scales of the face, such as smiling or not, eyes open or closed, glasses worn or not, depth and plane rotations up to 20 °, and scales as much as 10%.
For each person, i (2, 3,4,5) images were selected for training, and the remaining 10-l images were tested, 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 the USPS handwriting database
The USPS handwritten digital image library (http:// www.cs.toronto.edu/. Roweis/data. html) has images with the numbers 0-9, each number has 1100 samples, the size of the image is 16 × 16. 100 samples of each number are selected for experiments, and a part of image with the number "2" is shown in FIG. 4.
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 USPS handwriting library
3. Experiments on PolyU palm print database
In the experiment, we selected a sub-library of the PolyU palm print database of hong Kong Physician university, which included 600 images of 100 different palm prints, each of 6 images, the 6 images were taken in two sessions, the first 3 were taken in the first session and the second 3 were taken in the second session, with an average interval of 2 months between the two sessions, the central region of the image was clipped, scaled to 128 × 128 pixels and histogram equalized.
Training is performed on 3 images obtained in the first time period, testing is performed on 3 images obtained in the second time period, and table 3 shows the maximum recognition rate and the corresponding dimension.
TABLE 3 maximum average recognition results for different algorithms on the PolyU palm print library
Through the experimental analysis, the image classification accuracy can be effectively improved, the method has the advantage of high recognition rate, can be used in the fields of national public safety, social safety, information safety, financial safety, human-computer interaction and the like, and has a good application prospect.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.