Sample quantitative analysis method based on spectral analysis and related device

Through cluster analysis, the matrix category of spectral samples is determined and the target analysis model is trained, which solves the problem of the influence of matrix effect in spectral analysis and improves the accuracy and efficiency of sample quantitative analysis.

CN119296686APending Publication Date: 2025-01-10TSINGHUA UNIVERSITY +1

Patent Information

Application Number
CN202411502218.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the existing spectral analysis methods, matrix effect affects the accuracy of the analysis results, and due to the lack of prior knowledge and high labeling costs, it is difficult to obtain accurate matrix category classification, resulting in low accuracy of sample quantitative analysis results.

Method used

The cluster analysis method is used to determine the target matrix category of the sample to be analyzed, and quantitative analysis is performed based on this category, which avoids the predefined cluster number and manual labeling errors, and improves the accuracy of matrix category classification and quantitative analysis results. accuracy.

Benefits of technology

The classification of matrix categories through unsupervised clustering analysis reduces labor costs, improves the accuracy of sample quantitative analysis results, and solves the impact of matrix complex samples in spectral quantitative analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119296686A_ABST
    Figure CN119296686A_ABST
Patent Text Reader

Abstract

The invention discloses a sample quantitative analysis method based on spectral analysis and a related device, which can be used in the field of spectral analysis, and the method comprises the following steps: firstly, obtaining to-be-analyzed spectral data of a to-be-detected sample; then, based on the to-be-analyzed spectral data and a plurality of known spectral data, determining a target matrix category corresponding to the to-be-analyzed spectral data through a clustering analysis method; and finally, performing quantitative analysis on the to-be-detected sample through a target analysis model corresponding to the target matrix category. The target analysis model is obtained by training known spectral data belonging to the target matrix category. Therefore, unsupervised clustering analysis is carried out on a large amount of spectral data to divide the matrix category, the number of clusters does not need to be predefined, matrix category labeling does not need to be carried out on the large amount of spectral data in advance, the influence of manual labeling errors on the accuracy of a matrix classification result can be avoided, the matrix category division accuracy is improved, and the accuracy of matrix category division is improved. The accuracy of a quantitative analysis result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of spectral analysis, and in particular to a sample quantitative analysis method based on spectral analysis and related devices. Background Art

[0002] With the widespread application of spectral analysis technology in sample analysis fields such as determining substance concentration, the influence of matrix effects on analysis results has attracted more and more attention.

[0003] At present, supervised learning methods are usually used. First, a classifier is used to classify the category to which the matrix in the sample to be tested belongs; then, based on the matrix category of the sample to be tested, an analysis model corresponding to the matrix category of the sample to be tested is selected from multiple analysis models established separately for each matrix category, and the sample to be tested is quantitatively analyzed, thereby reducing the influence of the matrix category on the analysis result. However, in this spectral analysis scheme of classification first and then quantification, in order to achieve the classification of the category to which the matrix in the sample to be tested belongs, it is necessary to use a spectral data set containing annotations of the matrix category in the sample to train the classifier in advance. In many cases, due to the lack of prior knowledge, it is difficult to determine the number of matrix categories in advance, and it is also difficult to fully cover samples with complex matrices in the spectral data set. The annotation cost required to obtain the spectral data set through manual annotation is high and the annotation error is difficult to avoid, resulting in low accuracy of the matrix classification result, high influence of the matrix effect on the analysis result, and low accuracy of the sample quantitative analysis result.

[0004] Therefore, how to improve the accuracy of sample quantitative analysis results obtained based on spectral analysis has become a problem that needs to be solved. Summary of the invention

[0005] Based on the above problems, the present application provides a sample quantitative analysis method based on spectral analysis and related devices, which can improve the accuracy of the sample quantitative analysis results obtained based on spectral analysis.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] In a first aspect, an embodiment of the present application provides a sample quantitative analysis method based on spectral analysis, the method comprising:

[0008] Obtaining spectral data to be analyzed of the sample to be tested;

[0009] Based on the spectral data to be analyzed and a plurality of known spectral data, determining the target matrix category corresponding to the spectral data to be analyzed by a cluster analysis method;

[0010] The sample to be tested is quantitatively analyzed by a target analysis model corresponding to the target matrix category; the target analysis model is trained using known spectral data belonging to the target matrix category.

[0011] Optionally, the determining the target matrix category corresponding to the spectral data to be analyzed by a cluster analysis method based on the spectral data to be analyzed and a plurality of known spectral data includes:

[0012] Performing hierarchical clustering on the spectral data to be analyzed and the plurality of known spectral data to obtain a first clustering result;

[0013] Based on the number of clusters of the first clustering result under the maximum silhouette coefficient, a plurality of matrix categories are obtained; wherein the matrix category to which the data to be analyzed belongs is the target matrix category.

[0014] Optionally, the quantitative analysis of the sample to be tested by using a target analysis model corresponding to the target matrix category includes:

[0015] Performing model training based on known spectral data contained in the target matrix category to obtain a target analysis model;

[0016] The target analysis model is used to quantitatively analyze the sample to be tested.

[0017] Optionally, the quantitative analysis of the sample to be tested by using a target analysis model corresponding to the target matrix category includes:

[0018] If the target matrix category is included in the plurality of pre-classified matrix categories obtained by hierarchical clustering of the known spectral data in advance, then:

[0019] Based on the target matrix category, determining a target analysis model from a plurality of analysis models corresponding to the pre-classified matrix categories obtained by training with known spectral data in advance;

[0020] The target analysis model is used to quantitatively analyze the sample to be tested.

[0021] Optionally, the determining the target matrix category corresponding to the spectral data to be analyzed by a cluster analysis method based on the spectral data to be analyzed and a plurality of known spectral data includes:

[0022] Determining the distances from the spectral data to be analyzed to the multiple clustering centers based on the clustering centers of the multiple pre-classified matrix categories obtained by performing hierarchical clustering on the known spectral data;

[0023] The target matrix category corresponding to the spectral data to be analyzed is determined based on the minimum value of the distances from the spectral data to be analyzed to the multiple cluster centers.

[0024] Optionally, before obtaining the spectral data to be analyzed of the sample to be tested, the method further includes:

[0025] Acquire multiple known spectral data;

[0026] Performing hierarchical clustering on the plurality of known spectral data to obtain a second clustering result;

[0027] Based on the number of clusters of the second clustering result under the maximum silhouette coefficient, a plurality of pre-classified matrix categories are obtained;

[0028] Based on the known spectral data included in each of the pre-classified matrix categories, model training is performed respectively to obtain a plurality of analysis models corresponding to the pre-classified matrix categories one by one.

[0029] In a second aspect, an embodiment of the present application provides a sample quantitative analysis device based on spectral analysis, the device comprising: an acquisition module, a classification module and an analysis module;

[0030] The acquisition module is used to acquire the spectral data to be analyzed of the sample to be tested;

[0031] The classification module is used to determine the target matrix category corresponding to the spectral data to be analyzed by a cluster analysis method based on the spectral data to be analyzed and a plurality of known spectral data;

[0032] The analysis module is used to perform quantitative analysis on the sample to be tested by using a target analysis model corresponding to the target matrix category; the target analysis model is trained using known spectral data belonging to the target matrix category.

[0033] Optionally, the classification module includes: a clustering unit and a classification unit;

[0034] The clustering unit is used to perform hierarchical clustering on the spectral data to be analyzed and the plurality of known spectral data to obtain a first clustering result;

[0035] The classification unit is used to obtain multiple matrix categories based on the number of clusters of the first clustering result under the maximum silhouette coefficient; wherein the matrix category to which the data to be analyzed belongs is the target matrix category.

[0036] In a third aspect, an embodiment of the present application provides a sample quantitative analysis device based on spectral analysis, the device comprising: a memory and a processor;

[0037] The memory is used to store program code and transmit the program code to the processor;

[0038] The processor is used to execute the steps of the sample quantitative analysis method based on spectral analysis as described in any embodiment of the first aspect according to the program code.

