A spectral classification method and system based on principal component analysis
By using principal component analysis, the spectral feature vector matrix is obtained and the weights are calculated, which solves the problem of classification with high spectral similarity in a small number of samples using traditional methods, and achieves high-precision spectral classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
- Filing Date
- 2022-10-12
- Publication Date
- 2026-06-16
AI Technical Summary
Traditional hyperspectral classification methods struggle to achieve accurate classification when there are few samples and high spectral similarity. Existing methods cannot effectively utilize the multifaceted features of spectral curves, resulting in poor classification performance.
Principal component analysis is used to classify known substances by acquiring their spectra, obtain the principal component feature vector matrix of each category, calculate the weight of the spectrum of the substance to be classified belonging to each category, and select the category with a weight greater than a set threshold as the final classification result.
It enables accurate classification of substances with a small number of samples and high spectral similarity, improving classification accuracy and efficiency, and is suitable for spectral classification with few samples.
Smart Images

Figure CN115546573B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hyperspectral classification technology, and in particular to a spectral classification method and system based on principal component analysis. Background Technology
[0002] Infrared spectra of substances contain information about molecular rotation and vibration, providing a reliable basis for substance classification and quantitative analysis. Traditional hyperspectral classification methods include those based on spectral features and those based on statistical features. Spectral matching classification categorizes spectra based on differences between spectral curves, and commonly used spectral similarity measures include Euclidean distance, spectral angle cosine, and spectral correlation coefficient. However, spectral similarity measures only consider one aspect of the spectral curve's characteristics and cannot fully describe its shape. They are ineffective at distinguishing categories when feature similarity is high, resulting in poor classification performance. Statistical feature-based classification methods require large amounts of data for training and have poor applicability with small sample sizes. Achieving accurate sample classification with a small number of samples and high spectral similarity remains a challenge in spectral classification. Summary of the Invention
[0003] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a spectral classification method and system based on principal component analysis to solve the above-mentioned technical problems.
[0004] To achieve the above and other related objectives, this invention provides a spectral classification method based on principal component analysis, comprising:
[0005] The spectra of known substances are obtained and classified according to categories to obtain different sets of categories, wherein each category includes at least one specific component;
[0006] Principal component analysis was performed on different category sets to obtain the principal component eigenvector matrix for each category;
[0007] The principal component eigenvector matrices of each category are arranged in a specified order to obtain a matrix set;
[0008] Perform principal component analysis on the matrix set again to obtain the total characteristic principal component vector matrix;
[0009] Obtain the spectrum of the substance to be classified, and calculate the weight of the coefficient of each category of the spectrum of the substance to be classified based on the total feature principal component vector matrix;
[0010] The category with a weight greater than a set threshold is selected as the category of the substance to be classified;
[0011] The specific components of the substance to be classified are obtained based on the principal component feature vector matrix of the category of the substance to be classified and the spectrum of the substance to be classified.
[0012] In an optional embodiment of the present invention, the spectra of a known substance are obtained, and the spectra of the known substance are classified according to category to obtain different category sets, specifically including:
[0013] Obtain the spectra of known substances and classify them into m categories, with n subcategories for each category. i A specific component;
[0014] The spectral matrix S is constructed from the spectra of the k-th category set. (k) :
[0015] S (k) = [s1, s2, ... s n ] (k)
[0016] Among them, s i This represents the spectrum of the i-th component in the k-th category set.
[0017] In an optional embodiment of the present invention, principal component analysis is performed on sets of different categories to obtain the principal component eigenvector matrix of each category, specifically including:
[0018] For each type of spectral matrix S (k) Normalization yields the normalized spectral matrix.
[0019] For the normalized spectral matrix Principal component analysis is performed to obtain the principal component vector matrix and principal component matrix for each category.
[0020] Normalize the principal component vector matrices of each category to obtain the normalized principal component eigenvector matrices of each category.
[0021] In an optional embodiment of the present invention, the spectral matrices S of each category are respectively... (k) Normalization yields the normalized spectral matrix. Specifically, it includes:
[0022] The median value is obtained by subtracting the mean from the spectrum of each known substance in each category.
[0023]
[0024] in, It is the mean value of the spectrum of the i-th component in each type of substance;
[0025] Divide the spectrum of each known sample by its own modulus:
[0026]
[0027]
[0028] in, yes The model.
[0029] In an optional embodiment of the present invention, the normalized spectral matrix Principal component analysis is performed to obtain the principal component vector matrix and principal component matrix for each category, which is achieved by the following formula:
[0030]
[0031] Among them, U (k) It is a p×n principal component vector matrix, representing n eigenaxis vectors; V (k) It is an n×n principal component matrix, representing the components of n samples on n feature axes.
[0032] In an optional embodiment of the present invention, the obtained principal component vector matrices of each category are normalized to obtain normalized principal component feature vector matrices of each category. This can be achieved using the following formula:
[0033]
[0034] Among them, U (k) It is a p×n principal component vector matrix, representing n eigenaxis vectors. It's U (k) The transpose of .
[0035] In an optional embodiment of the present invention, the principal component eigenvector matrices of each category are arranged in a specified order to obtain a matrix set, which is achieved by the following formula:
[0036]
[0037] Where Y is a set of matrices, It is the eigenvector matrix of the principal components of each category.
[0038] In an optional embodiment of the present invention, the spectrum of the substance to be classified is obtained, and the weight of the coefficient of the spectrum of the substance to be classified belonging to each category is calculated according to the total feature principal component vector matrix, specifically including:
[0039] Calculate the principal component coefficients c of the spectrum x of the substance to be classified. all :
[0040]
[0041] in, It is the total characteristic principal component vector matrix;
[0042] Calculate the weights of the coefficients of the principal component eigenvector matrix for each category:
[0043] r (k) =||c (k) || / ||c all ||
[0044] Among them, c (k) The coefficients of the principal component eigenvector matrix for each category, ||c (k) || is c (k) The modulus, ||c all || is c all The model.
[0045] In an optional embodiment of the present invention, the specific components of the substance to be classified are obtained based on the principal component feature vector matrix of the category of the substance to be classified and the spectrum of the substance to be classified, specifically including:
[0046] Calculate the components of the substances to be classified and known substances on the characteristic axis matrix;
[0047] The correlation coefficient is calculated based on the components of the substances to be classified and known substances on the characteristic axis matrix;
[0048] Based on the correlation coefficient, determine whether the substance to be classified matches a known substance, and output the classification result.
[0049] To achieve the above objectives, the present invention also provides a spectral classification system based on principal component analysis, the system comprising:
[0050] The first classification module acquires the spectra of known substances and classifies the spectra of the known substances according to categories to obtain different category sets, wherein each category includes at least one specific component;
[0051] The first calculation module performs principal component analysis on sets of different categories to obtain the principal component eigenvector matrix of each category.
[0052] Arrangement module: Arranges the principal component eigenvector matrices of each category in a specified order to obtain a matrix set;
[0053] The second calculation module performs principal component analysis on the matrix set again to obtain the total feature principal component vector matrix.
[0054] The third calculation module: acquires the spectrum of the substance to be classified, and calculates the weight of the coefficient of each category of the spectrum of the substance to be classified based on the total feature principal component vector matrix;
[0055] Second classification module: Select the category with a weight greater than a set threshold as the category of the substance to be classified;
[0056] The third classification module: obtains the specific components of the substance to be classified based on the principal component feature vector matrix of the category of the substance to be classified and the spectrum of the substance to be classified.
[0057] The technical advantage of this invention lies in its proposed spectral classification method based on principal component analysis. This method acquires the spectra of known substances and classifies them according to categories to obtain different category sets, where each category includes at least one specific component. Principal component analysis is then performed on each category set to obtain the principal component eigenvector matrix for each category. These matrices are then arranged in a specified order to obtain a matrix set. Principal component analysis is performed again on the matrix set to obtain a total eigenvector matrix. The spectra of the substance to be classified are acquired, and the weight of the spectral coefficient belonging to each category is calculated based on the total eigenvector matrix. Categories with weights greater than a set threshold are selected as the categories of the substance to be classified. The specific components of the substance to be classified are obtained based on the principal component eigenvector matrix of the categories and the spectra of the substance. This allows for accurate classification of a small number of samples with high spectral similarity. This method has the advantages of requiring few samples and achieving high classification accuracy. It is a novel spectral classification method that can be extended to spectral classification or data classification applications in other bands.
[0058] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0059] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0060] Figure 1 This is a flowchart illustrating a spectral classification method based on principal component analysis, as shown in an exemplary embodiment of this application;
[0061] Figure 2 This is an exemplary embodiment of the present application showing the infrared absorbance spectra of six substances;
[0062] Figure 3 yes Figure 2 The image shows a comparison of the infrared absorbance spectra of the six substances before and after normalization.
[0063] Figure 4 This is an exemplary embodiment of the present application illustrating a principal component feature vector matrix diagram of gasoline.
[0064] Figure 5 This is a principal component feature vector matrix diagram of diesel fuel as illustrated in an exemplary embodiment of this application;
[0065] Figure 6 This is a diagram of the total feature principal component vector matrix shown in an exemplary embodiment of this application;
[0066] Figure 7 This is an exemplary embodiment of the present application showing an infrared absorbance spectrum of a substance to be classified;
[0067] Figure 8 This is an exemplary embodiment of the present application illustrating the coefficients of the spectrum of the substance to be classified on the total feature principal component vector matrix;
[0068] Figure 9 This is an exemplary embodiment of the present application illustrating the coefficient distribution of 92# and 95# gasoline and the coefficient distribution of the substances to be classified;
[0069] Figure 10 This is a block diagram illustrating a spectral classification system based on principal component analysis, as shown in an exemplary embodiment of this application. Detailed Implementation
[0070] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0071] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the illustrations only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0072] First, it's important to clarify that Principal Component Analysis (PCA) is a dimensionality reduction algorithm that transforms multiple indicators into a few principal components. These principal components are linear combinations of the original variables and are uncorrelated with each other, reflecting most of the information in the original data. Generally, when the research question involves multiple variables with strong correlations, we can consider using PCA to simplify the data. Spectral classification methods based on PCA can effectively distinguish feature categories even with small sample sizes and low feature discriminative power.
[0073] Infrared spectra of substances contain information about molecular rotation and vibration, providing a reliable basis for substance classification and quantitative analysis. Traditional hyperspectral classification methods include those based on spectral features and those based on statistical features. Spectral matching classification categorizes spectra based on differences between spectral curves, and commonly used spectral similarity measures include Euclidean distance, spectral angle cosine, and spectral correlation coefficient. However, spectral similarity measures only consider one aspect of the spectral curve's characteristics and cannot fully describe its shape. They are ineffective at distinguishing categories when feature similarity is high, resulting in poor classification performance. Statistical feature-based classification methods require large amounts of data for training and have poor applicability with small sample sizes. Achieving accurate sample classification with a small number of samples and high spectral similarity remains a challenge in spectral classification.
[0074] To address these issues, embodiments of this application propose a spectral classification method based on principal component analysis. Figure 1 This is a flowchart illustrating a spectral classification method based on principal component analysis, as shown in an exemplary embodiment of this application.
[0075] like Figure 1 As shown, in an exemplary embodiment, the spectral classification method based on principal component analysis includes at least steps S110 to S170, which are described in detail below:
[0076] S110, acquire the spectrum of a known substance, and classify the spectrum of the known substance according to category to obtain different category sets, wherein each category includes at least one specific component.
[0077] In an optional embodiment of the present invention, the spectra of a known substance are obtained, and the spectra of the known substance are classified according to category to obtain different category sets, specifically including:
[0078] Obtain the spectra of known substances and classify them into m categories, with n subcategories for each category. i A specific component;
[0079] The spectral matrix S is constructed from the spectra of the k-th category set. (k) :
[0080] S (k) = [s1, s2, ... s n ] (k)
[0081] Among them, s i Let p be a vector representing the spectrum of the i-th component in the k-th category set, corresponding to the spectral band. For hyperspectral data, the spectral dimension is much larger than the number of components, i.e., p >> n, where i is the number of specific components in each category.
[0082] like Figure 2 As shown, the known spectra of substances can be the infrared absorbance spectra of 95# gasoline, 92# gasoline, diesel, aviation kerosene, ethanol, and ethyl acetate. These substances are categorized into four types: gasoline (95# and 92# gasoline), diesel (diesel and aviation kerosene), and ethanol and ethyl acetate (ethanol and ethyl acetate have only one spectrum and are not analyzed separately). Each category has at least one specific component. For the first category (gasoline), the spectra of all components in the category are used to construct a matrix S. (1) S (1) =[s1, s2] (1) Where s1 is the spectrum of 95# gasoline and s2 is the spectrum of 92# gasoline; similarly, the same operation was performed on diesel, ethanol and ethyl acetate to obtain S (2) S (3) S (4) .
[0083] S120, perform principal component analysis on different category sets to obtain the principal component eigenvector matrix of each category.
[0084] In an optional embodiment of the present invention, principal component analysis is performed on sets of different categories to obtain the principal component eigenvector matrix of each category, specifically including:
[0085] For each type of spectral matrix S (k) Normalization yields the normalized spectral matrix.
[0086] The median value is obtained by subtracting the mean from the spectrum of each known substance in each category.
[0087]
[0088] in, It is the mean of the spectrum of the i-th sample among all substances;
[0089] Dividing the spectrum of each known sample by its own modulus yields the normalized spectrum.
[0090]
[0091]
[0092] in, It is the normalized spectral matrix. yes The model.
[0093] like Figure 3 As shown, the infrared absorbance spectra of the six substances were processed according to the above steps to obtain... Figure 3 , Figure 3 yes Figure 2 The image shows a comparison of the infrared absorbance spectra of the six substances before and after normalization. It can be seen that normalizing the spectra not only improves the convergence speed but also enhances the model accuracy to some extent, providing a foundation for subsequent principal component analysis.
[0094] For the normalized spectral matrix Principal component analysis is performed to obtain the principal component vector matrix and principal component matrix for each category.
[0095]
[0096] Among them, U (k) It is a p×n principal component vector matrix, representing n eigenaxis vectors; V (k) It is an n×n principal component matrix, representing the components of n samples on n feature axes, i.e., V (k) The first column represents the components of sample s1 on the n feature axis vectors, the second column represents the components of sample s2 on the n feature axis vectors, and so on.
[0097] Normalize the principal component vector matrices of each category to obtain the normalized principal component eigenvector matrices of each category.
[0098]
[0099] Among them, U (k) It is a p×n principal component vector matrix, representing n eigenaxis vectors. It's U (k) The transpose of .
[0100] like Figure 4 and Figure 5 As shown, principal component analysis was performed on each category, resulting in the principal component eigenvector matrix diagrams for gasoline and diesel categories, respectively.
[0101] S130, Arrange the principal component eigenvector matrices of each category in a specified order to obtain a matrix set.
[0102] In an optional embodiment of the present invention, the principal component eigenvector matrices of each category are arranged in a specified order to obtain a matrix set, which is achieved by the following formula:
[0103]
[0104] Where Y is a set of matrices, It is the eigenvector matrix of the principal components of each category.
[0105] S140, perform principal component analysis on the matrix set again to obtain the total characteristic principal component vector matrix.
[0106] Perform principal component analysis again on the matrix set Y obtained in step S130 according to step S120 to obtain the total eigenvalue principal component vector matrix. If it is necessary to expand the identification of new categories of substances, first perform principal component analysis on the spectra of the new categories of substances to obtain the principal component feature vector matrix of the new categories, and then add it to the original total feature principal component vector matrix for principal component analysis to obtain a new total feature principal component vector matrix.
[0107] S150, obtain the spectrum of the substance to be classified, and calculate the weight of the coefficient of each category of the spectrum of the substance to be classified according to the total feature principal component vector matrix.
[0108] In an optional embodiment of the present invention, the spectrum of the substance to be classified is obtained, and the weight of the coefficient of the spectrum of the substance to be classified belonging to each category is calculated according to the total feature principal component vector matrix, specifically including:
[0109] Calculate the principal component coefficients c of the spectrum x of the substance to be classified. all :
[0110]
[0111] in, It is the total characteristic principal component vector matrix;
[0112] Calculate the weights of the coefficients of the principal component eigenvector matrix for each category:
[0113] r (k) =||c (k) || / ||c all ||
[0114] Among them, c (k) The coefficients of the principal component eigenvector matrix for each category, ||c (k) || is c (k) The modulus, ||call || is c all The model.
[0115] S160, Select the category with a weight greater than a set threshold as the category of the substance to be classified.
[0116] like Figure 8 The coefficients of the spectra of the substances to be classified on the principal component vector matrix are shown, where axis number (1, 2) is gasoline, number (3, 4) is diesel, 5 is ethanol, and 6 is ethyl acetate. The classification threshold is set to 0.8. According to the weight calculation formula, the weight of the spectrum in the gasoline category is 0.998, which is greater than the threshold of 0.8, so it is determined to be in the gasoline category.
[0117] S170, the specific components of the substance to be classified are obtained based on the principal component feature vector matrix of the category of the substance to be classified and the spectrum of the substance to be classified.
[0118] In an optional embodiment of the present invention, the specific components of the substance to be classified are obtained based on the principal component feature vector matrix of the category of the substance to be classified and the spectrum of the substance to be classified, specifically including:
[0119] Calculate the components of the substances to be classified and known substances on the characteristic axis matrix;
[0120] The correlation coefficient is calculated based on the components of the substances to be classified and known substances on the characteristic axis matrix;
[0121] Based on the correlation coefficient, determine whether the substance to be classified matches a known substance, and output the classification result.
[0122] In this context, the coefficient component of the known substance is vector x, and the coefficient component of the substance to be classified is vector y. The correlation coefficient is calculated based on x and y, and the formula for calculating the correlation coefficient r is:
[0123]
[0124] In the formula x i For the target features (i = 1…n); The average value of the target feature; y i Standard spectrum; This is the average value of the standard spectrum.
[0125] The correlation coefficient indicates the degree of linear correlation between two quantities, and |r| ≤ 1. When r = 1, x and y have a positive linear relationship; when r = -1, x and y have a negative linear relationship. The degree of correlation between x and y is determined by how close the r value is to 1 or -1.
[0126] like Figure 9As shown, the coefficient distribution of the substance to be classified is highly similar to that of 92# gasoline, and the spectrum to be classified is determined to be 92# gasoline.
[0127] Figure 10 This is a block diagram illustrating a principal component analysis-based spectral classification system, as shown in an exemplary embodiment of this application. Figure 10 As shown, the system includes:
[0128] First classification module 1010: acquires the spectrum of a known substance and classifies the spectrum of the known substance according to category to obtain different category sets, wherein each category includes at least one specific component;
[0129] First calculation module 1020: Performs principal component analysis on sets of different categories to obtain the principal component eigenvector matrix of each category;
[0130] Arrangement module 1030: Arranges the principal component feature vector matrices of each category in a specified order to obtain a matrix set;
[0131] Second calculation module 1040: Performs principal component analysis on the matrix set again to obtain the total feature principal component vector matrix;
[0132] The third calculation module 1050: acquires the spectrum of the substance to be classified, and calculates the weight of the coefficient of each category of the spectrum of the substance to be classified according to the total feature principal component vector matrix;
[0133] Second classification module 1060: Selects the category with a weight greater than a set threshold as the category of the substance to be classified;
[0134] The third classification module 1070: obtains the specific components of the substance to be classified based on the principal component feature vector matrix of the category of the substance to be classified and the spectrum of the substance to be classified.
[0135] It should be noted that the spectral classification system based on principal component analysis provided in the above embodiments and the spectral classification method based on principal component analysis provided in the above embodiments belong to the same concept. The specific operation methods of each module have been described in detail in the method embodiments and will not be repeated here. In practical applications, the spectral classification system based on principal component analysis provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. This is not a limitation here.
[0136] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
[0137] Throughout this description, numerous specific details, such as examples of components and / or methods, are provided to provide a complete understanding of embodiments of the invention. However, those skilled in the art will recognize that embodiments of the invention may be practiced without one or more of these specific details or by other devices, systems, components, methods, parts, materials, components, etc. In other instances, well-known structures, materials, or operations have not been specifically shown or described in detail to avoid obscuring aspects of embodiments of the invention.
[0138] Throughout this specification, the terms "an embodiment," "embodiment," or "specific embodiment" refer to a particular feature, structure, or characteristic described in connection with an embodiment that is included in at least one embodiment of the invention, but not necessarily in all embodiments. Therefore, the various representations of the phrases "in one embodiment," "in an embodiment," or "in a specific embodiment" in different places throughout the specification do not necessarily refer to the same embodiment. Furthermore, a particular feature, structure, or characteristic of any specific embodiment of the invention can be combined with one or more other embodiments in any suitable manner. It should be understood that other variations and modifications of the embodiments of the invention described and illustrated herein may be based on the teachings herein and will be considered part of the spirit and scope of the invention.
[0139] It should also be understood that one or more of the elements shown in the figures may be implemented in a more separate or more integrated manner, or may even be removed because they are inoperable in certain circumstances or provided because they may be useful for a particular application.
[0140] Furthermore, unless otherwise expressly stated, any arrows in the accompanying drawings should be considered illustrative only and not limiting. Additionally, unless otherwise stated, the term "or" as used herein is generally intended to mean "and / or". Where a term is anticipated to provide a separation or combination capability that is unclear, a combination of components or steps will also be considered as indicated.
[0141] As used herein and throughout the claims below, unless otherwise specified, “a” and “the” include the plural references. Similarly, as used herein and throughout the claims below, unless otherwise specified, “in” means “in” and “on”.
[0142] The above description of the embodiments shown in this invention (including the content set forth in the abstract of the specification) is not intended to be an exhaustive enumeration or to limit the invention to the precise forms disclosed herein. Although specific embodiments and examples of the invention have been described herein for illustrative purposes only, various equivalent modifications are possible within the spirit and scope of the invention, as will be recognized and understood by those skilled in the art. As indicated, these modifications can be made to the invention in accordance with the above description of the embodiments described herein, and such modifications will be within the spirit and scope of the invention.
[0143] This document has generally described the systems and methods in detail to aid in understanding the invention. Furthermore, various specific details have been set forth to provide a general understanding of embodiments of the invention. However, those skilled in the art will recognize that embodiments of the invention can be practiced without one or more specific details, or using other means, systems, accessories, methods, components, materials, parts, etc. In other instances, well-known structures, materials, and / or operations have not been specifically shown or described in detail to avoid obscuring aspects of embodiments of the invention.
[0144] Therefore, although the invention has been described herein with reference to specific embodiments thereof, freedom of modification, various changes and substitutions are also within the scope of the foregoing disclosure, and it should be understood that in some cases, certain features of the invention may be adopted without departing from the scope and spirit of the invention and without corresponding use of other features. Thus, many modifications can be made to adapt a particular environment or material to the essential scope and spirit of the invention. The invention is not intended to be limited to the specific terminology used in the following claims and / or the specific embodiments disclosed as the best mode for carrying out the invention, but the invention will include any and all embodiments and equivalents falling within the scope of the appended claims. Therefore, the scope of the invention will be defined only by the appended claims.
Claims
1. A spectral classification method based on principal component analysis, characterized in that, The method includes: The spectra of known substances are obtained and classified according to categories to obtain different sets of categories, wherein each category includes at least one specific component; Principal component analysis was performed on different category sets to obtain the principal component eigenvector matrix for each category; The principal component eigenvector matrices of each category are arranged in a specified order to obtain a matrix set; Perform principal component analysis on the matrix set again to obtain the total characteristic principal component vector matrix; Obtain the spectrum of the substance to be classified, and calculate the weight of the coefficient of each category of the spectrum of the substance to be classified based on the total feature principal component vector matrix; The category with a weight greater than a set threshold is selected as the category of the substance to be classified; The specific components of the substance to be classified are obtained based on the principal component feature vector matrix of the category of the substance to be classified and the spectrum of the substance to be classified. Specifically, this involves acquiring the spectrum of the substance to be classified and calculating the weight of the spectral coefficient of the substance to be classified belonging to each category based on the total feature principal component vector matrix. Calculate the spectrum of the substance to be classified Principal component coefficients : in, It is the total characteristic principal component vector matrix; Calculate the weights of the coefficients of the principal component eigenvector matrix for each category. : , These are the coefficients of the principal component eigenvector matrix for each category. yes The model, yes The model.
2. The spectral classification method based on principal component analysis according to claim 1, characterized in that, Obtain the spectra of known substances and classify the spectra of the known substances according to categories to obtain different category sets, specifically including: Obtain the spectra of known substances and classify them into m categories, with each category having i specific components; Construct a spectral matrix from the spectra of the k-th category set. : , in, This represents the spectrum of the i-th component in the k-th category set.
3. The spectral classification method based on principal component analysis according to claim 1, characterized in that, Principal component analysis was performed on the sets of different categories to obtain the principal component eigenvector matrix for each category, specifically including: For each type of spectral matrix Normalization yields the normalized spectral matrix. ; For the normalized spectral matrix Principal component analysis is performed to obtain the principal component vector matrix and principal component matrix for each category. Normalize the principal component vector matrices of each category to obtain the normalized principal component eigenvector matrices of each category. .
4. The spectral classification method based on principal component analysis according to claim 3, characterized in that, For each type of spectral matrix Normalization yields the normalized spectral matrix. Specifically, it includes: The median value is obtained by subtracting the mean from the spectrum of each known substance in each category. : , in, It is the mean value of the spectrum of the i-th component in each type of substance; Divide the spectrum of each known sample by its own modulus: , , in, yes The model.
5. The spectral classification method based on principal component analysis according to claim 3, characterized in that, For the normalized spectral matrix Principal component analysis is performed to obtain the principal component vector matrix and principal component matrix for each category, which is achieved by the following formula: in, yes The principal component vector matrix represents One feature axis vector; yes The principal component matrix represents One sample in Components on each characteristic axis.
6. The spectral classification method based on principal component analysis according to claim 3, characterized in that, Normalize the principal component vector matrices of each category to obtain the normalized principal component eigenvector matrices of each category. This can be achieved through the following formula: in, yes The principal component vector matrix represents Each feature axis vector yes The transpose of .
7. The spectral classification method based on principal component analysis according to claim 1, characterized in that, The principal component eigenvector matrices of each category are arranged in a specified order to obtain a matrix set, which is achieved by the following formula: in, It is a matrix set. It is the principal component feature vector matrix of each category, where m represents the total number of categories.
8. The spectral classification method based on principal component analysis according to claim 1, characterized in that, The specific components of the substance to be classified are obtained based on the principal component feature vector matrix of the category and the spectrum of the substance to be classified, specifically including: Calculate the components of the substances to be classified and known substances on the characteristic axis matrix; The correlation coefficient is calculated based on the components of the substances to be classified and known substances on the characteristic axis matrix; Based on the correlation coefficient, determine whether the substance to be classified matches a known substance, and output the classification result.
9. A spectral classification system based on principal component analysis, characterized in that, include: The first classification module acquires the spectra of known substances and classifies the spectra of the known substances according to categories to obtain different category sets, wherein each category includes at least one specific component; The first calculation module performs principal component analysis on sets of different categories to obtain the principal component eigenvector matrix of each category. Arrangement module: Arranges the principal component eigenvector matrices of each category in a specified order to obtain a matrix set; The second calculation module performs principal component analysis on the matrix set again to obtain the total feature principal component vector matrix. The third calculation module: acquires the spectrum of the substance to be classified, and calculates the weight of the coefficient of each category of the spectrum of the substance to be classified based on the total feature principal component vector matrix; Second classification module: Select the category with a weight greater than a set threshold as the category of the substance to be classified; The third classification module: obtains the specific components of the substance to be classified based on the principal component feature vector matrix of the category of the substance to be classified and the spectrum of the substance to be classified. Specifically, this involves acquiring the spectrum of the substance to be classified and calculating the weight of the spectral coefficient of the substance to be classified belonging to each category based on the total feature principal component vector matrix. Calculate the spectrum of the substance to be classified Principal component coefficients : in, It is the total characteristic principal component vector matrix; Calculate the weights of the coefficients of the principal component eigenvector matrix for each category. : , These are the coefficients of the principal component eigenvector matrix for each category. yes The model, yes The model.