Infrared spectrum image recognition method and device based on similarity matching
By using an infrared spectral identification method based on similarity matching, the composition of mixed substances can be automatically identified, solving the problems of inefficiency and low accuracy caused by reliance on human experience in existing technologies, and achieving efficient and accurate infrared spectral identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 元始智能科技(南通)有限公司
- Filing Date
- 2023-01-29
- Publication Date
- 2026-06-02
Smart Images

Figure CN116257776B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of materials testing technology, and in particular to an infrared spectrum identification method and apparatus based on similarity matching. Background Technology
[0002] Infrared spectral identification helps third-party testing organizations inspect and test samples for quality, safety, performance, and environmental aspects, and issue test reports to assess whether samples meet the standards and requirements of regulatory agencies, industry stakeholders, and users in terms of quality, safety, and performance. Therefore, how to accurately identify the infrared spectra of substances is a crucial issue that urgently needs to be addressed in the industry.
[0003] In existing technologies, the identification of infrared spectra of substances typically relies on the human experience of engineers. However, the composition of mixed substances is complex, and the spectral signal distribution of infrared spectra is also complex. It is necessary to manually switch between multiple detection devices to identify the infrared spectra of the base substances that match the infrared spectra of the mixed substances. This not only results in low identification efficiency but also makes the identification results susceptible to the influence of human experience, leading to large identification errors. Summary of the Invention
[0004] This invention provides an infrared spectrum identification method and apparatus based on similarity matching, which solves the shortcomings of existing technologies that rely on human experience for infrared spectrum identification, resulting in low identification efficiency and large identification errors, and achieves automatic and accurate infrared spectrum identification.
[0005] This invention provides an infrared spectral image identification method based on similarity matching, comprising:
[0006] The first characteristic peak is extracted from the infrared spectrum of the substance to be identified, and the second characteristic peak is extracted from the infrared spectra of multiple sample substances in the basic sample library.
[0007] Based on the peak positions of the first characteristic peak and the second characteristic peak, a similarity matching operation is performed on the sample infrared spectra of the plurality of sample substances and the infrared spectra to be identified, and at least one candidate infrared spectra is determined from the sample infrared spectra of the plurality of sample substances.
[0008] Based on the peak position matching degree between the infrared spectrum to be identified and the at least one candidate infrared spectrum, the peak range of the third characteristic peak, and the peak range of the first characteristic peak, a similarity matching operation is performed on the infrared spectrum to be identified and the at least one candidate infrared spectrum to determine at least one target infrared spectrum from the at least one candidate infrared spectrum; the peak range of the third characteristic peak is the characteristic peak extracted from the at least one candidate infrared spectrum.
[0009] Based on the infrared spectrum of the at least one target, the identification result of the infrared spectrum to be identified is obtained.
[0010] According to the present invention, an infrared spectrum identification method based on similarity matching is provided, wherein a similarity matching operation is performed on the infrared spectrum to be identified and the at least one candidate infrared spectrum based on the peak position matching degree between the infrared spectrum to be identified and the at least one candidate infrared spectrum, the peak range of the third characteristic peak, and the peak range of the first characteristic peak, and at least one target infrared spectrum is determined from the at least one candidate infrared spectrum, comprising:
[0011] Based on the peak position matching degree, the peak range of the third characteristic peak and the peak range of the first characteristic peak, the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum is calculated.
[0012] The similarity of the characteristic peaks is sorted, and based on the sorting results, at least one candidate infrared spectrum that matches the infrared spectrum to be identified is determined from the at least one candidate infrared spectrum.
[0013] The candidate infrared spectrum that matches the infrared spectrum to be identified is taken as the target infrared spectrum.
[0014] According to the present invention, an infrared spectrum identification method based on similarity matching is provided, wherein calculating the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum based on the peak position matching degree, the peak range of the third characteristic peak, and the peak range of the first characteristic peak includes:
[0015] Based on the peak range of the third characteristic peak and the peak range of the first characteristic peak, the peak intensity matching degree between the infrared spectrum to be identified and each candidate infrared spectrum is obtained.
[0016] Based on the peak intensity matching degree and the peak position matching degree, the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum is calculated.
[0017] According to the infrared spectrum identification method based on similarity matching provided by the present invention, the step of obtaining the peak intensity matching degree between the infrared spectrum to be identified and each candidate infrared spectrum based on the peak range of the third characteristic peak and the peak range of the first characteristic peak includes:
[0018] For each candidate infrared spectrum, perform the following operation:
[0019] Based on the peak range of the third characteristic peak and the peak range of the first characteristic peak in the current candidate infrared spectrum, a characteristic peak matching pair is obtained; the characteristic peak matching pair includes the third characteristic peak and the first characteristic peak whose peak ranges match each other;
[0020] If the peak range of the third characteristic peak in any characteristic peak matching pair is greater than or equal to the peak range threshold, the peak range of the third characteristic peak in any characteristic peak matching pair is divided by the peak range of the first characteristic peak in any characteristic peak matching pair to obtain the peak intensity matching degree of any characteristic peak matching pair.
[0021] If the peak range of the third characteristic peak in any characteristic peak matching pair is less than the peak range threshold, the peak range of the first characteristic peak in any characteristic peak matching pair is divided by the peak range threshold to obtain the peak intensity matching degree of any characteristic peak matching pair.
[0022] The peak intensity matching degree of all characteristic peak matching pairs corresponding to the current candidate infrared spectrum is fused to obtain the peak intensity matching degree between the infrared spectrum to be identified and the current candidate infrared spectrum.
[0023] According to the present invention, an infrared spectrum identification method based on similarity matching is provided, wherein a similarity matching operation is performed on the sample infrared spectra of a plurality of sample substances and the infrared spectrum to be identified based on the peak positions of the first characteristic peak and the second characteristic peak, and at least one candidate infrared spectrum is determined from the sample infrared spectra of the plurality of sample substances, including:
[0024] Based on the peak positions of the first characteristic peak and the second characteristic peak, the peak position matching degree between the infrared spectrum to be identified and the infrared spectrum of each sample is calculated.
[0025] Based on the peak position matching degree, a similarity matching operation is performed on the sample infrared spectra of the multiple sample substances and the infrared spectra to be identified to obtain at least one candidate infrared spectra.
[0026] According to the infrared spectrum identification method based on similarity matching provided by the present invention, the step of extracting a first characteristic peak from the infrared spectrum of the substance to be identified and extracting a second characteristic peak from the infrared spectra of multiple sample substances in a basic sample library includes:
[0027] Preprocessing is performed on the infrared spectrum of the substance to be identified and the infrared spectrum of the multiple sample substances.
[0028] The first characteristic peak is extracted from the preprocessed infrared spectrum of the sample to be identified, and the second characteristic peak is extracted from the preprocessed infrared spectrum of multiple sample substances.
[0029] The preprocessing includes data clipping, filtering, and standard state transformation.
[0030] According to the present invention, an infrared spectral image identification method based on similarity matching is provided, wherein obtaining the identification result of the infrared spectral image to be identified based on the infrared spectrum of the at least one target includes:
[0031] When there are multiple target infrared spectra, an interpolation algorithm is used to downsample or oversample each target infrared spectrum to ensure that the data format of each target infrared spectrum is consistent after processing.
[0032] The processed infrared spectra of at least one target are superimposed, and the identification result of the infrared spectrum to be identified is obtained based on the superposition result.
[0033] The present invention also provides an infrared spectral image identification device based on similarity matching, comprising:
[0034] The extraction module is used to extract the first characteristic peak from the infrared spectrum of the substance to be identified and to extract the second characteristic peak from the infrared spectra of multiple sample substances in the basic sample library.
[0035] The first similarity matching module is used to perform a similarity matching operation on the sample infrared spectra of the plurality of sample substances and the infrared spectra to be identified based on the peak positions of the first characteristic peak and the second characteristic peak, and to determine at least one candidate infrared spectra in the sample infrared spectra of the plurality of sample substances.
[0036] The second similarity matching module is used to perform a similarity matching operation on the infrared spectrum to be identified and the at least one candidate infrared spectrum based on the peak position matching degree between the infrared spectrum to be identified and the at least one candidate infrared spectrum, the peak range of the third characteristic peak, and the peak range of the first characteristic peak, and to determine at least one target infrared spectrum in the at least one candidate infrared spectrum; the peak range of the third characteristic peak is the characteristic peak extracted from the at least one candidate infrared spectrum;
[0037] The identification module is used to obtain the identification result of the infrared spectrum to be identified based on the infrared spectrum of the at least one target.
[0038] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the infrared spectral image identification method based on similarity matching as described above.
[0039] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the infrared spectral image identification method based on similarity matching as described above.
[0040] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the infrared spectral image identification method based on similarity matching as described above.
[0041] The infrared spectrum identification method and apparatus based on similarity matching provided by this invention extracts the first characteristic peak from the infrared spectrum of the substance to be identified and the second characteristic peak from the infrared spectra of multiple sample substances. Based on the peak positions of the first and second characteristic peaks, a preliminary similarity matching is performed on the infrared spectrum to be identified, identifying at least one candidate infrared spectrum. Then, based on the peak range of the third characteristic peak of the candidate infrared spectrum, the peak range of the first characteristic peak, and the peak position matching degree between the infrared spectrum to be identified and the candidate infrared spectrum, a refined similarity matching is performed on the infrared spectrum to be identified, so as to automatically and accurately obtain the identification result of the infrared spectrum to be identified. The entire identification process can be automatically executed online by electronic devices, avoiding reliance on human experience for identification, and effectively improving the reliability and efficiency of identification. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0043] Figure 1 This is one of the flowcharts of the infrared spectrum identification method based on similarity matching provided by the present invention;
[0044] Figure 2 This is a schematic diagram of the distribution of the infrared spectrum to be identified before preprocessing in the infrared spectrum identification method based on similarity matching provided by the present invention.
[0045] Figure 3 This is a schematic diagram showing the distribution of filtering results in the infrared spectrum identification method based on similarity matching provided by the present invention;
[0046] Figure 4 This is a schematic diagram of the distribution of the preprocessed infrared spectrum to be identified in the infrared spectrum identification method based on similarity matching provided by the present invention;
[0047] Figure 5This is a schematic diagram showing the distribution of linear interpolation results in the infrared spectrum identification method based on similarity matching provided by the present invention.
[0048] Figure 6 This is a schematic diagram showing the distribution of the synthesized spectrum and the infrared spectrum to be identified in the infrared spectrum identification method based on similarity matching provided by the present invention.
[0049] Figure 7 This is the second flowchart of the infrared spectrum identification method based on similarity matching provided by the present invention;
[0050] Figure 8 This is a schematic diagram of the infrared spectrum identification device based on similarity matching provided by the present invention;
[0051] Figure 9 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0053] The number of testing and inspection institutions is gradually increasing. With the economic shift from quantity to quality, related enterprises and institutions have higher requirements for the quality, safety, environmental protection, and energy-saving performance of products or buildings. As a result, the testing and inspection industry has maintained a continuous growth trend.
[0054] Currently, third-party testing agencies use infrared spectroscopy for sample identification. However, existing infrared spectroscopy identification relies primarily on the manual experience of engineers, who require months of specialized training, assessment, and further extensive training before being allowed to work. This lengthy training cycle consumes significant human and material resources. Secondly, in practice, the software can only provide results for single-component identification. Therefore, for mixed substances, repeated manual operations and adjustments based on experience are necessary. Furthermore, when there are significant differences in the composition of substances, multiple testing devices are required. However, data and software between different devices are not interoperable, necessitating manual switching between multiple systems. This results in engineers spending considerable time on image capture and report writing, failing to improve testing efficiency and increasing the risk of errors.
[0055] Therefore, relying solely on traditional human experience for mixed substance identification is not only inaccurate and inefficient, but also wastes a lot of engineers' time.
[0056] To address the aforementioned issues, this embodiment provides an infrared spectrum identification method based on similarity matching. This method performs two similarity matching operations on the infrared spectrum of the substance to be identified and the infrared spectra of multiple sample substances to automatically and accurately identify the infrared spectra of the samples that make up the infrared spectrum of the substance to be identified, thereby obtaining the original components of the substance to be identified. Only one server is needed to identify the infrared spectra of each original sample of the mixed substance, effectively solving the problems of data incompatibility between various systems and low identification accuracy caused by manual experience in identifying the infrared spectra of mixed substances. This improves the reliability of infrared spectrum identification and can also automatically generate reports, saving the time spent on writing reports, saving a lot of manpower, material resources and identification time, improving identification efficiency, and creating greater commercial value.
[0057] The following is combined Figures 1-7 This invention describes an infrared spectral identification method based on similarity matching. The method can be executed by an electronic device equipped with infrared spectral identification capabilities. This electronic device has a complete spectral matching process internally, enabling the identification of infrared spectra of unknown mixtures and thus the identification of material components. The electronic device can be a terminal, such as a mobile phone or computer, or a server, such as an edge server or cloud server. It includes one or more functional modules for implementing each step, such as n modules, including modules for data preprocessing, peak position screening, similarity matching, and identification result output. This embodiment does not specifically limit these modules.
[0058] like Figure 1 The image shown is a flowchart of one of the infrared spectral image identification methods based on similarity matching. This method includes the following steps:
[0059] Step 101: Extract the first characteristic peak from the infrared spectrum of the substance to be identified, and extract the second characteristic peak from the infrared spectra of multiple sample substances in the basic sample library.
[0060] The substance to be identified can be a substance in the fields of chemistry, materials, electronics, biology and food that requires infrared spectral identification. The substance can be a mixture of one or more different basic substances.
[0061] The sample substance is a substance pre-stored in the basic sample library and labeled with its component category. The sample substance can be a single substance.
[0062] Optionally, when an infrared spectrum of the substance to be identified is required, an infrared spectrometer can be used to collect the infrared spectrum of the substance to be identified at a certain sampling frequency and with fixed equipment. The collected infrared spectrum can be directly used as the infrared spectrum of the substance to be identified. Alternatively, the collected infrared spectrum can be processed by noise reduction and / or state transformation, and then the infrared spectrum of the substance to be identified can be obtained to achieve data cleaning, thereby improving the identification efficiency and matching accuracy in the later stage. This embodiment does not specifically limit this.
[0063] Similarly, at least one infrared spectrum of each sample substance can be randomly extracted directly from the basic sample library to form infrared spectra of multiple sample substances; or, after data processing of at least one infrared spectrum of each sample substance randomly extracted from the database, infrared spectra of multiple sample substances can be obtained based on the processing results. This embodiment does not specifically limit this.
[0064] Next, based on machine learning algorithms, characteristic peaks are extracted from the infrared spectra of the substances to be identified to obtain the first characteristic peak; and based on machine learning algorithms, characteristic peaks are extracted from the infrared spectra of each sample substance to obtain the second characteristic peak. Here, characteristic peaks refer to absorption peaks used to identify the presence of chemical bonds or groups. The infrared spectrum of a compound is an objective reflection of its molecular structure; the absorption peaks in the spectrum correspond to the vibrational modes of a certain chemical bond or group in the molecule, and the vibrational frequencies of the same group always appear in a certain region.
[0065] Step 102: Based on the peak positions of the first characteristic peak and the second characteristic peak, perform a similarity matching operation on the sample infrared spectra of the plurality of sample substances and the infrared spectra to be identified, and determine at least one candidate infrared spectra in the sample infrared spectra of the plurality of sample substances.
[0066] Among them, the peak position is the location of the peak point in the characteristic peak.
[0067] Optionally, since the three key elements of qualitative spectral analysis are peak position, peak intensity, and peak shape, designing algorithms suitable for this field requires consideration of numerous factors. Furthermore, the lack of prior knowledge leads to many problems during algorithm design. Therefore, establishing a similarity matching evaluation index is particularly important for spectral identification. In daily spectral identification, many situations can cause peak position shifts, such as inductive effects shifting vibrational frequencies to higher wavenumbers; conjugation effects shifting vibrational frequencies to lower wavenumbers; hydrogen bonding effects reducing stretching frequencies; intramolecular hydrogen bonds significantly affect peak position and are unaffected by concentration, while intermolecular hydrogen bonds are significantly affected by concentration; dilution can alter absorption peak positions. Additionally, considering that in practical spectral identification, there is a relatively strict correspondence between peak positions—if a peak exists in the base sample, it must also be present in the analytical sample; if no peak appears in the analytical sample, then that sample may not be part of the analytical sample. In other words, different infrared spectra have different characteristic peaks, so the characteristic peaks of the basic sample that makes up the substance to be identified will all be reflected in the infrared spectrum of the substance to be identified.
[0068] Therefore, in this embodiment, the principle of identical peak positions is used to perform similarity matching operation on the infrared spectra of multiple sample substances and the infrared spectra to be identified. Based on the degree of peak position matching of characteristic peaks, the infrared spectra of the sample with high similarity to the infrared spectra to be identified are identified, thereby accurately obtaining the identification results of the substance to be identified, and further identifying the synthetic components of the substance to be identified.
[0069] Furthermore, the similarity matching operation based on peak position can be performed by: calculating the similarity between the infrared spectrum to be identified and each sample infrared spectrum using a similarity calculation formula based on peak position; and then performing a matching operation based on the similarity to roughly screen out sample infrared spectra with high similarity to the infrared spectrum to be identified as candidate infrared spectra; or matching the peak position of the first characteristic peak in the infrared spectrum to be identified with the peak position of the second characteristic peak in each sample infrared spectrum to determine the similarity between the infrared spectrum to be identified and each sample infrared spectrum based on the matching result, and then roughly screening out sample infrared spectra with high similarity to the infrared spectrum to be identified as candidate infrared spectra. This embodiment does not specifically limit this method.
[0070] Step 103: Based on the peak position matching degree between the infrared spectrum to be identified and the at least one candidate infrared spectrum, the peak range of the third characteristic peak, and the peak range of the first characteristic peak, perform a similarity matching operation on the infrared spectrum to be identified and the at least one candidate infrared spectrum to determine at least one target infrared spectrum from the at least one candidate infrared spectrum; the peak range of the third characteristic peak is the characteristic peak extracted from the at least one candidate infrared spectrum.
[0071] The peak interval is used to characterize the width of the interval in which the peak value is located.
[0072] Optionally, for spectral identification, considering only peak position matching might lead to minor fluctuations caused by environmental factors and equipment being identified as matching peaks, resulting in significant deviations in the identification results. Furthermore, since a single infrared spectrum to be identified is composed of the superposition of several sample infrared spectra, it is necessary to combine the peak ranges of the candidate infrared spectra with those of the infrared spectrum to be identified to further refine the selection of target infrared spectra that closely match the spectrum to be identified. This ensures accurate spectral matching and guarantees both matching and identification precision.
[0073] Optionally, after obtaining the candidate infrared spectrum based on step 102, the peak position matching degree between the infrared spectrum to be identified and each candidate infrared spectrum can be calculated based on the peak position of the first characteristic peak and the peak position of the second characteristic peak.
[0074] Then, based on the peak position matching degree between the infrared spectrum to be identified and each candidate infrared spectrum, the peak range of the first characteristic peak, and the peak range of the third characteristic peak extracted in each candidate infrared spectrum, a similarity matching operation is further performed to refine the selection of target infrared spectra that are more closely matched with the infrared spectrum to be identified from at least one candidate infrared spectrum obtained in the initial screening in step 102, thereby achieving accurate matching of the spectra to ensure matching accuracy and identification accuracy.
[0075] Step 104: Based on the infrared spectrum of the at least one target, obtain the identification result of the infrared spectrum to be identified.
[0076] Optionally, after obtaining the target infrared spectrum, at least one target infrared spectrum can be superimposed to form a synthetic infrared spectrum, and the synthetic infrared spectrum can be used as the identification result of the infrared spectrum to be identified; and / or, the composition of the sample substance corresponding to the target infrared spectrum can be summarized as the identification result of the infrared spectrum to be identified. This embodiment does not specifically limit this.
[0077] The infrared spectrum identification method based on similarity matching provided in this embodiment extracts the first characteristic peak from the infrared spectrum of the substance to be identified and the second characteristic peak from the infrared spectra of multiple sample substances. Based on the peak positions of the first and second characteristic peaks, a preliminary similarity match is performed on the infrared spectrum to be identified, identifying at least one candidate infrared spectrum. Then, based on the peak range of the third characteristic peak of the candidate infrared spectrum, the peak range of the first characteristic peak, and the peak position matching degree between the infrared spectrum to be identified and the candidate infrared spectrum, a refined similarity match is performed on the infrared spectrum to be identified, so as to automatically and accurately obtain the identification result of the infrared spectrum to be identified. The entire identification process can be automatically executed online by electronic devices, avoiding reliance on human experience for identification, and effectively improving the reliability and efficiency of identification.
[0078] In some embodiments, the step of performing a similarity matching operation on the infrared spectrum to be identified and the at least one candidate infrared spectrum based on the peak position matching degree between the infrared spectrum to be identified and the at least one candidate infrared spectrum, the peak range of the third characteristic peak, and the peak range of the first characteristic peak, and determining at least one target infrared spectrum from the at least one candidate infrared spectrum, includes:
[0079] Based on the peak position matching degree, the peak range of the third characteristic peak and the peak range of the first characteristic peak, the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum is calculated.
[0080] The similarity of the characteristic peaks is sorted, and based on the sorting results, at least one candidate infrared spectrum that matches the infrared spectrum to be identified is determined from the at least one candidate infrared spectrum.
[0081] The candidate infrared spectrum that matches the infrared spectrum to be identified is taken as the target infrared spectrum.
[0082] Optionally, the screening step of the target infrared spectrum in step 103 further includes:
[0083] The peak position matching degree between the infrared spectrum to be identified and each candidate infrared spectrum, the peak range of the first characteristic peak, and the peak range of the third characteristic peak extracted from each candidate infrared spectrum are input as variables into the similarity matching model to obtain the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum. Alternatively, the peak intensity matching degree between the infrared spectrum to be identified and each candidate infrared spectrum can be calculated first based on the peak range of the third characteristic peak extracted from each candidate infrared spectrum, and then the peak intensity matching degree and peak position matching degree can be combined to obtain the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum. This embodiment does not specifically limit this.
[0084] After obtaining the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum, the characteristic peak similarity needs to be sorted in descending order. Then, the corresponding target infrared spectrum is selected from at least one candidate infrared spectrum in descending order of characteristic peak similarity until the combined spectrum formed by superimposing the currently obtained target infrared spectrum and the historically obtained target infrared spectrum meets the identification conditions, at which point the selection stops.
[0085] The identification criteria include whether the similarity between the currently acquired combined spectrum and the infrared spectrum to be identified is decreasing or unchanged compared to the similarity between the previously acquired combined spectrum and the infrared spectrum to be identified.
[0086] It should be noted that, during the similarity matching operation, the selected target infrared spectrum (i.e., candidate infrared spectrum with high similarity of characteristic peaks) can also be visualized to display the identification results in real time.
[0087] In this embodiment, by combining the peak position matching degree, the peak range of the third characteristic peak and the peak range of the first characteristic peak, the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum can be automatically and accurately calculated, so as to further refine the similarity matching of the infrared spectrum to be identified, which can effectively improve the credibility and recognition efficiency.
[0088] In some embodiments, calculating the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum based on the peak position matching degree, the peak range of the third characteristic peak, and the peak range of the first characteristic peak includes:
[0089] Based on the peak range of the third characteristic peak and the peak range of the first characteristic peak, the peak intensity matching degree between the infrared spectrum to be identified and each candidate infrared spectrum is obtained.
[0090] Based on the peak intensity matching degree and the peak position matching degree, the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum is calculated.
[0091] For spectral identification, considering only peak position matching may lead to minor fluctuations caused by environmental and equipment factors being identified as matching peaks, resulting in significant deviations in the identification results. Therefore, the peak intensity of the substance to be identified needs to be considered comprehensively, taking into account the peak intensity of the sample substance at that position. In this embodiment, in addition to using peak position, one of the three elements of spectral analysis, it is also necessary to calculate the peak intensity matching degree between spectra based on the peak range. Then, by combining the peak intensity matching degree and the peak position matching degree, a more accurate target extraspectral image that matches the infrared spectrum to be identified can be found.
[0092] Optionally, the peak intensity of the third characteristic peak can be calculated based on the peak range of the third characteristic peak, and the peak intensity of the first characteristic peak can be calculated based on the peak range of the first characteristic peak. Then, the peak intensity matching degree between the infrared spectrum to be identified and each candidate infrared spectrum can be calculated based on the peak intensity of the third characteristic peak and the peak intensity of the first characteristic peak. Alternatively, the peak range of the third characteristic peak and the peak range of the first characteristic peak can be directly input as variables into the peak intensity matching degree model to obtain the peak intensity matching degree between the infrared spectrum to be identified and each candidate infrared spectrum. This embodiment does not specifically limit this.
[0093] After obtaining the peak intensity matching degree between the infrared spectrum to be identified and each candidate infrared spectrum, the peak intensity matching degree can be multiplied by the peak position matching degree to obtain the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum.
[0094] In this embodiment, the peak intensity matching degree between the infrared spectrum to be identified and each candidate infrared spectrum can be accurately calculated by using the peak range of the third characteristic peak and the peak range of the first characteristic peak. Then, by combining the peak intensity matching degree and the peak position matching degree, the infrared spectrum to be identified can be automatically and accurately matched, effectively improving the accuracy and precision of infrared spectrum identification.
[0095] In some embodiments, obtaining the peak intensity matching degree between the infrared spectrum to be identified and each candidate infrared spectrum based on the peak range of the third characteristic peak and the peak range of the first characteristic peak includes:
[0096] For each candidate infrared spectrum, perform the following operation:
[0097] Based on the peak range of the third characteristic peak and the peak range of the first characteristic peak in the current candidate infrared spectrum, a characteristic peak matching pair is obtained; the characteristic peak matching pair includes the third characteristic peak and the first characteristic peak whose peak ranges match each other;
[0098] If the peak range of the third characteristic peak in any characteristic peak matching pair is greater than or equal to the peak range threshold, the peak range of the third characteristic peak in any characteristic peak matching pair is divided by the peak range of the first characteristic peak in any characteristic peak matching pair to obtain the peak intensity matching degree of any characteristic peak matching pair.
[0099] If the peak range of the third characteristic peak in any characteristic peak matching pair is less than the peak range threshold, the peak range of the first characteristic peak in any characteristic peak matching pair is divided by the peak range threshold to obtain the peak intensity matching degree of any characteristic peak matching pair.
[0100] The peak intensity matching degree of all characteristic peak matching pairs corresponding to the current candidate infrared spectrum is fused to obtain the peak intensity matching degree between the infrared spectrum to be identified and the current candidate infrared spectrum.
[0101] Optionally, to ensure the accuracy of the matching, during the second similarity matching operation, a more effective composite evaluation index is constructed based on the idea of peak intensity and Jaccard coefficient to perform a precise matching of the infrared spectrum to be identified, so as to obtain a target infrared spectrum that matches the infrared spectrum to be identified better and to ensure its matching accuracy.
[0102] The Jaccard Index, also known as the Jaccard similarity index, is used to compare the differences and similarities between two samples.
[0103] The Jaccard coefficient is used to calculate the similarity between samples, measured by a symbolic or Boolean value, to compare the differences and similarities between two characteristic peaks. A higher Jaccard coefficient indicates a higher similarity between the two characteristic peaks. The formula for calculating the Jaccard coefficient is:
[0104] ;
[0105] in, The Jaccard coefficient between set A and set B; The intersection of set A and set B; Let A be the union of sets A and B. and Let J(A,B) represent all elements in set A and all elements in set B, respectively. It should be noted that when both A and B are empty, J(A,B) = 1.
[0106] Furthermore, the method for calculating the similarity of characteristic peaks can be determined based on the aforementioned Jaccard coefficient.
[0107] Specifically, for each candidate infrared spectrum, a characteristic peak matching pair with matching peak intervals is determined based on the peak interval of the third characteristic peak and the peak interval of the first characteristic peak of the current candidate infrared spectrum; then, the corresponding peak intensity matching degree calculation method is determined based on the peak interval of the third characteristic peak of the current candidate infrared spectrum in the characteristic peak matching pair.
[0108] If the peak range of the third characteristic peak in any matching peak pair of the current candidate infrared spectrum is greater than or equal to the peak range threshold, divide the peak range of the third characteristic peak in the matching peak pair by the peak range of the first characteristic peak to obtain the peak intensity matching degree of the matching peak pair. If the peak range of the third characteristic peak in the matching peak pair of the current candidate infrared spectrum is less than the peak range threshold, divide the peak range of the third characteristic peak in the matching peak pair by the peak range threshold to obtain the peak intensity matching degree of the matching peak pair. Then, add the peak intensity matching degrees of all matching peak pairs corresponding to the current candidate infrared spectrum, and then multiply them by the peak position matching degree corresponding to the current candidate infrared spectrum to obtain the characteristic peak similarity between the infrared spectrum to be identified and the current candidate infrared spectrum. The specific formula is as follows:
[0109] ;
[0110] in, This represents the total number of characteristic peak matching pairs corresponding to the current candidate infrared spectrum. and These are the peak ranges of the third characteristic peak of the current candidate infrared spectrum in the i-th characteristic peak matching pair and the peak range of the first characteristic peak of the substance to be identified, respectively. Let be the peak intensity matching degree corresponding to the peak point of the first characteristic peak of the substance to be identified in the i-th characteristic peak matching pair. The peak position matching degree between the current candidate infrared spectrum and the infrared spectrum to be identified; This is the threshold for the peak range, which can be set according to actual needs. For example, it can be set to 100 based on the intensity of the strongest peak.
[0111] To verify the effectiveness of the above identification method, in a real-world scenario, the wavenumber range of the infrared spectrum was used as the parameter of the Jaccard coefficient. Combined with the characteristic peak intensity and peak position, a corresponding evaluation index was formed. Experiments were conducted under this evaluation index, and the target infrared spectrum that closely matched the infrared spectrum to be identified was accurately matched. Furthermore, the Jaccard coefficient between the composite infrared spectrum formed by superimposing the target infrared spectrum and the infrared spectrum to be identified reached as high as 91.7%, and the identification accuracy was as high as 92%.
[0112] Therefore, experimental analysis revealed the significant importance of peak intensity in spectral matching. Furthermore, by studying the weighting of spectral peak intensity, peak intensity comparison verification of the matched samples was achieved. Combined with expert experience, the target infrared spectrum should exhibit high similarity to the infrared spectrum to be identified in terms of peak position and peak intensity. Therefore, this embodiment adds two coefficients—peak position matching degree and peak intensity matching degree—to the original Jaccard coefficient, effectively addressing the problem of low matching accuracy and thus significantly improving the precision and accuracy of infrared spectrum identification.
[0113] In some embodiments, the step of performing a similarity matching operation on the sample infrared spectra of the plurality of sample substances and the infrared spectra to be identified based on the peak positions of the first characteristic peak and the second characteristic peak, and determining at least one candidate infrared spectra in the sample infrared spectra of the plurality of sample substances, includes:
[0114] Based on the peak positions of the first characteristic peak and the second characteristic peak, the peak position matching degree between the infrared spectrum to be identified and the infrared spectrum of each sample is calculated.
[0115] Based on the peak position matching degree, a similarity matching operation is performed on the sample infrared spectra of the multiple sample substances and the infrared spectra to be identified to obtain at least one candidate infrared spectra.
[0116] Optionally, in step 102, the infrared spectrum to be identified is coarsely screened based on the peak position. By studying the correlation of the peak positions in the spectrum, the peak position correspondence of the spectrum matching sample is achieved, ensuring that no wrong selection or omission occurs. The peak position matching degree is calculated based on the peak positions of the first characteristic peak and the second characteristic peak through the evaluation index in the spectrum initial selection module, so as to improve the overall algorithm efficiency.
[0117] Optionally, the peak positions of the first characteristic peak in the infrared spectrum to be identified and the second characteristic peak in each sample infrared spectrum can be input into the similarity calculation model to calculate the peak position matching degree between the infrared spectrum to be identified and each sample infrared spectrum. Alternatively, based on the peak positions of the first and second characteristic peaks, the first characteristic peak in the infrared spectrum to be identified and the second characteristic peak in each sample infrared spectrum can be matched one by one. Then, based on the number of second characteristic peaks matching the first characteristic peak in each sample infrared spectrum and the total number of second characteristic peaks in each sample infrared spectrum, the peak position matching degree between the infrared spectrum to be identified and each sample infrared spectrum can be calculated. This embodiment does not specifically limit this.
[0118] Then, after obtaining the peak position matching degree between the infrared spectrum to be identified and each candidate infrared spectrum, the peak position matching degree needs to be sorted in descending order, and multiple candidate infrared spectra are selected from them according to the order of peak position matching degree.
[0119] Through experimental simulation, the above method can accurately screen out the infrared spectra of samples that do not match the infrared spectra to be identified, thereby initially obtaining candidate infrared spectra. Furthermore, by using this method, the algorithm efficiency can be improved by about 40%, further verifying the accuracy and efficiency of identification in this embodiment.
[0120] In some embodiments, extracting a first characteristic peak from the infrared spectrum of the substance to be identified and extracting a second characteristic peak from the infrared spectra of multiple sample substances in a basic sample library includes:
[0121] Preprocessing is performed on the infrared spectrum of the substance to be identified and the infrared spectrum of the multiple sample substances.
[0122] The first characteristic peak is extracted from the preprocessed infrared spectrum of the sample to be identified, and the second characteristic peak is extracted from the preprocessed infrared spectrum of multiple sample substances.
[0123] The preprocessing includes data clipping, filtering, and standard state transformation.
[0124] Optionally, to prevent irrelevant data in the infrared spectra to be identified and the infrared spectra of multiple sample substances from interfering with spectral matching and identification, data cropping can be performed on the infrared spectra to obtain spectral data that plays a crucial role in spectral matching and identification. The cropping range can be set according to actual needs, such as <600, >3600 cm⁻¹. -1 That is, 600 cm -1 up to 3600cm -1 .
[0125] Furthermore, noise and baseline shifts in the raw infrared spectra acquired by the infrared spectrometer (i.e., the infrared spectrum to be identified and the sample infrared spectrum) due to environmental and equipment factors can significantly impact the accuracy and efficiency of subsequent infrared spectrum identification. Therefore, before matching and identifying the infrared spectra, preprocessing of the raw infrared spectra acquired by the infrared spectrometer is necessary. Specifically, filtering is used to eliminate noise caused by environmental and equipment factors, and standard state transformation is used to eliminate baseline shift effects, thereby improving the accuracy and efficiency of subsequent infrared spectrum identification.
[0126] Filtering processes include, but are not limited to, low-pass filtering based on low-pass filters and filtering based on local polynomial least squares fitting using least-squares convolution fitting filters (Savitzky-Golay filters). This embodiment does not specifically limit these methods. This embodiment preferably uses a Savitzky-Golay filter for filtering.
[0127] like Figure 2 As shown, the infrared spectrum of the sample to be identified before processing (hereinafter referred to as the analysis sample) contains a lot of noise, which interferes with the matching and identification effects. Therefore, the Savitzky-Golay filter is used to solve the noise interference problem. It is widely used for data stream smoothing and noise reduction and is a filtering method based on local polynomial least squares fitting in the time domain. The biggest feature of this filter is that it can ensure that the shape and width of the signal remain unchanged while filtering out noise.
[0128] Optionally, in order to further eliminate the impact of noise on infrared spectrum identification, after data clipping of the infrared spectrum to be identified and the infrared spectra of multiple sample substances, filtering can be used to preprocess the infrared spectrum to be identified and the infrared spectra of the samples, improve the smoothness of the spectrum, and reduce noise interference in the infrared spectrum to be identified and the infrared spectra of the samples.
[0129] like Figure 3 As shown, the Savitzky-Golay filter is a digital filter that can be applied to a set of data to smooth the data and improve the accuracy of the data without changing the signal trend or width. It achieves this through a convolution process, that is, by using linear least squares to fit a continuous subset of adjacent data points to a low-order polynomial to achieve smoothing and thus suppress noise.
[0130] The Savitzky-Golay filtering formula is as follows: (The formula is missing from the provided text.)
[0131] ;
[0132] in, Within the time window, the filtered first... The infrared spectral signal of the target; , , [This refers to the infrared spectral signals of all targets within the time window;] / H is the smoothing coefficient, obtained by fitting the polynomial using the least squares method.
[0133] In Savitzky-Golay filtering, multiplying each measurement by a smoothing coefficient aims to minimize the impact of smoothing on useful information and reduce the disadvantages of smoothing and denoising algorithms. This algorithm is based on the least squares principle and is used for polynomial fitting. The key to Savitzky-Golay convolution smoothing lies in solving the matrix operators.
[0134] The following section explains the principle of Savitzky-Golay filtering.
[0135] Assume the width of the filter window is Each measurement point is use A polynomial of degree fits the data points within the window.
[0136] ;
[0137] This yields n equations, forming a system of k linear equations. For the system to have a solution, n should be greater than or equal to k; generally, n > k is chosen. The fitting parameters A are determined using the least squares method. Thus, the system of k linear equations is:
[0138] ;
[0139] This can be represented using a matrix as follows:
[0140] ;
[0141] The least squares solution for coefficient A is
[0142] ;
[0143] Y's model prediction or filtered value for:
[0144] ;
[0145] The Savitzky-Golay filter has the advantage that different window widths can be arbitrarily selected at any position on the same curve to meet different smoothing filtering needs; it is particularly advantageous when processing time-series data, especially for processing sequences at different stages. It also performs well in processing noise samples from aperiodic and nonlinear sources.
[0146] Furthermore, due to differences in sampling equipment and environmental factors, spectral shifts and deviations can be eliminated after filtering by using Standard Normal Variation (SNV). SNV primarily eliminates the effects of solid particle size, surface scattering, and optical path variations on NIR (Near Infrared) spectroscopy. The process involves processing a single spectrum, based on the rows of the spectral matrix. The formula for Standard Normal Variation is as follows:
[0147] ;
[0148] In the formula, For the first Standard normal transformation results of infrared spectral signals; The value is the average of the infrared spectral signal, and m is the number of wavelength points. The value for each sample, k=1,2,3,…,m .
[0149] like Figure 4 As shown, the preprocessed spectrum is compared to the unprocessed spectrum. Figure 2 The resulting spectrum is smoother, and the use of SNV effectively eliminates the influence of the baseline and noise, greatly improving the accuracy and effectiveness of subsequent spectral matching and identification.
[0150] In this embodiment, Savitzky-Golay filtering, low-pass filtering, and standard normal transformation are used to preprocess the original infrared spectrum acquired by the infrared spectrometer. This effectively eliminates noise and baseline shift in the original infrared spectrum, greatly improving the efficiency of subsequent peak matching and the accuracy and efficiency of substance identification.
[0151] In some embodiments, obtaining the identification result of the infrared spectrum to be identified based on the at least one target infrared spectrum includes:
[0152] When there are multiple target infrared spectra, linear interpolation is used to downsample or oversample each target infrared spectrum to ensure that the data format of each target infrared spectrum is consistent after linear interpolation.
[0153] The infrared spectra of at least one target after linear interpolation are superimposed, and the identification result of the infrared spectrum to be identified is obtained based on the superposition result.
[0154] Optionally, based on different sampling methods, spectroscopic analysis methods can be divided into atomic absorption spectrometry, near-infrared spectroscopy, ultraviolet spectroscopy, and atomic fluorescence spectrometry. These four methods differ in their properties, resulting in variations in the infrared spectral analysis results. This leads to differences in the data length or units of the target infrared spectra of different sample substances; that is, the data of some target infrared spectra can differ significantly. Ultimately, this may cause format problems during superposition, resulting in inaccurate superposition results or even failure to superimpose, severely hindering the infrared spectrum identification process. Therefore, after calculating the results, it is necessary to normalize the data format of the target infrared spectra to be superimposed.
[0155] Optionally, when there are multiple target infrared spectra, each target infrared spectrum can be downsampled or oversampled using linear interpolation pairs to ensure that the data format of each target infrared spectrum after linear interpolation is uniform, i.e., the data length is consistent, thus solving the problem of inconsistent data superposition formats.
[0156] Interpolation, in particular, involves determining the variation patterns of a known data sequence (i.e., a series of discrete infrared spectral signals within each time window of the target's infrared spectrum), and then estimating the values of points for which no data has yet been recorded, based on these variation patterns. It is primarily used to reasonably compensate for missing data and to amplify or reduce data.
[0157] Interpolation algorithms include, but are not limited to, linear interpolation, nearest neighbor interpolation, bilinear interpolation, and bicubic interpolation, etc., and this embodiment does not specifically limit them. As the interpolation process utilizes more and more information, the interpolated data becomes increasingly smooth, but the computational load also increases. Therefore, during the interpolation process, the appropriate interpolation method can be selected according to actual needs. To ensure the interpolation effect and reduce the computational load, this embodiment preferably uses linear interpolation to downsample or oversample the infrared spectrum of each target.
[0158] Linear interpolation is an interpolation method for one-dimensional data. It estimates the value of the missing infrared spectral signal by taking the two nearest neighboring data points (i.e., infrared spectral signals with known values) of the point to be interpolated (i.e., the infrared spectral signal with missing values) in the one-dimensional data sequence. Specifically, it determines the weighting coefficient based on the distance between the two nearest neighboring data points, and then weights and sums the two nearest neighboring data points according to the weighting coefficient to obtain the value of the missing infrared spectral signal. This ensures that the data format of the infrared spectra of each sample after linear interpolation is uniform, that is, the data length is consistent, thus solving the problem of inconsistent data superposition formats.
[0159] For example, if the values of some infrared spectral signals in the data sequence composed of infrared spectral signals within a certain time window in the target infrared spectrum are known, i.e., their coordinates (x0, y0) and (x1, y1) are known, while the values of some infrared spectral signals are missing, i.e., their coordinates (x, y) are unknown, specifically as follows: Figure 5 As shown in the figure. Here, x is the sampling time point where the unknown infrared spectral signal is located, and y is the value corresponding to the unknown infrared spectral signal. At this time, it is necessary to perform numerical estimation on (x,y) based on linear interpolation to achieve reasonable compensation for missing data, and thus unify the data format of the sample infrared spectra to be superimposed.
[0160] The formula for estimating the coordinates (x, y) of the missing infrared spectral signal based on linear interpolation is as follows:
[0161] ;
[0162] It should be noted that the above formula still holds true even if x is not between x0 and x1. In this case, the interpolation method can be called linear extrapolation.
[0163] It should be noted that linear interpolation is essentially Lagrange interpolation with two nodes. Therefore, for the above linear interpolation method, the corresponding linear interpolation error, i.e., the interpolation remainder term, can be calculated as follows:
[0164] ;
[0165] in, For interpolation remainder, This is the second derivative. As can be seen from the interpolation remainder term, the error of linear interpolation increases with the increase of the second derivative. That is, the greater the curvature of the function, the greater the approximation error of the linear interpolation.
[0166] Furthermore, after completing the data format processing, the infrared spectra of at least one target after linear interpolation are linearly superimposed. Based on the superposition result, the synthetic spectrum corresponding to the infrared spectrum to be identified can be accurately identified, so as to achieve the identification of the infrared spectrum to be identified efficiently and accurately.
[0167] like Figure 6 As shown, the corresponding synthesized spectrum (also called the synthesized sample) can also be visualized and compared with the infrared spectrum to be identified. Based on the verification results, it can be seen that the infrared spectrum identification method provided in this embodiment, after multiple experiments with relevant data, can achieve an accuracy rate of 90% or higher for matching and identifying infrared spectra.
[0168] like Figure 7The diagram shown is a second schematic of the similarity-matching-based infrared spectral image identification method provided in this embodiment. The complete process of this method includes:
[0169] Step 1: Data Preprocessing. Based on the design requirements set, infrared spectra of the substances to be identified and multiple sample infrared spectra are acquired using an infrared spectrometer. Data-driven approaches and prior knowledge are used to preprocess the data acquired by the infrared spectrometer. This preprocessing includes qualitative analysis and smoothing of the data using Savitzky-Golay filters and standard normal transformations to address noise and baseline shifts caused by environmental and equipment factors. This initial data cleaning improves operational efficiency and matching accuracy in later stages. The design requirements set includes, but is not limited to, functional, structural, and specification requirements. Qualitative analysis includes historical data analysis, expert knowledge analysis, and industry information analysis.
[0170] Step 2, peak position coarse screening: By studying the correlation between the positions of the peak points in the spectrum, the peak positions of the matching samples in the spectrum are matched to ensure that no wrong selection or omission occurs. The peak positions are then calculated using the evaluation indicators in the spectrum preliminary selection module to improve the overall algorithm efficiency.
[0171] Step 3: Feature peak similarity matching. A composite evaluation index is constructed based on peak intensity and the Jaccard coefficient to perform a precise match to ensure accuracy. The similarity matching module takes the samples remaining after the initial coarse screening in Step 2 as input for refined spectral filtering.
[0172] Step 4: Output the identification results. After two rounds of screening, the spectra are sorted according to the evaluation index (i.e., the similarity of characteristic peaks). The spectra with higher evaluation index are visualized. Before the spectra are synthesized, the data format is normalized and the synthesized spectra are matched and verified with the sample to be tested.
[0173] In this embodiment, by studying the positional correlation of peak points in the spectrum, peak correspondence for matching samples is achieved, ensuring no misselection or omission. The results are then calculated using evaluation metrics in the initial spectrum selection module, improving overall algorithm efficiency. A composite evaluation metric is constructed based on peak intensity and Jaccard coefficients to perform a precise match, ensuring accuracy. Finally, after two rounds of screening, the spectra are sorted according to the evaluation metrics, and the infrared spectra of high-performing targets are visualized. Before spectrum synthesis, the data format is normalized, and the synthesized spectrum is matched and verified against the sample to be tested, thereby achieving automatic and accurate infrared spectrum identification.
[0174] The infrared spectrum identification device based on similarity matching provided by the present invention will be described below. The infrared spectrum identification device based on similarity matching described below and the infrared spectrum identification method based on similarity matching described above can be referred to in correspondence.
[0175] like Figure 8 As shown, this embodiment provides an infrared spectral image identification device based on similarity matching. The device includes:
[0176] The extraction module 801 is used to extract the first characteristic peak from the infrared spectrum of the substance to be identified and to extract the second characteristic peak from the infrared spectrum of multiple sample substances in the basic sample library.
[0177] The first similarity matching module 802 is used to perform a similarity matching operation on the sample infrared spectra of the plurality of sample substances and the infrared spectra to be identified based on the peak positions of the first characteristic peak and the second characteristic peak, and to determine at least one candidate infrared spectra in the sample infrared spectra of the plurality of sample substances.
[0178] The second similarity matching module 803 is used to perform a similarity matching operation on the infrared spectrum to be identified and the at least one candidate infrared spectrum based on the peak position matching degree between the infrared spectrum to be identified and the at least one candidate infrared spectrum, the peak range of the third characteristic peak, and the peak range of the first characteristic peak, and to determine at least one target infrared spectrum in the at least one candidate infrared spectrum; the peak range of the third characteristic peak is the characteristic peak extracted from the at least one candidate infrared spectrum;
[0179] The identification module 804 is used to obtain the identification result of the infrared spectrum to be identified based on the infrared spectrum of the at least one target.
[0180] The infrared spectrum identification device based on similarity matching provided in this embodiment extracts the first characteristic peak from the infrared spectrum of the substance to be identified and the second characteristic peak from the infrared spectra of multiple sample substances. Based on the peak positions of the first and second characteristic peaks, a preliminary similarity match is performed on the infrared spectrum to be identified, identifying at least one candidate infrared spectrum. Then, based on the peak range of the third characteristic peak of the candidate infrared spectrum, the peak range of the first characteristic peak, and the peak position matching degree between the infrared spectrum to be identified and the candidate infrared spectrum, a refined similarity match is performed on the infrared spectrum to be identified, so as to automatically and accurately obtain the identification result of the infrared spectrum to be identified. The entire identification process can be automatically executed online by electronic devices, avoiding reliance on human experience for identification, and effectively improving the reliability and efficiency of identification.
[0181] Figure 9An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9 As shown, the electronic device may include: a processor 901, a communication interface 902, a memory 903, and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904. The processor 901 can call logic instructions in the memory 903 to execute an infrared spectrum identification method based on similarity matching. This method includes: extracting a first characteristic peak from the infrared spectrum of the substance to be identified; extracting a second characteristic peak from the infrared spectra of multiple sample substances in a basic sample library; performing a similarity matching operation on the infrared spectra of the multiple sample substances and the infrared spectrum to be identified based on the peak positions of the first and second characteristic peaks, and determining at least one candidate infrared spectrum in the infrared spectra of the multiple sample substances; performing a similarity matching operation on the infrared spectrum to be identified and the at least one candidate infrared spectrum based on the peak position matching degree between the infrared spectrum to be identified and the at least one candidate infrared spectrum, the peak range of a third characteristic peak, and the peak range of the first characteristic peak, and determining at least one target infrared spectrum in the at least one candidate infrared spectrum; the peak range of the third characteristic peak is the characteristic peak extracted from the at least one candidate infrared spectrum; and obtaining the identification result of the infrared spectrum to be identified based on the at least one target infrared spectrum.
[0182] Furthermore, the logical instructions in the aforementioned memory 903 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0183] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the infrared spectrum identification method based on similarity matching provided by the above methods. The method includes: extracting a first characteristic peak from the infrared spectrum of the substance to be identified; extracting a second characteristic peak from the infrared spectra of multiple sample substances in a basic sample library; and performing similarity analysis on the infrared spectra of the multiple sample substances and the infrared spectrum of the substance to be identified based on the peak positions of the first and second characteristic peaks. A matching operation is performed to determine at least one candidate infrared spectrum from the infrared spectra of the multiple sample substances; based on the peak position matching degree between the infrared spectrum to be identified and the at least one candidate infrared spectrum, the peak range of the third characteristic peak, and the peak range of the first characteristic peak, a similarity matching operation is performed on the infrared spectrum to be identified and the at least one candidate infrared spectrum to determine at least one target infrared spectrum from the at least one candidate infrared spectrum; the peak range of the third characteristic peak is the characteristic peak extracted from the at least one candidate infrared spectrum; and the identification result of the infrared spectrum to be identified is obtained based on the at least one target infrared spectrum.
[0184] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the infrared spectrum identification method based on similarity matching provided by the methods described above. The method includes: extracting a first characteristic peak from the infrared spectrum of a substance to be identified; extracting a second characteristic peak from the infrared spectra of multiple sample substances in a basic sample library; performing a similarity matching operation on the infrared spectra of the multiple sample substances and the infrared spectrum to be identified based on the peak positions of the first and second characteristic peaks, and determining at least one candidate infrared spectrum in the infrared spectra of the multiple sample substances; performing a similarity matching operation on the infrared spectrum to be identified and the at least one candidate infrared spectrum based on the peak position matching degree between the infrared spectrum to be identified and the at least one candidate infrared spectrum, the peak range of a third characteristic peak, and the peak range of the first characteristic peak, and determining at least one target infrared spectrum in the at least one candidate infrared spectrum; the peak range of the third characteristic peak is the characteristic peak extracted from the at least one candidate infrared spectrum; and obtaining the identification result of the infrared spectrum to be identified based on the at least one target infrared spectrum.
[0185] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0186] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0187] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for infrared spectral image identification based on similarity matching, characterized in that, include: The first characteristic peak is extracted from the infrared spectrum of the substance to be identified, and the second characteristic peak is extracted from the infrared spectra of multiple sample substances in the basic sample library. Based on the peak positions of the first characteristic peak and the second characteristic peak, a similarity matching operation is performed on the sample infrared spectra of the plurality of sample substances and the infrared spectra to be identified, and at least one candidate infrared spectra is determined from the sample infrared spectra of the plurality of sample substances. Based on the peak intensity matching degree and peak position matching degree between the infrared spectrum to be identified and each candidate infrared spectrum, the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum is calculated. The similarity of the characteristic peaks is sorted, and based on the sorting results, at least one candidate infrared spectrum that matches the infrared spectrum to be identified is determined from the at least one candidate infrared spectrum. The candidate infrared spectrum that matches the infrared spectrum to be identified is taken as the target infrared spectrum; Based on at least one target infrared spectrum, obtain the identification result of the infrared spectrum to be identified; For each candidate infrared spectrum, the formula for calculating the similarity of characteristic peaks between the infrared spectrum to be identified and the current candidate infrared spectrum is as follows: ; in, This represents the total number of characteristic peak matching pairs corresponding to the current candidate infrared spectrum. and These are the peak ranges of the third feature peak and the first feature peak in the i-th feature peak matching pair, respectively. The peak position matching degree between the current candidate infrared spectrum and the infrared spectrum to be identified; The peak range threshold is defined as the peak range of the third characteristic peak, which is the peak range of the characteristic peak extracted from the at least one candidate infrared spectrum.
2. The infrared spectral image identification method based on similarity matching according to claim 1, characterized in that, The step of obtaining the peak intensity matching degree between the infrared spectrum to be identified and each candidate infrared spectrum includes: For each candidate infrared spectrum, perform the following operation: Based on the peak range of the third characteristic peak and the peak range of the first characteristic peak in the current candidate infrared spectrum, a characteristic peak matching pair is obtained; the characteristic peak matching pair includes the third characteristic peak and the first characteristic peak whose peak ranges match each other; If the peak range of the third characteristic peak in any characteristic peak matching pair is greater than or equal to the peak range threshold, the peak range of the third characteristic peak in any characteristic peak matching pair is divided by the peak range of the first characteristic peak in any characteristic peak matching pair to obtain the peak intensity matching degree of any characteristic peak matching pair. If the peak range of the third characteristic peak in any characteristic peak matching pair is less than the peak range threshold, the peak range of the first characteristic peak in any characteristic peak matching pair is divided by the peak range threshold to obtain the peak intensity matching degree of any characteristic peak matching pair. The peak intensity matching degree of all characteristic peak matching pairs corresponding to the current candidate infrared spectrum is fused to obtain the peak intensity matching degree between the infrared spectrum to be identified and the current candidate infrared spectrum.
3. The infrared spectral image identification method based on similarity matching according to claim 1 or 2, characterized in that, The step of performing a similarity matching operation on the sample infrared spectra of the plurality of sample substances and the infrared spectra to be identified based on the peak positions of the first characteristic peak and the second characteristic peak, and determining at least one candidate infrared spectra from the sample infrared spectra of the plurality of sample substances, includes: Based on the peak positions of the first characteristic peak and the second characteristic peak, the peak position matching degree between the infrared spectrum to be identified and the infrared spectrum of each sample is calculated. Based on the peak position matching degree, a similarity matching operation is performed on the sample infrared spectra of the multiple sample substances and the infrared spectra to be identified to obtain at least one candidate infrared spectra.
4. The infrared spectral image identification method based on similarity matching according to claim 1 or 2, characterized in that, The step of extracting a first characteristic peak from the infrared spectrum of the substance to be identified and extracting a second characteristic peak from the infrared spectra of multiple sample substances in the basic sample library includes: Preprocessing is performed on the infrared spectrum of the substance to be identified and the infrared spectrum of the multiple sample substances. The first characteristic peak is extracted from the preprocessed infrared spectrum of the sample to be identified, and the second characteristic peak is extracted from the preprocessed infrared spectrum of multiple sample substances. The preprocessing includes data clipping, filtering, and standard state transformation.
5. The infrared spectral image identification method based on similarity matching according to claim 1 or 2, characterized in that, The step of obtaining the identification result of the infrared spectrum to be identified based on at least one target infrared spectrum includes: When there are multiple target infrared spectra, an interpolation algorithm is used to downsample or oversample each target infrared spectra to ensure that the data format of each target infrared spectra is consistent after processing. The processed infrared spectra of at least one target are superimposed, and the identification result of the infrared spectra to be identified is obtained based on the superposition result.
6. An infrared spectral image identification device based on similarity matching, characterized in that, include: The extraction module is used to extract the first characteristic peak from the infrared spectrum of the substance to be identified and to extract the second characteristic peak from the infrared spectra of multiple sample substances in the basic sample library. The first similarity matching module is used to perform a similarity matching operation on the sample infrared spectra of the plurality of sample substances and the infrared spectra to be identified based on the peak positions of the first characteristic peak and the second characteristic peak, and to determine at least one candidate infrared spectra in the sample infrared spectra of the plurality of sample substances. The second similarity matching module is used to calculate the characteristic peak similarity between the infrared spectrum to be identified and each candidate infrared spectrum based on the peak intensity matching degree and peak position matching degree between the infrared spectrum to be identified and each candidate infrared spectrum; sort the characteristic peak similarity; determine at least one candidate infrared spectrum that matches the infrared spectrum to be identified in the at least one candidate infrared spectrum according to the sorting result; and take the candidate infrared spectrum that matches the infrared spectrum to be identified as the target infrared spectrum. The identification module is used to obtain the identification result of the infrared spectrum to be identified based on the infrared spectrum of at least one target; For each candidate infrared spectrum, the formula for calculating the similarity of characteristic peaks between the infrared spectrum to be identified and the current candidate infrared spectrum is as follows: ; in, This represents the total number of characteristic peak matching pairs corresponding to the current candidate infrared spectrum. and These are the peak ranges of the third feature peak and the first feature peak in the i-th feature peak matching pair, respectively. The peak position matching degree between the current candidate infrared spectrum and the infrared spectrum to be identified; The peak range threshold is defined as the peak range of the third characteristic peak, which is the peak range of the characteristic peak extracted from the at least one candidate infrared spectrum.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the infrared spectral image identification method based on similarity matching as described in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the infrared spectral image identification method based on similarity matching as described in any one of claims 1 to 5.