[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is run on a sample quantitative analysis device based on spectral analysis, the sample quantitative analysis device based on spectral analysis performs the steps of the sample quantitative analysis method based on spectral analysis described in any embodiment of the first aspect.

[0040] Compared with the prior art, this application has the following beneficial effects:

[0041] The embodiment of the present application provides a sample quantitative analysis method based on spectral analysis, in which, first, the spectral data to be analyzed of the sample to be tested is obtained; then, based on the spectral data to be analyzed and a plurality of known spectral data, the target matrix category corresponding to the spectral data to be analyzed is determined by a cluster analysis method; finally, the sample to be tested is quantitatively analyzed by a target analysis model corresponding to the target matrix category; the target analysis model is trained using known spectral data belonging to the target matrix category. Thus, by performing unsupervised cluster analysis on a large amount of spectral data to divide the matrix category, it is not necessary to predefine the number of clusters, and it is not necessary to pre-label the matrix category of a large amount of spectral data, which can avoid the influence of manual labeling errors on the accuracy of the matrix classification result, improve the accuracy of the matrix category division, and greatly reduce the labor cost; based on the known spectral data belonging to the same matrix category as the spectral data to be analyzed, the target analysis model is trained, and since the matrix category of the training data is the same as that of the spectral data to be analyzed, the relationship between the spectral intensity and the concentration of the samples to be analyzed is basically the same, and the use of such a target analysis model to quantitatively analyze the sample to be tested can improve the accuracy of the quantitative analysis result. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0043] Figure 1 A flow chart of a sample quantitative analysis method based on spectral analysis provided in an embodiment of the present application;

[0044] Figure 2 A schematic diagram of the principle of dividing matrix categories by hierarchical clustering provided in an embodiment of the present application;

[0045] Figure 3 A schematic diagram of a sample quantitative analysis process based on spectral analysis provided in an embodiment of the present application;

[0046] Figure 4 A flow chart of another sample quantitative analysis method based on spectral analysis provided in an embodiment of the present application;

[0047] Figure 5 A schematic diagram showing the distances from the spectral data to be analyzed to multiple cluster centers in two dimensions provided in an embodiment of the present application;

[0048] Figure 6 A schematic diagram of a sample quantitative analysis device based on spectral analysis provided in an embodiment of the present application;

[0049] Figure 7 A structural diagram of a sample quantitative analysis device based on spectral analysis provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The sample quantitative analysis method based on spectral analysis and related devices provided in the present application can be used in the field of spectral analysis. The above is only an example and does not limit the application field of the sample quantitative analysis method based on spectral analysis and related devices provided in the present application.

[0051] The terms "first", "second", "third" and "fourth" etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.

[0052] In the embodiments of the present application, the words "as an example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "as an example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the words "as an example" or "for example" is intended to present the relevant concepts in a specific way.

[0053] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0054] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0055] Spectral analysis technology is an analytical method that uses the absorption, emission or scattering characteristics of light to identify and determine the composition of a substance. By analyzing spectral data, a quantitative analysis model between substance concentration and spectral intensity can be established to achieve the purpose of obtaining the concentration of an unknown sample through spectral data. Affected by the matrix effect, the relationship between light intensity and concentration follows different laws between samples with large matrix differences, which has a greater impact on the quantitative analysis results of the samples.

[0056] In order to minimize the influence of the matrix on the sample quantitative analysis results and improve the accuracy of the sample quantitative analysis results, the present application provides a sample quantitative analysis method based on spectral analysis.

[0057] See also Figure 1 , which is a flow chart of a sample quantitative analysis method based on spectral analysis provided in an embodiment of the present application, the method comprising:

[0058] S101: Obtaining spectral data to be analyzed of a sample to be tested.

[0059] In this embodiment, equipment such as a laser induced breakdown spectrometer, an ultraviolet-visible spectrophotometer, an infrared spectrometer or a Raman spectrometer can be used to place the sample to be tested under a light source that meets the corresponding test conditions, such as placing the sample to be tested under a light source of a certain wavelength, placing the sample to be tested under infrared radiation, or placing the sample to be tested under a laser light source, etc., and record the spectral signal of the sample under the irradiation of the corresponding light source to obtain the spectral data to be analyzed.

[0060] As an example, the spectral data to be analyzed in this embodiment is spectral data after preprocessing. Among them, preprocessing includes but is not limited to data screening, background removal, and spectral standardization of the spectral data to be analyzed. For example, the spectral data is identified and outliers are removed, and background signals are eliminated and normalized by methods such as polynomial fitting. In this way, the quality of the spectral data to be analyzed can be improved, providing a more accurate basis for subsequent quantitative analysis.

[0061] S102: Based on the spectral data to be analyzed and a plurality of known spectral data, determine the target matrix category corresponding to the spectral data to be analyzed by a cluster analysis method.

[0062] Specifically, the cluster analysis method may include but is not limited to hierarchical clustering and K-means algorithms, wherein K-means has higher computational efficiency than hierarchical clustering, but has a strong dependence on the initial center value, and the division result of the matrix category has a certain randomness. In this embodiment, the analysis method of hierarchical clustering is adopted.

[0063] As an example, the spectral data to be analyzed and a plurality of known spectral data can be hierarchically clustered together to obtain a first clustering result; then, the silhouette coefficients under different numbers of clusters are calculated according to the first clustering result, and the number of clusters when the silhouette coefficient is the largest is selected to divide the matrix category. The matrix category to which the spectral data to be analyzed belongs is the target matrix category. Exemplarily, the known spectral data is the spectral data of a sample with a known concentration, which is pre-stored in a known spectral database, and the plurality of known spectral data can come from samples using multiple types of different matrices.

[0064] Optionally, as new matrices emerge, spectral data of multiple samples using the new matrices may be acquired to update the known spectral database, thereby enriching the spectral data in the known spectral database and improving the accuracy of the matrix classification results for the spectral data to be analyzed.

[0065] See also Figure 2 , which is a schematic diagram of the principle of dividing matrix categories through hierarchical clustering provided in an embodiment of the present application.

[0066] As an example, Figure 2 (a) includes the spectral data to be analyzed and multiple known spectral data. Hierarchical clustering is performed on them to obtain Figure 2 The tree diagram shown in (b) in Figure 1. Hierarchical clustering is an unsupervised learning method that does not require the number of clusters to be specified in advance, but instead builds a nested clustering structure that can be represented as follows: Figure 2 The dendrogram shown in (b) above, where each node represents a cluster and lower nodes are subclusters of higher nodes.

[0067] There are two forms of hierarchical clustering: agglomerative hierarchical clustering and divisive hierarchical clustering. In agglomerative hierarchical clustering, at the beginning, each sample (i.e., the spectral data to be analyzed and multiple known spectral data in this embodiment) is regarded as an independent cluster. In each step, the two clusters closest to each other are merged into a new cluster. This process continues until all samples are merged into a large cluster. In divisive hierarchical clustering, at the beginning, all samples are regarded as one cluster. In each step, a cluster is selected and divided into two smaller clusters. This process continues until each sample becomes an independent cluster. In this embodiment, agglomerative hierarchical clustering can be used as a clustering form to obtain a continuous cluster hierarchy, so that it can be truncated at any specific level according to needs, thereby obtaining a corresponding number of clusters.

[0068] according to Figure 2 The dendrogram shown in (b) can be used to calculate the silhouette coefficient size under different numbers of clusters, such as Figure 2 In (c), it shows the corresponding silhouette coefficients for eight cases where the number of clusters ranges from 2 to 9. The silhouette coefficient is an indicator for evaluating the clustering effect. Its value ranges from -1 to +1. A higher silhouette coefficient indicates that the sample is more similar to its cluster than to other clusters.

[0069] Based on the number of clusters when the silhouette coefficient is the largest, a truncation operation is performed on the dendrogram to divide the matrix, and we can get Figure 2 The matrix classification result is shown in (d). For example, when the number of clusters is 3 when the silhouette coefficient is the largest, a truncation operation is performed on the dendrogram to divide all samples into 3 matrix categories. Among them, the matrix category to which the spectral data to be analyzed belongs is the target matrix category. For example, if the spectral data to be analyzed is classified into category 1, the target matrix category is category 1.

[0070] S103: Performing quantitative analysis on the sample to be tested by using a target analysis model corresponding to the target matrix category.

[0071] As an example, model training may be performed based on known spectral data contained in the target matrix category to obtain a target analysis model corresponding to the target matrix category; and then, the target analysis model is used to perform quantitative analysis on the sample to be tested.

[0072] For example, if the target matrix category contains the spectral data a1 to be analyzed and the set A1 of known spectral data, the many known spectral data in A1 can be divided into a training set and a validation set, and the training set is used to train the quantitative regression model, and the validation set is used to adjust the parameters of the trained quantitative regression model, so as to obtain a target analysis model that can output the concentration of the substance based on the spectral data. Since the training data used by the target analysis model is the same as the matrix category of the spectral data to be analyzed, the relationship between the spectral intensity and the concentration between the samples is basically the same, and the target analysis model can be used to perform quantitative analysis on the samples to be tested, and a relatively accurate quantitative analysis result can be obtained.

[0073] The quantitative regression model may adopt any quantitative regression algorithm, for example, any one of a partial least squares regression (PLSR) algorithm, a support vector regression (SVR) algorithm, and a kernel extreme learning machine (K-ELM) algorithm.

[0074] The embodiment of the present application provides a sample quantitative analysis method based on spectral analysis, in which, first, the spectral data to be analyzed of the sample to be tested is obtained; then, based on the spectral data to be analyzed and a plurality of known spectral data, the target matrix category corresponding to the spectral data to be analyzed is determined by a cluster analysis method; finally, the sample to be tested is quantitatively analyzed by a target analysis model corresponding to the target matrix category; the target analysis model is trained using known spectral data belonging to the target matrix category. Thus, by performing unsupervised cluster analysis on a large amount of spectral data to divide the matrix category, it is not necessary to predefine the number of clusters, and it is not necessary to pre-label the matrix category of a large amount of spectral data, which can avoid the influence of manual labeling errors on the accuracy of the matrix classification result, improve the accuracy of the matrix category division, and greatly reduce the labor cost; based on the known spectral data belonging to the same matrix category as the spectral data to be analyzed, the target analysis model is trained, and since the matrix category of the training data is the same as that of the spectral data to be analyzed, the relationship between the spectral intensity and the concentration of the samples to be analyzed is basically the same, and the use of such a target analysis model to quantitatively analyze the sample to be tested can improve the accuracy of the quantitative analysis result. In addition, since unsupervised cluster analysis is used to classify matrix categories, the matrix effect problem of samples with complex matrices in spectral quantitative analysis can also be better solved.

[0075] See also Figure 3, the figure is a schematic diagram of a sample quantitative analysis process based on spectral analysis provided by an embodiment of the present application, first, spectral data is provided, which may include spectral data to be analyzed and a large amount of known spectral data; then, the spectral data is preprocessed, such as data screening, background removal and spectral standardization; then, the spectral data is clustered by hierarchical clustering to obtain clustering results; then, the number of clusters under the maximum silhouette coefficient (SC) is selected to divide the matrix category, and cluster 1, cluster 2, ..., cluster n are obtained, totaling n matrix categories; an analysis model can be established only for the target matrix category to which the spectral data to be analyzed belongs, or for each matrix category, the known spectral data contained in each matrix category can be used for model training, thereby obtaining model 1, model 2, ..., model n, totaling n analysis models, the analysis model corresponds to the matrix category one by one, and the algorithm used by the analysis model can include but is not limited to any one of PLSR, SVR and K-_ELM. According to the matrix category to which the spectral data to be analyzed belongs, the corresponding analysis model is selected to perform quantitative analysis on it, and the quantitative analysis result of the sample to be tested can be obtained.

[0076] See also Figure 4 , which is a flow chart of another sample quantitative analysis method based on spectral analysis provided in an embodiment of the present application, the method comprising:

[0077] S401: Acquire a plurality of known spectral data.

[0078] Specifically, the known spectral data may be spectral data of a known sample with a known concentration.

[0079] S402: Perform hierarchical clustering on the plurality of known spectral data to obtain a second clustering result.

[0080] S403: Obtain multiple pre-classified matrix categories based on the number of clusters of the second clustering result under the maximum silhouette coefficient.

[0081] As an example, the number of clusters of the second clustering result under the maximum silhouette coefficient is 3, and 3 pre-classified matrix categories are obtained, namely known sample cluster 1, known sample cluster 2 and known sample cluster 3.

[0082] S404: Based on the known spectral data included in each pre-classified matrix category, model training is performed respectively to obtain multiple analysis models corresponding to the pre-classified matrix categories.

[0083] Therefore, before conducting quantitative analysis on the samples to be tested, the known spectral data are first hierarchically clustered to divide them into multiple pre-classified matrix categories, and analysis models corresponding one to one to the pre-classified matrix categories are established. In the subsequent quantitative analysis of the samples to be tested, these analysis models can be directly used without the need to train models corresponding to the pre-classified matrix categories during the qualitative analysis process, which greatly improves the analysis efficiency and reduces the computing resource usage during the qualitative analysis process.

[0084] It can be understood that steps S401 to S404 need only be performed once, and the obtained analysis model can be reused in the process of performing quantitative analysis on multiple samples to be tested.

[0085] S405: Obtain the spectral data to be analyzed of the sample to be tested.

[0086] S406: Based on the cluster centers of the respective multiple pre-classified matrix categories obtained by performing hierarchical clustering on the known spectral data, determine the distances from the spectral data to be analyzed to the multiple cluster centers.

[0087] Specifically, each known spectral data can be regarded as a separate cluster. In the process of agglomerative hierarchical clustering, the two closest clusters are merged into a new cluster until all known spectral data are merged into the same cluster. In the process of divisive hierarchical clustering, starting from a large cluster containing all known spectral data, each cluster is recursively split into two sub-clusters until each cluster contains only one known spectral data. For cluster A containing two sub-clusters a1 and a2, its cluster center can be the weighted average of the cluster center of sub-cluster a1 and the cluster center of sub-cluster a2.

[0088] As an example, the distance from the spectrum to be analyzed to the cluster center can be Euclidean distance, Manhattan distance, or Mahalanobis distance, etc. The distance calculation method can be selected according to actual needs. To visually display the distribution of the spectrum data to be analyzed and the known spectrum data, see Figure 5 , which is a schematic diagram showing the distance from the spectral data to be analyzed to multiple cluster centers in two dimensions provided by an embodiment of the present application. Among them, the pre-classified matrix categories include known sample cluster 1, known sample cluster 2 and known sample cluster 3; the cluster center of known sample cluster 1 is C1, the cluster center of known sample cluster 2 is C2, the cluster center of known sample cluster 3 is C3, and the spectral data to be analyzed is m. Point m is connected to C1, C2 and C3 respectively, and the connecting lines are the distances from the spectral data to be analyzed to the multiple cluster centers.

[0089] S407: Determine the target matrix category corresponding to the spectral data to be analyzed based on the minimum value of the distances from the spectral data to be analyzed to the multiple cluster centers.

[0090] The smaller the distance between the spectral data to be analyzed and the cluster center, the more similar the matrix of the sample to be tested is to the matrix category represented by the cluster center. Therefore, by comparing the distance between the spectral data to be analyzed and each cluster center, the closest matrix category can be determined. Figure 5 In the example, if the distance between the spectral data m to be analyzed and the cluster center C2 is the smallest, it can be determined that the spectral data m to be analyzed belongs to the known sample cluster 2.

[0091] S408: Performing quantitative analysis on the sample to be tested by using a target analysis model corresponding to the target matrix category.

[0092] After determining the target matrix category of the spectral data to be analyzed, the next step is to select the analysis model corresponding to the matrix category for quantitative analysis. Since each matrix category has a specially trained analysis model, the accuracy of the analysis results can be ensured. For example, if the spectral data m to be analyzed is determined to belong to known sample cluster 2, the analysis model corresponding to known sample cluster 2 is selected to perform quantitative analysis on the sample to be analyzed based on the spectral data to be analyzed.

[0093] S409: Output the quantitative analysis results of the sample to be tested.

[0094] Through the above steps, the quantitative analysis results of the sample to be tested can be finally obtained. The results can be used for further research, quality control, production process monitoring, etc. Since the entire analysis process is based on spectral data and cluster analysis, it has high accuracy and efficiency.

[0095] Then, steps S405 to S409 are repeated to perform batch quantitative analysis on the samples to be tested.

[0096] Specifically, once the analysis model is established and the cluster center is determined, the above steps can be repeated to perform quantitative analysis on the samples to be tested in batches. This can not only improve the analysis efficiency, but also reduce the labor cost, making the entire analysis process more automated and standardized.

[0097] In another embodiment, after executing step S405, hierarchical clustering can be performed on the spectral data to be analyzed and multiple known spectral data to obtain a first clustering result; then, based on the number of clusters of the first clustering result under the maximum silhouette coefficient, multiple matrix categories are obtained; wherein the matrix category to which the data to be analyzed belongs is the target matrix category.

[0098] If the pre-classified matrix category includes the target matrix category, then: based on the target matrix category, the target analysis model can be determined from multiple analysis models that correspond one-to-one to the pre-classified matrix category and are pre-trained with known spectral data; and the sample to be tested can be quantitatively analyzed using the target analysis model.

[0099] If the pre-classified matrix category does not include the target matrix category, then: model training is performed based on the known spectral data included in the target matrix category to obtain a target analysis model; and quantitative analysis is performed on the sample to be tested using the target analysis model.

[0100] In this way, the analysis efficiency can be improved and the computing resources occupied in the qualitative analysis process can be reduced, and the matrix classification results can be kept at a high accuracy, thereby making the quantitative analysis results more accurate.

