CN113887600A - Improved LDA-GSVD-based fabric image defect classification method and system - Google Patents
Improved LDA-GSVD-based fabric image defect classification method and system Download PDFInfo
- Publication number
- CN113887600A CN113887600A CN202111126929.5A CN202111126929A CN113887600A CN 113887600 A CN113887600 A CN 113887600A CN 202111126929 A CN202111126929 A CN 202111126929A CN 113887600 A CN113887600 A CN 113887600A
- Authority
- CN
- China
- Prior art keywords
- class
- matrix
- mean
- sample
- gsvd
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 239000004744 fabric Substances 0.000 title claims abstract description 55
- 238000000034 method Methods 0.000 title claims abstract description 53
- 230000007547 defect Effects 0.000 title claims abstract description 29
- 239000011159 matrix material Substances 0.000 claims abstract description 103
- 238000012360 testing method Methods 0.000 claims abstract description 64
- 238000000605 extraction Methods 0.000 claims description 16
- 238000000354 decomposition reaction Methods 0.000 claims description 11
- 239000006185 dispersion Substances 0.000 claims description 8
- 238000004364 calculation method Methods 0.000 description 5
- 238000004422 calculation algorithm Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000004927 fusion Effects 0.000 description 2
- 229920000742 Cotton Polymers 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002427 irreversible effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
- 239000000843 powder Substances 0.000 description 1
- 239000004753 textile Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2413—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a method and a system for classifying fabric image flaws based on improved LDA-GSVD, wherein the method comprises the following steps: s1, extracting the characteristics of the fabric image to obtain a characteristic matrix X and a label matrix H; s2, randomly dividing the data set sample into training samples X with labelstrainAnd a labeled test sample Xtest(ii) a S3, calculating the intra-class scattering matrix S after adding the local geometric information by using the inter-class scattering weight coefficient and the intra-class compact weight coefficientWAnd inter-class scattering matrix SB(ii) a S4, using redefinedAndrequired for obtaining GSVDAnds5, obtaining an optimal projection matrix W through the improved linear discriminant analysis model, and testing the sample XtestAnd (5) obtaining Y by projecting the matrix W to a new subspace, and confirming the sample label of the test set by using a KNN classifier. The method can solve the problems of lack of local geometric information and high dimension of small samples in the traditional LDA, and effectively improves the classification accuracy and efficiency of fabric image defects.
Description
Technical Field
The invention belongs to the technical field of textile defect classification methods, and particularly relates to an improved LDA-GSVD-based fabric image defect classification method and system.
Background
The Fisher criterion is proposed in 1936, the research enthusiasm is promoted in the field of pattern recognition, Linear Discriminant Analysis (LDA) is mainly used for feature extraction and dimension reduction, and the core idea of the method is to find a projection vector or a projection space in the original space and classify samples after the projection space is projected to a new space. LDA has better discrimination as a supervised learning method, but LDA focuses on global information, lacks assurance of local information, and secondly s when facing high-dimensional small sample problemsBw=λswSolving for existence of wwAn irreversible condition. Although the problem of high-dimensional small samples is solved by the proposal of LDA-GSVD, the problem that LDA only considers global information still exists. And the classification of fabric image flaws is a challenging task in the image classification task, the flaws of the fabric image are not distinguished obviously, and the potential local structure of the features cannot be ignored.
Therefore, an LDA-GSVD method for increasing local geometric information is needed to improve the accuracy of fabric image defect classification.
Disclosure of Invention
Aiming at the current situation of the prior art, the invention provides a fabric image flaw classification method and system based on improved LDA-GSVD (GSVD is generalized singular value decomposition), local characteristics of a fabric flaw image need to be emphasized, global information is considered more emphasized by the traditional LDA, the method is characterized in that the global information is kept, meanwhile, the consideration of local geometric information is added, so that the accuracy of the method is improved, meanwhile, the LDA-GSVD algorithm is utilized to solve the problem of small sample high dimension, and the operation speed is accelerated.
The technical scheme adopted by the invention redefines the intra-class scattering matrix and the inter-class scattering matrix to classify different flaws of the fabric image, and the improved LDA-GSVD-based fabric image flaw classification method specifically comprises the following steps:
s1, randomly extracting N pieces of fabric images for feature extraction to obtain a feature matrix X and a label matrix H;
s2, randomly dividing the data set sample into training samples X with labelstrainAnd a labeled test sample Xtest;
S3, using inter-class dispersion weight coefficient Wj,q' and intra-class compact weight coefficient alphajCalculating the intra-class scattering matrix S after adding the local geometric informationWAnd inter-class scattering matrix SB;
S4, using redefinedAndrequired for obtaining GSVDAndthe matrix pair to solve the problem of high dimension of the small sample;
s5, obtaining an optimal projection matrix W through the improved linear discriminant analysis model, and testing a sample XtestAnd (5) obtaining Y by projecting the matrix W to a new subspace, and confirming the sample label of the test set by using a KNN classifier.
The linear discriminant analysis model in S5 is constructed through steps S3 and S4, and the objective function of the original LDA algorithm model is:after improvementThe optimization process of the method has two types, and Lagrangian calculation is utilized or the sum of matrix diagonals, namely the sum of characteristic values is taken. The object model becomestrace is the trace of the matrix and is the sum of the eigenvalues.
Preferably, in step S1, a fabric image dataset is created in MATLAB, N fabric images are feature extracted by a gray level co-occurrence matrix and a gradient direction histogram to obtain an N × N feature matrix X, and an N × 1 label matrix H is created.
Preferably, in step S2, the training sample Xtrain={(x1,y1);(x2,y2)K(xm,ym)},xiIs a 1 xn dimensional vector, and has m samples. k is the number of classes, yi∈{1,2...k},Is a set of class j samples, NjAnd (j ═ 1,2.. k) is the number of j-th samples.
s3.1, setting xj,pAnd xj,mDefining the intra-class cohesion as Q { j } for the p and m samples of the jth class sample, expressed as:
S3.2、Njthe number of samples known as class j, total class k. The in-class cohesion for class k is defined as:
s3.3, taking the class cohesion degree mean value of the k classes as a criterion and judging the criterion to beSetting the compact weight coefficient in class as alphaj,αiIs determined by judging the size of Q { j } and mean, namely:
s3.5, using Wj,qAnd representing the similarity between the class j and the class q, wherein the greater the similarity is, the smaller the difference between the classes is, and according to a similarity formula:
the sample mean of class j can be usedIt is shown that,ujand uqAre all 1 × m matrices.σIs a self-defined parameter.
S3.6, applying a discrimination standard to determine the discrete weight coefficient between different classes,G∈Rk×k,Wmeanis the overall mean of the similarity matrix G:
Wj,q’=Wmean,Wj,q≥Wmean;Wj,q’=Wj,q,Wj,q<Wmean
s3.7, adding the inter-class scattering matrix with the improved inter-class scattering weight coefficient
Preferably, step S4 specifically includes:
s4.2, according to the needed matrix pair of GSVDPerforming singular value decomposition on the matrix pair
S4.3, from SVD decomposition of M (1: k,1: t), M (1: k,1: t) is U sigmaALTCalculating L;
S4.5, taking the first k-1 column of Z as W epsilon Rn×(k-1)W is the projection matrix sought.
Preferably, in step S5, the test sample X is tested according to the projection matrix W obtained in step S4testProjected into a new subspace, i.e. Y ═ XtestAnd multiplying by W, and comparing the label of the Y projected to the subspace, which is estimated by the KNN classifier, of the test set sample with the real label of the test set to obtain the accuracy of the classification result.
The invention also discloses an improved LDA-GSVD-based fabric image defect classification system, which comprises the following modules:
the fabric image feature extraction module is used for randomly extracting N pieces of fabric images to perform feature extraction to obtain a feature matrix X and a label matrix H;
a sample classification module for randomly classifying the characteristic matrix X into training samples X with labelstrainAnd a labeled test sample Xtest;
Redefining the module using inter-class dispersion weight coefficients Wj,q' and intra-class compact weight coefficient alphajCalculating the intra-class scattering matrix S after adding the local geometric informationWAnd inter-class scattering matrix SB;
an output module for obtaining an optimal projection matrix W through the improved linear discriminant analysis model and testing the sample XtestAnd (5) obtaining Y by projecting the matrix W to a new subspace, and confirming the sample label of the test set by using a KNN classifier.
Preferably, in the fabric image feature extraction module, a fabric image dataset is produced in MATLAB, feature extraction is performed on N fabric images through a gray level co-occurrence matrix and a gradient direction histogram to obtain an N × N feature matrix X, and an N × 1 label matrix H is produced.
Preferably, in the sample classification module, the training sample Xtrain={(x1,y1);(x2,y2)K(xm,ym)},xiIs a vector with 1 x n dimensions, and has m samples; k is the number of classes, yi∈{1,2...k},Is a set of class j samples, NjAnd (j ═ 1,2.. k) is the number of j-th samples.
Preferably, alpha in the module is redefinedjAndthe method specifically comprises the following steps:
let xj,pAnd xj,mDefining the intra-class cohesion as Q { j } for the p and m samples of the jth class sample, expressed as:
Njthe number of samples known as class j, total class k; the in-class cohesion for class k is defined as:
taking the class cohesion mean value of the k classes as a criterion and judging the criterion asSetting the compact weight coefficient in class as alphaj,αiIs determined by judging the size of Q { j } and mean, namely:
using Wj,qAnd representing the similarity between the class j and the class q, wherein the greater the similarity is, the smaller the difference between the classes is, and according to a similarity formula:
a criterion is applied to determine discrete weight coefficients between different classes,G∈Rk×k,Wmeanis the overall mean of the similarity matrix G:
Wj,q’=Wmean,Wj,q≥Wmean;Wj,q’=Wj,q,Wj,q<Wmean
Preferably, the calculation module comprises, in particular,
From SVD decomposition of M (1: k,1: t), M (1: k,1: t) is U ΣALTCalculating L;
The first k-1 column of Z is taken as W epsilon Rn×(k-1)W is the projection matrix sought.
Preferably, in the output module, the test sample X is processed according to the projection matrix W obtained by the calculation moduletestProjected into a new subspace, i.e. Y ═ XtestAnd multiplying by W, and comparing the label of the Y projected to the subspace, which is estimated by the KNN classifier, of the test set sample with the real label of the test set to obtain the accuracy of the classification result.
The invention has the beneficial effects that:
the invention is based on an improved LDA-GSVD fabric image flaw classification method, and utilizes inter-class dispersion weight coefficients and intra-class compact weight coefficients to calculate an intra-class dispersion matrix S after local geometric information is addedWAnd inter-class scattering matrix SBThe problem that the fabric image samples are few and the feature dimension is high is solved by using an LDA-GSVD method; meanwhile, the consideration on the local geometric information of the fabric is enhanced, and the function of effectively and accurately classifying the fabric image defects can be realized.
Drawings
FIG. 1 is a schematic flow chart of the method for classifying fabric image defects based on the improved LDA-GSVD;
fig. 2 is 12 fabric defect images of 256 × 256 pixels to be detected based on the improved LDA-GSVD fabric image defect classification method of the present invention, selected from the AITEX data set. Respectively including broken end defect, broken weft defect, pilling, crease, knotting defect, cotton grain, broken yarn, weft yarn curling, edge cutting, warp yarn ball, pollution and dilute weft.
FIG. 3 is a block diagram of the defect classification system of the fabric image based on the improved LDA-GSVD.
Detailed Description
The objects and effects of the present invention will become more apparent from the following further description of the present invention with reference to the accompanying drawings and the detailed description.
As shown in fig. 1, a method for classifying fabric image defects based on the improved LDA-GSVD according to the preferred embodiment of the present invention is implemented as follows:
in step S1, randomly selecting the same number of pieces of each of 12 256 × 256 fabric defect images to be detected, N pieces in total, adjusting the size of the image to 64 × 64, performing feature extraction by a method of fusion of GLCM (gray level co-occurrence matrix) and HOG (histogram in gradient direction), wherein the feature dimension is N, obtaining an N × N feature matrix X, and making an N × 1 label matrix H;
in step S2, 70% of X and H obtained in step 1 are randomly selected as a training set XtrainObtaining the corresponding training set label as HtrainThe remainder being test set XtestThe corresponding test set label is Htest;
Training sample Xtrain={(x1,y1);(x2,y2)K(xm,ym)},xiIs a 1 xn dimensional vector, and has m samples. k is the number of classes, and in a specific example k is 12. y isi∈{1,2...k},Is a set of class j samples, Nj(j 1,2.. k) is the number of jth samples, and the test sample X istest∈R(N-m)×n。
In step S3, the intra-class compact weight coefficient αjAnd redefined intra-class scattering matricesThe method specifically comprises the following steps:
s3.1, setting xj,pAnd xj,mDefining the intra-class cohesion as Q { j } for the p and m samples of the j-th class sample, expressed as:
S3.2、NjThe number of samples known as class j, total class k. The in-class cohesion for class k is defined as:
s3.3, taking the class cohesion degree mean value of the k classes as a criterion and judging the criterion to beSetting the compact weight coefficient in class as alphaj,αiIs determined by judging the size of Q { j } and mean, namely:
After step S3.4, the inter-class dispersion weight coefficient Wj,q' and between-like scattering matricesThe method specifically comprises the following steps:
S35, using Wj,qAnd representing the similarity between the class j and the class q, wherein the greater the similarity is, the smaller the difference between the classes is, and according to a similarity formula:
the sample mean of class j can be usedIt is shown that,ujand uqAre all 1 × m matrices. σ is set to 1e 2.
S3.6, applying a discrimination standard to determine the discrete weight coefficient between different classes,G∈Rk ×k,Wmeanis the overall mean of the similarity matrix G:
Wj,q’=Wmean,Wj,q≥Wmean;Wj,q’=Wj,q,Wj,q<Wmean
s3.7, adding the inter-class scattering matrix with the improved inter-class scattering weight coefficient
Wj,q’=Wmean,Wj,q≥Wmean;Wj,q’=Wj,q,Wj,q<Wmean
Wj,q’=Wmean,Wj,q≥Wmean;Wj,q’=Wj,q,Wj,q<Wmean
matrix pair required by GSVDPerforming singular value decomposition on the matrix pairM∈R(k+m)×(k+m),P∈Rn×n,∑∈R(k+m)×n;
S4.2、t is the rank of the matrix pair. Computing M (1: k,1: t) ═ U Σ from SVD decomposition of M (1: k,1: t)ALT,U∈Rk×k,∑A∈Rk×t,L∈Rt×tSolving L;
s4.3, calculatingP=[P1 P2],P1∈Rn×t,P2∈Rn ×(n-t)。In-tIs an identity matrix of (n-t) × (n-t), ΣtIs sigma (1: t ), the first k-1 column of Z is taken as W epsilon Rn×(k-1)W is the projection matrix sought.
In step S5, according to the projection matrix W obtained in step S4, the test sample X is testedtestProjected into a new subspace, i.e. Y ═ XtestxW, estimating the label of the sample of the test set and the real label H of the test set by the KNN classifier according to Y projected to the subspacetestAnd comparing to obtain the accuracy of the classification result.
In order to verify the performance of the classification method, the method is utilized, the experimental process is executed for ten times, 70% of the experimental process is randomly extracted from a data set sample X as a training sample in each experimental process, after the execution is performed for ten times, the average value is taken as a final detection result, the experimental result is shown in the following table 1, and compared with the LDA and LDA-GSVD method, the linear discriminant analysis algorithm provided by the invention has the highest classification accuracy and has good calculation efficiency.
TABLE 1 comparison table of classification results of fabric image defects in different methods
Method | LDA | LDA-GSVD | The method of the invention |
Accuracy (%) | 46.67 | 62.78 | 66.53 |
Time(s) | 11.88 | 0.22 | 0.28 |
As shown in fig. 3, a system for classifying fabric image defects based on improved LDA-GSVD in accordance with a preferred embodiment of the present invention specifically includes the following modules:
the fabric image feature extraction module randomly selects the same number of pieces of the fabric defect images of 12 types of 256 multiplied by 256 pixels to be detected, wherein the number of the pieces is N, the size of the image is adjusted to 64 multiplied by 64, feature extraction is carried out by a method of fusion of GLCM (gray level co-occurrence matrix) and HOG (histogram in gradient direction), the feature dimension is N, an Nmultiplied by N feature matrix X is obtained, and an Nmultiplied by 1 label matrix H is manufactured;
a sample classification module for randomly selecting 70% of X and H obtained by the fabric image feature extraction module as a training set XtrainObtaining the corresponding training set label as HtrainThe remainder being test set XtestThe corresponding test set label is Htest;
Training sample Xtrain={(x1,y1);(x2,y2)K(xm,ym)},xiIs a 1 xn dimensional vector, and has m samples. k is the number of classes, and in a specific example k is 12. y isi∈{1,2...k},Is a set of class j samples, Nj(j 1,2.. k) is the number of jth samples, and the test sample X istest∈R(N-m)×n。
Redefining modules, compact weight coefficients alpha within classesjAnd redefined intra-class scattering matricesThe method specifically comprises the following steps:
let xj,pAnd xj,mDefining the intra-class cohesion as Q { j } for the p and m samples of the jth class sample, expressed as:
Njthe number of samples known as class j, total class k. The in-class cohesion for class k is defined as:
taking the class cohesion mean value of the k classes as a criterion and judging the criterion asSetting the compact weight coefficient in class as alphaj,αiIs determined by judging the size of Q { j } and mean, namely:
Then, the inter-class dispersion weight coefficient Wj,q' and between-like scattering matricesThe method specifically comprises the following steps:
using Wj,qAnd representing the similarity between the class j and the class q, wherein the greater the similarity is, the smaller the difference between the classes is, and according to a similarity formula:
the sample mean of class j can be usedIt is shown that,ujand uqAre all 1 × m matrices. σ is set to 1e 2.
A criterion is applied to determine discrete weight coefficients between different classes,G∈Rk×k,Wmeanis the overall mean of the similarity matrix G:
Wj,q’=Wmean,Wj,q≥Wmean;Wj,q’=Wj,q,Wj,q<Wmean
Wj,q’=Wmean,Wj,q≥Wmean;Wj,q’=Wj,q,Wj,q<Wmean
Wj,q’=Wmean,Wj,q≥Wmean;Wj,q’=Wj,q,Wj,q<Wmean
matrix pair required by GSVDPerforming singular value decomposition on the matrix pairM∈R(k+m)×(k+m),P∈Rn×n,∑∈R(k+m)×n;
t is the rank of the matrix pair. Computing M (1: k,1: t) ═ U Σ from SVD decomposition of M (1: k,1: t)ALT,U∈Rk×k,∑A∈Rk×t,L∈Rt×tSolving L;
computingP=[P1 P2],P1∈Rn×t,P2∈Rn×(n-t)。In-tIs an identity matrix of (n-t) × (n-t), ΣtIs sigma (1: t ), the first k-1 column of Z is taken as W epsilon Rn×(k-1)W is the projection matrix sought.
The output module is used for outputting the test sample X according to the projection matrix W obtained by the calculation moduletestProjected into a new subspace, i.e. Y ═ XtestxW, estimating the label of the sample of the test set and the real label H of the test set by the KNN classifier according to Y projected to the subspacetestAnd comparing to obtain the accuracy of the classification result.
Claims (10)
1. An improved LDA-GSVD-based fabric image defect classification method is characterized by comprising the following steps:
s1, randomly extracting N pieces of fabric images for feature extraction to obtain a feature matrix X and a label matrix H;
s2, randomly dividing the feature matrix X into training samples X with labelstrainAnd a labeled test sample Xtest;
S3, using inter-class dispersion weight coefficient Wj,q' and intra-class compact weight coefficient alphajCalculating the intra-class scattering matrix S after adding the local geometric informationWAnd inter-class scattering matrix SB;
s5, obtaining an optimal projection matrix W through the improved linear discriminant analysis model, and testing a sample XtestAnd (5) obtaining Y by projecting the matrix W to a new subspace, and confirming the sample label of the test set by using a KNN classifier.
2. The improved LDA-GSVD-based fabric image defect classification method as claimed in claim 1, wherein in step S1, a fabric image dataset is made in MATLAB, feature extraction is performed on N fabric images through a gray level co-occurrence matrix and a gradient direction histogram to obtain an N X N feature matrix X, and an N X1 label matrix H is made.
3. The improved LDA-GSVD-based fabric image defect classification method of claim 1 or 2, wherein in step S2, the training sample Xtrain={(x1,y1);(x2,y2)K(xm,ym)},xiIs a vector with 1 x n dimensions, and has m samples; k is the number of classes, yi∈{1,2...k},Is a set of class j samples, NjAnd (j ═ 1,2.. k) is the number of j-th samples.
4. The improved LDA-GSVD-based fabric image defect classification method of claim 3, wherein a in step S3jAndthe method specifically comprises the following steps:
s3.1, setting xj,pAnd xj,mDefining the intra-class cohesion as Q { j } for the p and m samples of the jth class sample, expressed as:
S3.2、Njthe number of samples known as class j, total class k; the in-class cohesion for class k is defined as:
s3.3, taking the class cohesion degree mean value of the k classes as a criterion and judging the criterion to beSetting the compact weight coefficient in class as alphaj,αiBy judging Q { j } andthe mean is determined by the following steps:
s3.5, using Wj,qAnd representing the similarity between the class j and the class q, wherein the greater the similarity is, the smaller the difference between the classes is, and according to a similarity formula:
the sample mean of class j can be usedIt is shown that,ujand uqAll of which are 1 x m matrices; sigma is a self-defining parameter;
s3.6, applying a discrimination standard to determine the discrete weight coefficient between different classes,G∈Rk×k,Wmeanis the overall mean of the similarity matrix G:
Wj,q’=Wmean,Wj,q≥Wmean;Wj,q’=Wj,q,Wj,q<Wmean
s3.7, adding the inter-class scattering matrix with the improved inter-class scattering weight coefficient
5. The improved LDA-GSVD-based fabric image defect classification method of claim 4, wherein the step S4 specifically comprises,
s4.2, according to the needed matrix pair of GSVDPerforming singular value decomposition on the matrix pair
S4.3, from SVD decomposition of M (1: k,1: t), M (1: k,1: t) is U sigmaALTCalculating L;
S4.5, taking the first k-1 column of Z as W epsilon Rn×(k-1)W is the projection matrix sought.
6. The method for classifying defects based on improved LDA-GSVD fabric image of claim 5, wherein in step S5, the test sample X is processed according to the projection matrix W obtained in step S4testProjected into a new subspace, i.e. Y ═ XtestAnd multiplying by W, and comparing the label of the Y projected to the subspace, which is estimated by the KNN classifier, of the test set sample with the real label of the test set to obtain the accuracy of the classification result.
7. An improved LDA-GSVD-based fabric image flaw classification system is characterized by comprising the following modules:
the fabric image feature extraction module is used for randomly extracting N pieces of fabric images to perform feature extraction to obtain a feature matrix X and a label matrix H;
a sample classification module for randomly classifying the characteristic matrix X into training samples X with labelstrainAnd a labeled test sample Xtest;
Redefining the module using inter-class dispersion weight coefficients Wj,q' and intra-class compact weight coefficient alphajCalculating the intra-class scattering matrix S after adding the local geometric informationWAnd inter-class scattering matrix SB;
an output module for obtaining an optimal projection matrix W through the improved linear discriminant analysis model and testing the sample XtestAnd (5) obtaining Y by projecting the matrix W to a new subspace, and confirming the sample label of the test set by using a KNN classifier.
8. The improved LDA-GSVD-based fabric image defect classification system as recited in claim 7, wherein in the fabric image feature extraction module, a fabric image dataset is made in MATLAB, feature extraction is performed on N fabric images through a gray level co-occurrence matrix and a gradient direction histogram to obtain an Nxn feature matrix X, and an Nx 1 label matrix H is made.
9. The improved LDA-GSVD-based fabric image defect classification system according to claim 7 or 8, wherein in the sample classification module, the training sample Xtrain={(x1,y1);(x2,y2)K(xm,ym)},xiIs a vector with 1 x n dimensions, and has m samples; k is the number of classes, yi∈{1,2...k},Is a set of class j samples, NjAnd (j ═ 1,2.. k) is the number of j-th samples.
10. The improved LDA-GSVD based fabric map of claim 9Image defect classification system, characterized in that alpha in the module is redefinedjAndthe method specifically comprises the following steps:
let xj,pAnd xj,mDefining the intra-class cohesion as Q { j } for the p and m samples of the jth class sample, expressed as:
Njthe number of samples known as class j, total class k; the in-class cohesion for class k is defined as:
taking the class cohesion mean value of the k classes as a criterion and judging the criterion asSetting the compact weight coefficient in class as alphaj,αiIs determined by judging the size of Q { j } and mean, namely:
using Wj,qAnd representing the similarity between the class j and the class q, wherein the greater the similarity is, the smaller the difference between the classes is, and according to a similarity formula:
the sample mean of class j can be usedIt is shown that,ujand uqAll of which are 1 x m matrices; sigma is a self-defining parameter;
a criterion is applied to determine discrete weight coefficients between different classes,G∈Rk×k,Wmeanis the overall mean of the similarity matrix G:
Wj,q’=Wmean,Wj,q≥Wmean;Wj,q’=Wj,q,Wj,q<Wmean
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111126929.5A CN113887600A (en) | 2021-09-26 | 2021-09-26 | Improved LDA-GSVD-based fabric image defect classification method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111126929.5A CN113887600A (en) | 2021-09-26 | 2021-09-26 | Improved LDA-GSVD-based fabric image defect classification method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113887600A true CN113887600A (en) | 2022-01-04 |
Family
ID=79006644
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111126929.5A Pending CN113887600A (en) | 2021-09-26 | 2021-09-26 | Improved LDA-GSVD-based fabric image defect classification method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113887600A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116542956A (en) * | 2023-05-25 | 2023-08-04 | 广州机智云物联网科技有限公司 | Automatic detection method and system for fabric components and readable storage medium |
-
2021
- 2021-09-26 CN CN202111126929.5A patent/CN113887600A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116542956A (en) * | 2023-05-25 | 2023-08-04 | 广州机智云物联网科技有限公司 | Automatic detection method and system for fabric components and readable storage medium |
CN116542956B (en) * | 2023-05-25 | 2023-11-17 | 广州机智云物联网科技有限公司 | Automatic detection method and system for fabric components and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109117826B (en) | Multi-feature fusion vehicle identification method | |
CN110348319B (en) | Face anti-counterfeiting method based on face depth information and edge image fusion | |
CN108765412B (en) | Strip steel surface defect classification method | |
CN101739555B (en) | Method and system for detecting false face, and method and system for training false face model | |
CN107657279B (en) | Remote sensing target detection method based on small amount of samples | |
CN103870811B (en) | A kind of front face Quick method for video monitoring | |
CN102163281B (en) | Real-time human body detection method based on AdaBoost frame and colour of head | |
CN102521561B (en) | Face identification method on basis of multi-scale weber local features and hierarchical decision fusion | |
CN102915453B (en) | Real-time feedback and update vehicle detection method | |
CN104598885B (en) | The detection of word label and localization method in street view image | |
CN103279768B (en) | A kind of video face identification method based on incremental learning face piecemeal visual characteristic | |
CN101930549B (en) | Second generation curvelet transform-based static human detection method | |
CN112488211A (en) | Fabric image flaw classification method | |
CN103186776B (en) | Based on the human body detecting method of multiple features and depth information | |
CN106778714B (en) | LDA face identification method based on nonlinear characteristic and model combination | |
CN104715266B (en) | The image characteristic extracting method being combined based on SRC DP with LDA | |
CN110222660B (en) | Signature authentication method and system based on dynamic and static feature fusion | |
CN113887600A (en) | Improved LDA-GSVD-based fabric image defect classification method and system | |
CN112257600B (en) | Face recognition method and system | |
CN103268494A (en) | Parasite egg identifying method based on sparse representation | |
CN117152625A (en) | Remote sensing small target identification method, system, equipment and medium based on CoordConv and Yolov5 | |
CN110287973B (en) | Image feature extraction method based on low-rank robust linear discriminant analysis | |
CN115797970B (en) | Dense pedestrian target detection method and system based on YOLOv5 model | |
CN111062338A (en) | Certificate portrait consistency comparison method and system | |
CN111553888A (en) | Titanium alloy forging microstructure image identification method based on machine learning |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |