A method, device, and storage medium for identifying a solid substance

By acquiring and analyzing multiple Raman spectra of solid substances, combined with pure substance spectra, and using matching degree calculation methods, the composition of solid substances can be accurately identified, solving the problem of inaccurate identification of mixtures in existing technologies and achieving efficient material composition analysis.

CN116642869BActive Publication Date: 2026-01-20北京鉴知技术有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210142258.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-16
Publication Date
2026-01-20
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately identify the composition of solid substances, especially the types and proportions of unknown substances in mixtures, and there is a problem of no matching spectra in the database.

Method used

By acquiring multiple actual Raman spectra of solid substances and Raman spectra of pure substances, the actual Raman spectra are analyzed to generate the target Raman spectrum of the substance to be tested. The matching degree between the substance to be tested and the pure substance is determined based on the matching degree. The matching degree is calculated using the cosine similarity algorithm, and the composition of the substance is determined when the preset threshold is met.

Benefits of technology

It enables accurate identification of solid material components, improving the accuracy and reliability of identifying unknown substances in mixtures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116642869B_ABST
    Figure CN116642869B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a solid substance identification method, device, equipment and storage medium. The method comprises: acquiring a plurality of actual Raman spectra of a solid substance and a Raman spectrum of at least one pure substance; analyzing the plurality of actual Raman spectra to obtain a target Raman spectrum of at least one to-be-measured substance; determining a matching degree of each of the to-be-measured substances and each of the pure substances according to the target Raman spectrum of the at least one to-be-measured substance and the Raman spectrum of the at least one pure substance; and determining that the solid substance comprises a target pure substance when a matching degree of a target to-be-measured substance in the at least one to-be-measured substance and the target pure substance in the at least one pure substance satisfies a preset threshold. The method provided in the embodiments of the present application can accurately identify the composition of the solid substance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of spectral analysis technology, and in particular relates to a method, apparatus, device and storage medium for identifying solid substances. Background Technology

[0002] In some industries, it is necessary to test the composition of solid substances. Raman detection equipment is usually used to collect the Raman spectrum of the solid substance to be tested and identify the characteristics of the Raman spectrum to determine the composition of the solid substance.

[0003] In practical work, the solid substances that need to be detected are generally mixtures. Raman detection equipment is usually used to collect the Raman spectrum of the solid substance. Then, the Raman spectrum of the solid substance is compared with the characteristics of the Raman spectra of various mixtures used as samples in the database. When the Raman spectrum of the solid substance is highly similar to the Raman spectrum of a mixture used as a sample, it is considered that the composition of the solid substance is the same as that of the mixture.

[0004] In actual testing, the types, quantities, and proportions of substances in a solid substance are unknown. Furthermore, solid substances often contain interfering components not found in the database. Therefore, the database may not contain Raman spectra of samples with the same types and proportions of substances as the solid substance, making it difficult to accurately identify the components in the solid substance. Summary of the Invention

[0005] This application provides a method, apparatus, device, and storage medium for identifying solid substances, which can accurately identify the composition of solid substances.

[0006] In a first aspect, embodiments of this application provide a method for identifying solid substances, the method comprising:

[0007] Obtain multiple actual Raman spectra of solid substances and the Raman spectrum of at least one pure substance;

[0008] By analyzing multiple actual Raman spectra, the target Raman spectrum of at least one analyte can be obtained.

[0009] Based on the target Raman spectrum of at least one analyte and the Raman spectrum of at least one pure substance, determine the matching degree between each analyte and each pure substance.

[0010] When the matching degree between the target analyte in at least one analyte and the target pure substance in at least one pure substance meets a preset threshold, the solid substance is determined to include the target pure substance.

[0011] In one possible implementation, multiple actual Raman spectra are analyzed to obtain the target Raman spectrum of at least one analyte, including:

[0012] At least one first Raman spectrum is generated based on the number of wavenumbers in each actual Raman spectrum. The number of intensity values ​​of the first Raman spectrum is the same as the number of wavenumbers, and the intensity value of the first Raman spectrum at each wavenumber is a random number within a preset range.

[0013] Configure a first weight for each of the first Raman spectra, wherein the first weight is a random number within the preset value range;

[0014] Calculate the theoretical Raman spectrum of the solid material based on each first Raman spectrum and the first weight;

[0015] When the deviation between the theoretical Raman spectrum and the actual Raman spectrum meets the first preset threshold, at least one first Raman spectrum is determined as the target Raman spectrum of at least one substance to be tested.

[0016] In one possible implementation, multiple actual Raman spectra are analyzed to obtain the target Raman spectrum of at least one analyte, including:

[0017] Based on multiple actual Raman spectra, an actual spectral feature matrix is ​​generated, which includes the intensity values ​​of different wavenumbers in the actual Raman spectra collected at at least one sampling point of the solid material.

[0018] The actual spectral feature matrix is ​​analyzed to obtain the target spectral matrix of the solid material. The target spectral matrix includes the intensity values ​​of different wavenumbers in the Raman spectrum of each substance to be tested in the solid material.

[0019] Based on the target spectral matrix, a target Raman spectrum of at least one analyte is generated.

[0020] In one possible implementation, the target spectral matrix of the solid material is obtained by analyzing the actual spectral feature matrix, including:

[0021] Based on the actual spectral feature matrix, a first spectral matrix and a first weight matrix calculated N times are generated. The first spectral matrix calculated in the kth time of the N calculations includes the intensity values ​​of different wavenumbers in the Raman spectra of the Q analytes. The first weight matrix calculated in the kth time of the N calculations includes the weight of each analyte among the Q analytes. Where k = Q, 1 ≤ Q ≤ N, and N is an integer.

[0022] Based on the first spectral matrix calculated in the kth calculation and the first weight matrix calculated in the kth calculation, calculate the theoretical spectral characteristic matrix of Q substances to be tested;

[0023] When the deviation between the theoretical spectral feature matrix and the actual spectral feature matrix of the Q substances to be tested meets the first preset threshold, the first spectral matrix of the Q substances to be tested is determined as the target spectral matrix of the Q substances to be tested.

[0024] Among them, the first spectral matrix calculated in the kth calculation in the Nth calculation and the first weight matrix calculated in the kth calculation in the Nth calculation are obtained after p iterations, 0≤p<P, where P is the preset maximum number of iterations.

[0025] Secondly, embodiments of this application provide a device for identifying solid substances, the device comprising:

[0026] The acquisition module is used to acquire multiple actual Raman spectra of solid substances and the Raman spectrum of at least one pure substance;

[0027] The analysis module is used to analyze multiple actual Raman spectra to obtain the target Raman spectrum of at least one substance to be tested;

[0028] The determination module is used to determine the matching degree between each analyte and each pure substance based on the target Raman spectrum of at least one analyte and the Raman spectrum of at least one pure substance; it is also used to determine that the solid substance includes the target pure substance when the matching degree between the target analyte in at least one analyte and the target pure substance in at least one pure substance meets a preset threshold.

[0029] In one possible implementation, the parsing module is specifically used for:

[0030] Based on the number of wavenumbers in each actual Raman spectrum, at least one first Raman spectrum is generated. The number of intensity values ​​of the first Raman spectrum is the same as the number of wavenumbers, and the intensity of the first Raman spectrum at each wavenumber is a random number within a preset range.

[0031] Configure a first weight for each of the first Raman spectra, wherein the first weight is a random number within the preset value range;

[0032] Calculate the theoretical Raman spectrum of the solid material based on each first Raman spectrum and the first weight;

[0033] When the deviation between the theoretical Raman spectrum and the actual Raman spectrum meets the first preset threshold, at least one first Raman spectrum is determined as the target Raman spectrum of at least one substance to be tested.

[0034] In one possible implementation, the apparatus further includes a generation module;

[0035] The generation module is used to generate an actual spectral feature matrix based on each actual Raman spectrum. The actual spectral feature matrix includes intensity values ​​at different wavenumbers collected from at least one sampling point of the solid material.

[0036] The parsing module is specifically used for:

[0037] The actual spectral feature matrix is ​​analyzed to obtain the target spectral matrix of the solid material. The target spectral matrix includes the intensity value of each analyte in the solid material at different wavenumbers.

[0038] The generation module is also used to generate the target Raman spectrum of at least one analyte based on the target spectral matrix.

[0039] Thirdly, embodiments of this application provide an electronic device, the device including: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the method as described in the first aspect or any possible implementation of the first aspect.

[0040] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the method as described in the first aspect or any possible implementation thereof.

[0041] Fifthly, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform a method as described in the first aspect or any possible implementation thereof.

[0042] This application provides a method, apparatus, device, and storage medium for identifying solid substances. First, multiple actual Raman spectra of the solid substance and the Raman spectrum of at least one pure substance are acquired. Second, the multiple actual Raman spectra are analyzed to obtain the target Raman spectrum of at least one analyte; the target spectrum represents the Raman spectrum of the analyte that may be included in the solid substance. Third, based on the target Raman spectrum of the at least one analyte and the Raman spectrum of the at least one pure substance, the matching degree between each analyte and each pure substance is determined. Finally, when the matching degree between the target analyte in the at least one analyte and the target pure substance in the at least one pure substance meets a preset threshold, it indicates that the target analyte and the target pure substance are the same substance, confirming that the solid substance includes the target pure substance, thus achieving accurate identification of the components of the solid substance. Attached Figure Description

[0043] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a schematic flowchart of a method for identifying solid substances provided in an embodiment of this application;

[0045] Figure 2This is a schematic diagram of the actual Raman spectrum provided in the embodiments of this application;

[0046] Figure 3 This is a schematic diagram of the target Raman spectrum of the substance to be tested provided in the embodiments of this application;

[0047] Figure 4 This is a schematic diagram of the Raman spectrum of the pure substance provided in the embodiments of this application;

[0048] Figure 5 This is a schematic diagram of the structure of a solid substance identification device provided in an embodiment of this application;

[0049] Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0050] The features and exemplary embodiments of various aspects of this application will now be described in detail. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain this application and are not configured to limit this application. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples of this application.

[0051] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0052] To facilitate understanding, the technical terms used in this application will be introduced below.

[0053] Raman spectroscopy is a type of molecular spectroscopy based on the Raman effect. The Raman effect refers to the phenomenon where, when a substance is irradiated with monochromatic excitation light, a series of Raman scattered lights with wavelengths greater than and less than the incident light wavelength are produced. These Raman scattered lights, with varying intensities at different wavelengths, constitute the Raman spectrum. The shift in wavelength of these scattered lights relative to the excitation light wavelength corresponds to the type of molecular functional groups in the substance, while the intensity reflects the number of these functional groups. Therefore, Raman spectroscopy can be used for qualitative and quantitative analysis of molecules. For example, in the qualitative identification of an unknown substance, its Raman spectrum can be collected and matched with the spectra of known substances in a database. The known substance with the highest matching degree can be used as the qualitative identification result.

[0054] In some industries, it is necessary to analyze the composition of solid substances. Raman spectroscopy is typically used to acquire the Raman spectrum of the solid substance and identify its characteristics to determine its composition. In practice, the solid substances being analyzed are usually mixtures. Raman spectra are acquired and compared with those of various mixtures in a database. If the similarity between the solid's Raman spectrum and that of a particular mixture is high, the solid is considered to have the same composition. However, in actual testing, the types, quantities, and proportions of substances in a solid are unknown, and interfering components not found in the database are common. Therefore, the database may not contain Raman spectra of samples with the same types and proportions of substances as the solid, making accurate identification of the solid's composition difficult.

[0055] To address the problems of existing technologies, embodiments of this application provide a method, apparatus, device, and computer storage medium for identifying solid substances. Utilizing the non-uniform distribution characteristic of mixtures, firstly, multiple actual Raman spectra of the solid substance and the Raman spectrum of at least one pure substance are acquired; secondly, the multiple actual Raman spectra are analyzed to obtain the target Raman spectrum of at least one analyte, which represents the Raman spectrum of the analyte that may be included in the solid substance; thirdly, based on the target Raman spectrum of at least one analyte and the Raman spectrum of at least one pure substance, the matching degree between each analyte and each pure substance is determined; finally, when the matching degree between the target analyte in at least one analyte and the target pure substance in at least one pure substance meets a preset threshold, it indicates that the target analyte and the target pure substance are the same substance, confirming that the solid substance includes the target pure substance, thus achieving accurate identification of the components of the solid substance.

[0056] The method provided in this application is executed by a terminal with Raman spectrum acquisition and Raman spectrum calculation functions, such as a Raman detection device.

[0057] The following will combine Figure 1 This application provides a detailed description of a method for identifying solid substances according to its embodiments.

[0058] like Figure 1 As shown, the method may include the following steps:

[0059] S110, to obtain multiple actual Raman spectra of solid substances and the Raman spectrum of at least one pure substance.

[0060] When passengers pass through customs and other checkpoints, they may be carrying prohibited substances, which are usually solids. Therefore, customs or anti-smuggling agencies need to test the composition of solid substances in passing goods. Staff use Raman detection equipment and other terminals to collect multiple actual Raman spectra at multiple sampling points of the same solid substance. The terminal then retrieves the Raman spectrum of at least one pure substance from databases.

[0061] In this context, "pure substance" refers to a known solid substance with a single composition, and "Raman spectrum of pure substance" refers to the Raman spectrum of a known solid substance with a single composition.

[0062] In one example, a real Raman spectrum of a solid material is as follows: Figure 2 As shown, it includes multiple wavenumbers and the intensity of each wavenumber.

[0063] S120, resolves multiple actual Raman spectra to obtain the target Raman spectrum of at least one substance to be tested.

[0064] An actual Raman spectrum consists of the Raman spectrum of at least one analyte in a solid substance. The terminal resolves multiple actual Raman spectra of the solid substance into at least one Raman spectrum. The at least one Raman spectrum obtained by resolution is calculated and adjusted to obtain the target Raman spectrum of at least one analyte.

[0065] In the method provided in this application embodiment, the non-uniform distribution of solid mixtures is utilized to analyze multiple actual Raman spectra of multiple sampling points of solid substances at the terminal, avoiding the randomness in the process of analyzing only a single actual Raman spectrum, improving the accuracy of the target Raman spectrum obtained by analysis, and each target Raman spectrum represents a substance to be measured, making it easy to identify the substance to be measured represented by each target Raman spectrum.

[0066] S130, determine the matching degree between each analyte and each pure substance based on the target Raman spectrum of at least one analyte and the Raman spectrum of at least one pure substance.

[0067] The terminal calculates the matching degree between the target Raman spectrum of each analyte and the Raman spectrum of each pure substance based on the target Raman spectrum of at least one analyte and the Raman spectrum of at least one pure substance. The matching degree between the target Raman spectrum of each analyte and the Raman spectrum of each pure substance is used as the matching degree between each analyte and each pure substance.

[0068] In some embodiments, the terminal calculates the matching degree between the target Raman spectrum of each analyte and the Raman spectrum of each pure substance using a cosine similarity algorithm, based on the target Raman spectrum of at least one analyte and the Raman spectrum of at least one pure substance. The cosine similarity formula is shown below.

[0069]

[0070] Where A is the target Raman spectrum of a substance to be tested, B is the Raman spectrum of a pure substance in the database, Ai represents the intensity of the target Raman spectrum of a substance to be tested at the i-th wavenumber, and Bi represents the intensity of the Raman spectrum of a pure substance at the i-th wavenumber.

[0071] S140, when the matching degree between the target analyte in at least one analyte and the target pure substance in at least one pure substance meets a preset threshold, the solid substance is determined to include the target pure substance.

[0072] The terminal determines the relationship between the matching degree of the target Raman spectrum of each analyte and the Raman spectrum of each pure substance and a preset threshold. When the matching degree of the target analyte in at least one analyte and the target pure substance in at least one pure substance meets the preset threshold, it indicates that the target analyte and the target pure substance are the same substance, and the solid substance is determined to include the target pure substance.

[0073] Among them, the preset threshold is a threshold set by technicians in advance according to actual needs.

[0074] In one example, the terminal resolved multiple actual Raman spectra to obtain the target Raman spectra of three analytes, such as... Figure 3 As shown, the Raman spectra of three pure substances whose matching degree with the target analyte in the three analytes meets the preset threshold are as follows: Figure 4 As shown. Figure 4 The Raman spectra from top to bottom are those of sodium bicarbonate, white sugar, and starch, confirming that the solid substance contains three substances: sodium bicarbonate, white sugar, and starch.

[0075] The method provided in this application utilizes the non-uniform distribution characteristic of solid mixtures. First, multiple actual Raman spectra of the solid substance and the Raman spectrum of at least one pure substance are obtained. Second, the multiple actual Raman spectra are analyzed to obtain the target Raman spectrum of at least one analyte, which is the Raman spectrum of the analyte that may be included in the solid substance. Third, based on the target Raman spectrum of at least one analyte and the Raman spectrum of at least one pure substance, the matching degree between each analyte and each pure substance is determined. Finally, when the matching degree between the target analyte in at least one analyte and the target pure substance in at least one pure substance meets a preset threshold, it indicates that the target analyte and the target pure substance are the same substance, and it is determined that the solid substance includes the target pure substance, thus achieving accurate identification of the components of the solid substance.

[0076] In some embodiments, resolving multiple actual Raman spectra to obtain the target Raman spectrum of at least one analyte, i.e., S120, may include the following steps:

[0077] First, at least one first Raman spectrum is generated based on the number of wavenumbers in each actual Raman spectrum.

[0078] The terminal randomly generates at least one first Raman spectrum based on the number of wavenumbers in each actual Raman spectrum.

[0079] In this case, the number of intensity values ​​of the first Raman spectrum is the same as the number of wavenumbers, and the intensity value of the first Raman spectrum at each wavenumber is a random number within a preset range.

[0080] Next, the first weight of each first Raman spectrum is generated.

[0081] The terminal randomly assigns a first weight to each first Raman spectrum. The first weight is a random number within a preset value range.

[0082] Next, the theoretical Raman spectrum of the solid material is calculated based on each first Raman spectrum and the first weight.

[0083] After generating at least one first Raman spectrum and a first weight for each first Raman spectrum, the terminal calculates the theoretical Raman spectrum of the solid material in this calculation based on each first Raman spectrum and the first weight.

[0084] Theoretical Raman spectroscopy refers to the Raman spectrum obtained by Raman spectroscopy detection of a solid substance when the composition of the solid substance is regarded as the composition of the analyte represented by the first Raman spectrum, and the weight of each analyte in the solid substance is the first weight of the first Raman spectrum of each analyte.

[0085] Finally, when the deviation between the theoretical Raman spectrum and the actual Raman spectrum meets the first preset threshold, at least one first Raman spectrum is determined as the target Raman spectrum of at least one substance to be tested.

[0086] After obtaining the theoretical Raman spectrum each time, the terminal calculates the deviation between the theoretical Raman spectrum and the actual Raman spectrum. When the deviation between the theoretical Raman spectrum and the actual Raman spectrum meets the first preset threshold, it indicates that the first Raman spectrum can accurately identify the Raman spectrum of the substance to be tested, and thus it is determined that at least one first Raman spectrum generated this time is the target Raman spectrum of at least one substance to be tested.

[0087] When the deviation between the theoretical Raman spectrum and the actual Raman spectrum does not meet the first preset threshold, the first Raman spectrum and the first weight of the Raman spectrum are updated until the deviation between the theoretical Raman spectrum and the actual Raman spectrum calculated based on the updated first Raman spectrum and the first weight of the Raman spectrum meets the first preset threshold, at least one first Raman spectrum is determined as the target Raman spectrum of at least one substance to be tested.

[0088] The method provided in this application, after randomly generating at least one first Raman spectrum and configuring a first weight for each first Raman spectrum, calculates the theoretical Raman spectrum of the solid substance. When the deviation between the theoretical Raman spectrum and the actual Raman spectrum meets a first preset threshold, it indicates that the first Raman spectrum can accurately identify the Raman spectrum of the substance to be tested. Thus, at least one first Raman spectrum is determined to be the target Raman spectrum of at least one substance to be tested, and a more accurate target Raman spectrum of at least one substance to be tested is calculated.

[0089] In some embodiments, resolving multiple actual Raman spectra to obtain the target Raman spectrum of at least one analyte, i.e., S120, may include the following steps:

[0090] First, an actual spectral feature matrix is ​​generated based on multiple actual Raman spectra.

[0091] The terminal generates an actual spectral feature matrix based on the wavenumbers in multiple actual Raman spectra and the intensity value corresponding to each wavenumber.

[0092] The actual spectral feature matrix includes the intensity values ​​of different wavenumbers in the actual Raman spectrum collected at at least one sampling point of the solid material.

[0093] In some embodiments, elements in the same row of the actual spectral feature matrix represent the intensity values ​​of the solid material collected at a sampling point of the solid material at different wavenumbers, and elements in the same column represent the intensity values ​​of the solid material collected at at least one sampling point of the solid material at the same wavenumber.

[0094] In one example, the staff used a terminal to collect 20 actual Raman spectra at 20 sampling points on a solid material, one of which is shown in the image. Figure 2 As shown, at least one analyte is subjected to wavenumbers ranging from 1 to 2000 cm⁻¹. -1 The intensity values ​​are composed of [variables]. The actual spectral feature matrix generated by the terminal based on 20 actual Raman spectra is a matrix V of size m*n, which includes wavenumbers from 1 to 2000 cm⁻¹ in the actual Raman spectra collected from 20 sampling points of the solid material. -1 If the strength value is , then m = 20, n = 2000.

[0095] Then, the actual spectral feature matrix is ​​analyzed to obtain the target spectral matrix of the solid material.

[0096] The terminal analyzes the actual spectral feature matrix to obtain the target spectral matrix of the solid material.

[0097] The target spectral matrix includes the intensity values ​​of the Raman spectrum of each analyte in the solid material at different wavenumbers. For example, the elements in the same row of the target spectral matrix represent the intensity values ​​of an analyte at different wavenumbers.

[0098] Finally, based on the target spectral matrix, the target Raman spectrum of at least one analyte is generated.

[0099] The terminal disassembles the target spectral matrix and generates a target Raman spectrum of the same substance at different wavenumbers based on the intensity of the same substance in the target spectral matrix, thus obtaining the target Raman spectrum of at least one substance.

[0100] In some embodiments, the elements in the same row of the target spectral matrix are the intensity values ​​of the same analyte at different wavenumbers. The target Raman spectrum of the analyte is generated based on the elements in each row of the target spectral matrix, thereby obtaining the target Raman spectrum of at least one analyte.

[0101] In one example, based on the fact that the target spectral matrix includes three rows of elements, the target Raman spectra of the three analytes were generated based on the elements of each row of the target spectral matrix, such as... Figure 3 As shown.

[0102] In the method provided in this application embodiment, multiple actual Raman spectra of a solid substance are converted into an actual spectral feature matrix, and the target Raman spectrum of at least one substance to be tested is obtained simply and quickly by analyzing the actual spectral feature matrix.

[0103] In some embodiments, analyzing the actual spectral feature matrix to obtain the target spectral matrix of the solid material may include the following steps:

[0104] First, based on the actual spectral feature matrix, generate the first spectral matrix calculated N times and the first weight matrix calculated N times.

[0105] Staff pre-set the value of N according to the detection scenario. The terminal performs N calculations based on the actual spectral feature matrix, generating the first spectral matrix and the first weight matrix for each of the N calculations.

[0106] In the N calculations, the first spectral matrix H in the k-th calculation is a spectral matrix of size Q*n, which includes the intensity of each of the Q analytes at n different wavenumbers; the first weight matrix W in the k-th calculation in the N calculations is a weight matrix of size m*Q, which includes the weight of each of the Q analytes, where m represents the number of sampling points when collecting the actual Raman spectrum of the solid material; where k = Q, 1 ≤ Q ≤ N, and N is an integer.

[0107] Among them, the first spectral matrix calculated in the kth calculation in the Nth calculation and the first weight matrix calculated in the kth calculation in the Nth calculation are obtained after p iterations, 0≤p<P, where P is the preset maximum number of iterations.

[0108] In some embodiments, during the k-th calculation, values ​​of each element of randomly initialized matrices W and H are generated; the product of matrices W and H is calculated to obtain the theoretical spectral feature matrices of Q analytes; the deviation between the theoretical spectral feature matrices of the Q analytes and the actual spectral feature matrices is calculated; when the deviation does not meet a first preset threshold, the values ​​of each element of matrices W and H are updated through iteration; the product of the updated matrices W and H is calculated to obtain the updated theoretical spectral feature matrix; the deviation between the updated theoretical spectral feature matrix and the actual spectral feature matrix is ​​calculated; when the deviation does not meet the first preset threshold, the values ​​of each element of matrices W and H are updated again through iteration.

[0109] After p iterations, the first spectral matrix and the first weight matrix calculated in the kth iteration of N calculations are obtained.

[0110] In one example, during the k-th calculation, values ​​for each element of the randomly initialized matrix W and matrix H are generated, with values ​​ranging from (0, 1).

[0111] Then, based on the first spectral matrix calculated in the kth calculation and the first weight matrix calculated in the kth calculation, the theoretical spectral characteristic matrix of the Q substances to be tested is calculated.

[0112] The terminal calculates the product of the first weight matrix calculated in the kth calculation and the first spectrum calculated in the kth calculation to obtain the theoretical spectral characteristic matrix of Q substances to be tested.

[0113] Finally, when the deviation between the theoretical spectral feature matrix and the actual spectral feature matrix of the Q substances to be tested meets the first preset threshold, the first spectral matrix of the Q substances to be tested is determined as the target spectral matrix of the Q substances to be tested.

[0114] The terminal calculates the deviation between the theoretical spectral feature matrix and the actual spectral feature matrix of the Q analytes. When the deviation meets a first preset threshold, the first spectral matrix of the Q analytes is determined as the target spectral matrix of the Q analytes. When the deviation does not meet the first preset threshold, a gradient descent algorithm is used for iteration to update the first spectral matrix and the first weight matrix until the deviation between the theoretical spectral feature matrix and the actual spectral feature matrix calculated based on the updated first spectral matrix and the first weight matrix meets the first preset threshold, or the number of iterations equals the preset maximum number of iterations. At this point, the first spectral matrix of the Q analytes is determined as the target spectral matrix of the Q analytes.

[0115] In some embodiments, the terminal may use formula (i) to calculate the deviation between the theoretical spectral feature matrix and the actual spectral feature matrix in the kth calculation.

[0116]

[0117] Where J represents the deviation, V ij Let WH represent the element in the i-th row and j-th column of the actual spectral characteristic matrix V, where WH = L and L represents the theoretical spectral characteristic matrix. ij Let represent the element in the i-th row and j-th column of matrix L, where 1 ≤ i ≤ m and 1 ≤ j ≤ n.

[0118] When the deviation J is greater than the first preset threshold, the partial derivative of the k-th element in the i-th row of the W matrix is ​​calculated using formula (ii).

[0119]

[0120] The partial derivative of the j-th element in the k-th row of the H matrix is ​​calculated using formula (iii).

[0121]

[0122] The step size of each element in the W matrix is ​​calculated using formula (iv).

[0123]

[0124] Where α1 represents the step size of the k-th element in the i-th row of W in the gradient descent algorithm.

[0125] The step size of each element in the H matrix is ​​calculated using formula (5).

[0126]

[0127] Where α2 represents the step size of the j-th element in the k-th row of H in the gradient descent algorithm.

[0128] The elements of matrix W are updated iteratively using formula (6).

[0129] W ik =W ik -α1[(VH T ) ik -(WHH T ) ik Formula (VI)

[0130] The elements of matrix H are updated iteratively using formula (VII).

[0131] H kj =H kj -α2[(WH T ) kj -(W T WH) kj Formula (VII)

[0132] Calculate the product of the first weight matrix W and the first spectral matrix H after iterative update to obtain the updated theoretical spectral feature matrix L. Calculate the deviation between the updated L and the actual spectral feature matrix V. Stop the iteration when the deviation between the updated L and the actual spectral feature matrix V meets the first preset threshold. Determine the first spectral matrix of Q substances to be tested as the target spectral matrix of Q substances to be tested. If the first preset threshold is not met, continue the iteration using formulas (II) to (VII) until the deviation between the updated L and the actual spectral feature matrix V meets the first preset threshold, or the number of iterations reaches the preset maximum number of iterations.

[0133] In one example, N = 5.

[0134] First, the terminal generates a first spectral matrix H and a first weight matrix W based on the actual spectral feature matrix V. H is a 1*n spectral matrix, including the intensity values ​​of one analyte at n different wavenumbers. W is an m*1 weight matrix, including the weight of each analyte at each of the m sampling points. The deviation between the theoretical spectral feature matrix and the actual spectral feature matrix calculated in the first calculation is calculated using formula (I). When the deviation meets a first preset threshold, the first spectral matrix of one analyte is determined as the target spectral matrix of that analyte. When the first preset threshold is not met, the first spectral matrix H and the first weight matrix W calculated in the first calculation are iteratively updated using formulas (II) to (VII) until the deviation between the updated L and the actual spectral feature matrix V meets the first preset threshold, or the iteration count reaches the preset maximum iteration count, at which point the iteration stops.

[0135] Secondly, based on the actual spectral feature matrix V, the terminal generates the first spectral matrix H and the first weight matrix W calculated for the second time. H is a 2*n spectral matrix, including the intensity values ​​of the two analytes at n different wavenumbers. W is an m*2 weight matrix, including the weight of each of the two analytes at each sampling point in m sampling points. The deviation between the theoretical spectral feature matrix and the actual spectral feature matrix calculated for the second time is calculated using formula (I). When the deviation meets the first preset threshold, the first spectral matrix of the two analytes is determined as the target spectral matrix of the two analytes. When the first preset threshold is not met, the first spectral matrix H and the first weight matrix W calculated for the second time are iteratively updated using formulas (II) to (VII) until the deviation between the updated L and the actual spectral feature matrix V meets the first preset threshold, or the iteration count reaches the preset maximum iteration count, at which point the iteration stops.

[0136] Next, the target spectral matrices of the three substances to be tested calculated in the third calculation, the target spectral matrices of the four substances to be tested calculated in the fourth calculation, and the target spectral matrices of the five substances to be tested calculated in the fifth calculation are calculated in sequence.

[0137] The method provided in this application generates a target spectral matrix of at least one analyte in a solid substance based on the actual spectral feature matrix, providing a basis for generating the target Raman spectrum of at least one analyte. Furthermore, the number of analytes in the generated target spectral matrix can be adjusted according to actual needs, meeting the user's needs in various detection scenarios and improving the user experience.

[0138] This application also provides a device for identifying solid substances, such as... Figure 5 As shown, the device 500 may include an acquisition module 510, a parsing module 520, and a determination module 530.

[0139] The acquisition module 510 is used to acquire multiple actual Raman spectra of solid substances and the Raman spectrum of at least one pure substance.

[0140] The analysis module 520 is used to analyze multiple actual Raman spectra to obtain the target Raman spectrum of at least one substance to be tested.

[0141] The determination module 530 is used to determine the matching degree between each analyte and each pure substance based on the target Raman spectrum of at least one analyte and the Raman spectrum of at least one pure substance; it is also used to determine that the solid substance includes the target pure substance when the matching degree between the target analyte in at least one analyte and the target pure substance in at least one pure substance meets a preset threshold.

[0142] This application provides a solid substance identification device that utilizes the non-uniform distribution characteristic of solid mixtures. First, it acquires multiple actual Raman spectra of the solid substance and the Raman spectrum of at least one pure substance. Second, it analyzes the multiple actual Raman spectra to obtain the target Raman spectrum of at least one analyte, which represents the Raman spectrum of the analyte that may be included in the solid substance. Third, based on the target Raman spectrum of the at least one analyte and the Raman spectrum of the at least one pure substance, it determines the matching degree between each analyte and each pure substance. Finally, when the matching degree between the target analyte in the at least one analyte and the target pure substance in the at least one pure substance meets a preset threshold, it indicates that the target analyte and the target pure substance are the same substance, thus determining that the solid substance includes the target pure substance, achieving accurate identification of the solid substance's components.

[0143] In some embodiments, the parsing module 520 may be specifically used for:

[0144] Based on the number of wavenumbers in each actual Raman spectrum, at least one first Raman spectrum is generated. The number of intensity values ​​of the first Raman spectrum is the same as the number of wavenumbers, and the intensity of the first Raman spectrum at each wavenumber is a random number within a preset range.

[0145] Generate a first weight for each of the first Raman spectra, wherein the first weight is a random number within the preset value range;

[0146] Calculate the theoretical Raman spectrum of the solid material based on each first Raman spectrum and the first weight;

[0147] When the deviation between the theoretical Raman spectrum and the actual Raman spectrum meets the first preset threshold, at least one first Raman spectrum is determined as the target Raman spectrum of at least one substance to be tested.

[0148] The apparatus provided in this application calculates the theoretical Raman spectrum of a solid substance after randomly generating at least one first Raman spectrum and a first weight for each first Raman spectrum. When the deviation between the theoretical Raman spectrum and the actual Raman spectrum meets a first preset threshold, it indicates that the first Raman spectrum can accurately identify the Raman spectrum of the substance to be tested. Thus, at least one first Raman spectrum is determined to be the target Raman spectrum of at least one substance to be tested, and a more accurate target Raman spectrum of at least one substance to be tested is calculated.

[0149] In some embodiments, the apparatus 500 may further include a generation module 540.

[0150] The generation module 540 is used to generate an actual spectral feature matrix based on each actual Raman spectrum. The actual spectral feature matrix includes intensity values ​​at different wavenumbers collected at at least one sampling point of the solid material.

[0151] Parsing module 520 can be specifically used for:

[0152] The actual spectral feature matrix is ​​analyzed to obtain the target spectral matrix of the solid material. The target spectral matrix includes the intensity value of each analyte in the solid material at different wavenumbers.

[0153] The generation module 540 is also used to generate a target Raman spectrum of at least one analyte based on the target spectral matrix.

[0154] The apparatus provided in this application converts multiple actual Raman spectra of a solid substance into an actual spectral feature matrix, and then obtains the target Raman spectrum of at least one substance by analyzing the actual spectral feature matrix.

[0155] In some embodiments, the parsing module 520 may also be specifically used for:

[0156] Based on the actual spectral feature matrix, a first spectral matrix and a first weight matrix calculated N times are generated. The first spectral matrix calculated in the kth time of the N calculations includes the intensity values ​​of different wavenumbers in the Raman spectra of Q analytes. The first weight matrix calculated in the kth time of the N calculations includes the weight of each analyte among the Q analytes. Wherein, k = Q, 1 ≤ Q ≤ N, and N is an integer. The first spectral matrix calculated in the kth time of the N calculations and the first weight matrix calculated in the kth time of the N calculations are obtained after p iterations, 0 ≤ p < P, and P is the preset maximum number of iterations.

[0157] Based on the first spectral matrix calculated in the kth calculation and the first weight matrix calculated in the kth calculation, calculate the theoretical spectral characteristic matrix of Q substances to be tested;

[0158] When the deviation between the theoretical spectral feature matrix and the actual spectral feature matrix of the Q substances to be tested meets the first preset threshold, the first spectral matrix of the Q substances to be tested is determined as the target spectral matrix of the Q substances to be tested.

[0159] The device provided in this application generates a target spectral matrix of at least one analyte in a solid substance based on the actual spectral feature matrix, providing a basis for generating the target Raman spectrum of at least one analyte. Furthermore, the number of analytes in the generated target spectral matrix can be adjusted according to actual needs, meeting the user's needs in various detection scenarios and improving the user experience.

[0160] The solid substance identification device provided in this application embodiment performs... Figure 1 The steps in the method shown, and the technical effect of accurately identifying the composition of solid substances, will not be described in detail here for the sake of brevity.

[0161] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application is shown.

[0162] An electronic device may include a processor 601 and a memory 602 storing computer program instructions.

[0163] Specifically, the processor 601 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0164] Memory 602 may include mass storage for data or instructions. For example, and not limitingly, memory 602 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 602 may include removable or non-removable (or fixed) media. Where appropriate, memory 602 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 602 is non-volatile solid-state memory.

[0165] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.

[0166] The processor 601 reads and executes computer program instructions stored in the memory 602 to implement any of the solid substance identification methods in the above embodiments.

[0167] In one example, the electronic device may also include a communication interface 603 and a bus 610. For example, Figure 6 As shown, the processor 601, memory 602, and communication interface 603 are connected through bus 610 and complete communication with each other.

[0168] The communication interface 603 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0169] Bus 610 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 610 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0170] This electronic device can perform the solid substance identification method in the embodiments of this application, thereby achieving the combination Figure 1 The method for identifying solid substances is described.

[0171] Furthermore, in conjunction with the solid substance identification methods in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the solid substance identification methods in the above embodiments.

[0172] Based on the solid substance identification methods in the above embodiments, this application can provide a computer program product for implementation. When the instructions in the computer program product are executed by the processor of an electronic device, they implement any of the solid substance identification methods in the above embodiments.

[0173] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0174] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0175] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0176] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method of identifying a solid substance, characterized by, The method comprises: obtaining a plurality of actual Raman spectra of a solid substance and a Raman spectrum of at least one pure substance; generating an actual spectrum feature matrix according to the plurality of actual Raman spectra, the actual spectrum feature matrix comprising intensity values of different wave numbers in the actual Raman spectra collected at at least one sampling point of the solid substance; analyzing the actual spectrum feature matrix to obtain a target spectrum matrix of the solid substance, the target spectrum matrix comprising intensity values of different wave numbers in the Raman spectrum of each to-be-detected substance in the solid substance; generating a target Raman spectrum of at least one to-be-detected substance according to the target spectrum matrix; determining a matching degree of each to-be-detected substance to each pure substance according to the target Raman spectrum of the at least one to-be-detected substance and the Raman spectrum of the at least one pure substance; when the matching degree of a target to-be-detected substance in the at least one to-be-detected substance to a target pure substance in the at least one pure substance satisfies a preset threshold, determining that the solid substance comprises the target pure substance; wherein the analyzing the actual spectrum feature matrix to obtain the target spectrum matrix of the solid substance comprises: generating an Nth calculation first spectrum matrix and an Nth calculation first weight matrix according to the actual spectrum feature matrix, the first spectrum matrix in the kth calculation of the Nth calculation comprising intensity values of different wave numbers in the Raman spectrum of Q to-be-detected substances, and the first weight matrix in the kth calculation of the Nth calculation comprising weights of each to-be-detected substance in the Q to-be-detected substances; wherein k=Q, 1≤Q≤N, and N is an integer; calculating a theoretical spectrum feature matrix of the Q to-be-detected substances according to the first spectrum matrix in the kth calculation and the first weight matrix in the kth calculation; when a deviation between the theoretical spectrum feature matrix of the Q to-be-detected substances and the actual spectrum feature matrix satisfies a first preset threshold, determining that the first spectrum matrix of the Q to-be-detected substances is the target spectrum matrix of the Q to-be-detected substances; wherein the first spectrum matrix in the kth calculation of the Nth calculation and the first weight matrix in the kth calculation of the Nth calculation are obtained through p times of iterative updates, 0≤p 2. An apparatus for identifying a solid substance, characterized in that The device comprises: an acquisition module configured to acquire a plurality of actual Raman spectra of a solid substance and a Raman spectrum of at least one pure substance; a generation module configured to generate an actual spectrum feature matrix according to each actual Raman spectrum, the actual spectrum feature matrix comprising intensity values of different wave numbers collected at at least one sampling point of the solid substance; an analysis module configured to analyze the actual spectrum feature matrix to obtain a target spectrum matrix of the solid substance, the target spectrum matrix comprising intensity values of different wave numbers of each to-be-detected substance in the solid substance; the generation module is further configured to generate a target Raman spectrum of at least one to-be-detected substance according to the target spectrum matrix; The determining module is configured to determine a matching degree of each of the target substances and each of the pure substances according to the target Raman spectrum of the at least one target substance and the Raman spectrum of the at least one pure substance, and determine that the solid substance includes the target pure substance when the matching degree of a target target substance in the at least one target substance and a target pure substance in the at least one pure substance meets a preset threshold. The analysis module is specifically configured to: generate a first spectrum matrix of N calculations and a first weight matrix of N calculations according to the actual spectrum feature matrix, the first spectrum matrix of the kth calculation in the N calculations including intensity values of different wave numbers in the Raman spectrum of the Q target substances, and the first weight matrix of the kth calculation in the N calculations including weights of each of the Q target substances; wherein k=Q, 1≤Q≤N, and N is an integer; calculate a theoretical spectrum feature matrix of the Q target substances according to the first spectrum matrix of the kth calculation and the first weight matrix of the kth calculation; when a deviation between the theoretical spectrum feature matrix of the Q target substances and the actual spectrum feature matrix meets a first preset threshold, determine that the first spectrum matrix of the Q target substances is a target spectrum matrix of the Q target substances; wherein the first spectrum matrix of the kth calculation in the N calculations and the first weight matrix of the kth calculation in the N calculations are obtained through p times of iterative updates, 0≤p 3. An electronic device, comprising: The device comprises a processor and a memory storing computer program instructions; the processor executes the computer program instructions to implement the solid substance identification method of claim 1.

4. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the solid substance identification method of claim 1.

5. A computer program product, characterised in that, The instructions in the computer program product are executed by the processor of the electronic device, so that the electronic device executes the solid substance identification method of claim 1.

Citation Information

Patent Citations

  • Multi-channel Raman spectrum reconstruction method and terminal equipment, and storage medium

    CN109709085A

  • Spectrum matching method for multi-variety substances aiming at moisture content change

    CN113176225A

  • Spectral image unmixing method based on weighted non-negative matrix factorization and application thereof

    CN113793646A