[0101] See also Figure 6 , this figure is a schematic diagram of a sample quantitative analysis device based on spectral analysis provided in an embodiment of the present application, and the device includes: an acquisition module 601, a classification module 602 and an analysis module 603.

[0102] The acquisition module 601 is used to acquire the spectral data to be analyzed of the sample to be tested.

[0103] The classification module 602 is used to determine the target matrix category corresponding to the spectral data to be analyzed by a cluster analysis method based on the spectral data to be analyzed and a plurality of known spectral data.

[0104] The analysis module 603 is used to perform quantitative analysis on the sample to be tested by using a target analysis model corresponding to the target matrix category; the target analysis model is trained using known spectral data belonging to the target matrix category.

[0105] Therefore, by performing unsupervised cluster analysis on a large amount of spectral data to divide the matrix categories, there is no need to predefine the number of clusters, and there is no need to pre-label the matrix categories of a large amount of spectral data, which can avoid the influence of manual labeling errors on the accuracy of the matrix classification results, improve the accuracy of matrix category division, and greatly reduce labor costs; based on known spectral data belonging to the same matrix category as the spectral data to be analyzed, a target analysis model is trained. Since the matrix category of the training data and the spectral data to be analyzed is the same, the relationship between the spectral intensity and the concentration between the samples is basically the same. Using such a target analysis model to perform quantitative analysis on the samples to be tested can improve the accuracy of the quantitative analysis results.

[0106] Optionally, the classification module 602 is specifically used to: determine the distances from the spectral data to be analyzed to the multiple cluster centers based on the cluster centers of the multiple pre-classified matrix categories obtained by hierarchical clustering of the known spectral data; and determine the target matrix category corresponding to the spectral data to be analyzed based on the minimum value of the distances from the spectral data to be analyzed to the multiple cluster centers.

[0107] Optionally, the classification module 602 includes: a clustering unit and a classification unit; wherein the clustering unit is used to perform hierarchical clustering on the spectral data to be analyzed and multiple known spectral data to obtain a first clustering result; the classification unit is used to obtain multiple matrix categories based on the number of clusters of the first clustering result under the maximum silhouette coefficient; wherein the matrix category to which the data to be analyzed belongs is the target matrix category.

[0108] Optionally, the analysis module 603 is specifically used to: perform model training based on known spectral data contained in the target matrix category to obtain a target analysis model; and perform quantitative analysis on the sample to be tested through the target analysis model.

[0109] Optionally, the analysis module 603 is specifically used for: if the target matrix category is included in multiple pre-classified matrix categories obtained by hierarchical clustering of known spectral data in advance, then: based on the target matrix category, determine the target analysis model from multiple analysis models that correspond one-to-one to the pre-classified matrix categories and are obtained by pre-training with known spectral data; and perform quantitative analysis on the sample to be tested through the target analysis model.

[0110] Optionally, the sample quantitative analysis device based on spectral analysis also includes: a pre-training module, which is used to: obtain multiple known spectral data; perform hierarchical clustering on the multiple known spectral data to obtain a second clustering result; obtain multiple pre-classified matrix categories based on the number of clusters of the second clustering result under the maximum silhouette coefficient; perform model training based on the known spectral data included in each pre-classified matrix category, and obtain multiple analysis models that correspond one-to-one to the pre-classified matrix categories.

[0111] See also Figure 7 , this figure is a structural diagram of a sample quantitative analysis device based on spectral analysis provided in an embodiment of the present application, and the device includes: a memory 701 and a processor 702.

[0112] Memory 701: used to store program codes and transmit the program codes to the processor.

[0113] Processor 702: used to execute the steps of the above-mentioned sample quantitative analysis method based on spectral analysis according to the instructions in the program code.

[0114] In addition, the present application also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a sample quantitative analysis device based on spectral analysis, the sample quantitative analysis device based on spectral analysis performs the steps of the above-mentioned sample quantitative analysis method based on spectral analysis.

[0115] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0116] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A sample quantitative analysis method based on spectral analysis, characterized in that: The method comprises: Obtaining spectral data to be analyzed of the sample to be tested; Based on the spectral data to be analyzed and a plurality of known spectral data, determining the target matrix category corresponding to the spectral data to be analyzed by a cluster analysis method; The sample to be tested is quantitatively analyzed by a target analysis model corresponding to the target matrix category; the target analysis model is trained using known spectral data belonging to the target matrix category.

2. The method according to claim 1, characterized in that The method of determining the target matrix category corresponding to the spectral data to be analyzed by a cluster analysis method based on the spectral data to be analyzed and a plurality of known spectral data includes: Performing hierarchical clustering on the spectral data to be analyzed and the plurality of known spectral data to obtain a first clustering result; Based on the number of clusters of the first clustering result under the maximum silhouette coefficient, a plurality of matrix categories are obtained; wherein the matrix category to which the data to be analyzed belongs is the target matrix category.

3. The method according to claim 2, characterized in that The method of performing quantitative analysis on the sample to be tested by using a target analysis model corresponding to the target matrix category includes: Performing model training based on known spectral data contained in the target matrix category to obtain a target analysis model; The target analysis model is used to quantitatively analyze the sample to be tested.

4. The method according to claim 2, characterized in that: The method of performing quantitative analysis on the sample to be tested by using a target analysis model corresponding to the target matrix category includes: If the target matrix category is included in the plurality of pre-classified matrix categories obtained by hierarchical clustering of the known spectral data in advance, then: Based on the target matrix category, determining a target analysis model from a plurality of analysis models corresponding to the pre-classified matrix categories obtained by training with known spectral data in advance; The target analysis model is used to quantitatively analyze the sample to be tested.

5. The method according to claim 1, characterized in that The method of determining the target matrix category corresponding to the spectral data to be analyzed by a cluster analysis method based on the spectral data to be analyzed and a plurality of known spectral data includes: Determining the distances from the spectral data to be analyzed to the multiple clustering centers based on the clustering centers of the multiple pre-classified matrix categories obtained by performing hierarchical clustering on the known spectral data; The target matrix category corresponding to the spectral data to be analyzed is determined based on the minimum value of the distances from the spectral data to be analyzed to the multiple cluster centers.

6. The method according to claim 1, characterized in that Before obtaining the spectral data to be analyzed of the sample to be tested, the method further includes: Acquire multiple known spectral data; Performing hierarchical clustering on the plurality of known spectral data to obtain a second clustering result; Based on the number of clusters of the second clustering result under the maximum silhouette coefficient, a plurality of pre-classified matrix categories are obtained; Based on the known spectral data included in each of the pre-classified matrix categories, model training is performed respectively to obtain a plurality of analysis models corresponding to the pre-classified matrix categories one by one.

7. A sample quantitative analysis device based on spectral analysis, characterized in that: The device comprises: an acquisition module, a classification module and an analysis module; The acquisition module is used to acquire the spectral data to be analyzed of the sample to be tested; The classification module is used to determine the target matrix category corresponding to the spectral data to be analyzed by a cluster analysis method based on the spectral data to be analyzed and a plurality of known spectral data; The analysis module is used to perform quantitative analysis on the sample to be tested by using a target analysis model corresponding to the target matrix category; the target analysis model is trained using known spectral data belonging to the target matrix category.

8. The device according to claim 7, characterized in that The classification module includes: a clustering unit and a classification unit; The clustering unit is used to perform hierarchical clustering on the spectral data to be analyzed and the plurality of known spectral data to obtain a first clustering result; The classification unit is used to obtain multiple matrix categories based on the number of clusters of the first clustering result under the maximum silhouette coefficient; wherein the matrix category to which the data to be analyzed belongs is the target matrix category.

9. A sample quantitative analysis device based on spectral analysis, characterized in that: The device comprises: a memory and a processor; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the steps of the sample quantitative analysis method based on spectral analysis according to any one of claims 1 to 6 according to the program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program. When the computer program is executed on a sample quantitative analysis device based on spectral analysis, the sample quantitative analysis device based on spectral analysis executes the steps of the sample quantitative analysis method based on spectral analysis as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • LIF-LIBS combined rapid analysis device and method for quality of edible oil

    CN107462560A

  • Concentration detection method and system for complex matrix sample

    CN113075201A

  • Information identification method and device, storage medium and electronic equipment

    CN115004191A

  • Near infrared spectrum analysis method based on category mechanism

    CN115656097A

  • Prediction model building method and device for short-term photovoltaic power generation power and prediction method and device for short-term photovoltaic power generation power

    CN118378662A

Cited By

  • Soybean detection method and device based on near infrared spectrum and storage medium

    CN121275688A