Dangerous chemical leakage detection method based on near infrared spectrum

By combining near-infrared spectroscopy, independent component analysis method and Bayesian model, the problem that traditional detection methods are difficult to achieve efficient data analysis and real-time monitoring is solved, and the accurate identification and classification detection of a variety of mixed chemical substances is achieved.

CN119757271AActive Publication Date: 2025-04-04GUANGZHOU THINKER TECH CO LTD

Patent Information

Application Number
CN202411952402.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-04
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

Traditional hazardous chemical leak detection methods are difficult to achieve efficient data analysis and real-time monitoring, and it is difficult to distinguish mixtures of multiple chemicals.

Method used

A detection method based on near-infrared spectroscopy is used, combined with independent component analysis (ICA) method and Bayesian model, to achieve classified detection of multiple mixed chemical substances.

Benefits of technology

Real-time monitoring and accurate identification of hazardous chemical leakage is achieved, and the accuracy of identification of complex mixtures is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119757271A_ABST
    Figure CN119757271A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of near infrared spectrum analysis, and particularly relates to a dangerous chemical leakage detection method based on near infrared spectrum, which comprises the following steps: S1) spectrum acquisition: configuring a detector and a near infrared spectrometer to detect an absorption spectrum corresponding to leaked gas or liquid; s2) data preprocessing: correcting an absorption spectrum by using a baseline spectrum to eliminate the influence of light source nonuniformity or light path stray light; s3) spectral feature extraction: performing dimension reduction on the high-dimensional spectral data of the wavelength points to a low-dimensional feature space by adopting a principal component analysis or independent component analysis method, and reserving main information to extract spectral feature parameters; s4) constructing a Bayesian model; and S5) applying the model. The near infrared spectrum technology has the characteristic of rapid detection, and can realize real-time monitoring of dangerous chemical leakage; and the overlapped absorption peaks can be effectively separated through the ICA method, and the recognition accuracy of the complex mixture is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of near-infrared spectroscopy analysis, and in particular relates to a dangerous chemical leakage detection method based on near-infrared spectroscopy. Background Art

[0002] Dangerous chemical leakage accidents may cause serious environmental pollution, casualties and property losses. Rapid identification of chemicals is a prerequisite for effective supervision. Developing a fast, accurate, contactless measurement, and effective identification method for a variety of chemicals is very important for achieving effective chemical supervision. Traditional hazardous chemical leakage detection methods, such as gas chromatography-mass spectrometry (GC-MS) and gas sensor monitoring technology, have the following shortcomings:

[0003] 1. Traditional single sensors have difficulty distinguishing mixtures of multiple chemicals and their accuracy is limited.

[0004] Second, the data analysis time of technologies such as GC-MS is long, making it difficult to achieve efficient data analysis and real-time monitoring.

[0005] Near infrared spectroscopy (NIRS) is a technology based on the vibration spectrum of material molecules. When near infrared light is irradiated to a material, the functional groups in the material molecules absorb near infrared light of a specific wavelength and produce a characteristic absorption spectrum. Near infrared spectroscopy technology combined with advanced data processing and model building methods can overcome the shortcomings of traditional methods and achieve efficient and accurate detection of hazardous chemical leaks. Summary of the invention

[0006] In order to solve the technical problems that traditional technologies are difficult to achieve efficient data analysis and real-time monitoring, and difficult to distinguish mixtures of multiple chemical substances, the present invention provides a dangerous chemical leakage detection method based on near-infrared spectroscopy. The classification detection of multiple mixed chemical substances is achieved by combining the ICA method and the Bayesian model.

[0007] The purpose of the present invention can be achieved through the following technical solutions:

[0008] The method for detecting leakage of hazardous chemicals based on near infrared spectroscopy comprises the following steps:

[0009] S1) Spectral acquisition:

[0010] Use broadband near-infrared light source and light intensity stabilizer to ensure the stability of absorption spectrum collection;

[0011] Configure a detector and a near-infrared spectrometer to detect the corresponding absorption spectrum of the leaked gas or liquid;

[0012] Set up intermittent continuous scanning mode and record the absorption spectrum by adjusting the acquisition frequency and scanning resolution;

[0013] Preferably, in the step S1) of spectrum acquisition, the detector is selected from InGaAs detector and PbS detector; the near-infrared spectrometer is selected from array NIR near-infrared spectrometer or FT-NIR near-infrared spectrometer.

[0014] S2) Data preprocessing: Use the baseline spectrum to correct the absorption spectrum and eliminate the influence of light source inhomogeneity or stray light in the optical path;

[0015] The de-noising algorithm is used to smooth the absorption spectrum and improve the signal-to-noise ratio;

[0016] Preferably, the specific steps of correcting the absorption spectrum in the data preprocessing of step S2) include:

[0017] The background spectrum is collected without gas leakage, which is the baseline spectrum;

[0018] The collected absorption spectrum is obtained by subtracting the baseline spectrum to obtain the net absorption spectrum;

[0019] The baseline drift trend was fitted using a polynomial fitting algorithm and subtracted to correct the net absorbance spectrum.

[0020] Preferably, the data preprocessing in step S2) further comprises: using a standardization or normalization method to normalize all spectral data to the same scale to eliminate the influence of amplitude differences between different spectra.

[0021] S3) Spectral feature extraction:

[0022] S31) Wavelength selection: using recursive feature elimination method to select the wavelength point with the highest discrimination between different chemical categories in the spectrum as the feature;

[0023] S32) Feature extraction: using principal component analysis (PCA) or independent component analysis (ICA) to reduce the high-dimensional spectral data of wavelength points to a low-dimensional feature space, retaining the main information to extract spectral feature parameters;

[0024] The spectral characteristic parameters include peak position, peak intensity, peak area and half-peak width; wherein,

[0025] Peak position λ i : Find the wavelength point with the highest absorbance in each independent signal;

[0026] Peak intensity I: calculate the maximum value of absorbance;

[0027] Peak area A: integration of the area under the absorption peak of the signal;

[0028] Half-peak width F: Calculate the width at which the light intensity at the peak drops to half.

[0029] Preferably, the specific steps of wavelength selection in step S31) are as follows:

[0030] Select a classifier or regression model to evaluate the importance of wavelength;

[0031] Train all wavelength points and calculate the weight or contribution score of each wavelength;

[0032] Remove the wavelength point with the lowest contribution score, retrain the model, and update the weights;

[0033] Continue iterating until the optimal set of wavelengths remains;

[0034] According to the contribution score curve, determine the wavelength point λ that has the highest discrimination for chemical categories i .

[0035] Preferably, the specific steps of extracting spectral characteristic parameters using independent component analysis method include:

[0036] The ICA algorithm is used to decompose the spectral data, and the relevant parameters of the ICA algorithm are set, including the number of iterations and the convergence threshold;

[0037] X = A·S;

[0038] Where X is the spectral data; S is the independent signal source in the spectrum, and each column represents an independent component; A is the mixing matrix, which describes how the independent components are mixed to form the spectral data;

[0039] Use non-Gaussian measure functions to separate independent signal sources;

[0040] Peak position, peak intensity, peak area, and half-peak width were extracted and calculated from independent signal sources.

[0041] S4) Building a Bayesian model:

[0042] Define prior distribution: Based on historical spectral data and the distribution of known chemical categories, initialize the prior probability P(C i );

[0043] Constructing likelihood function: The spectral characteristic parameters (such as peak position, peak intensity and peak area, etc.) of the labeled chemical categories are combined into a spectral characteristic vector set and used as observation data for the Bayesian model;

[0044] For each chemical category, the Euclidean distance is used to calculate the degree of match between the observed data and the characteristic reference standard; the characteristic reference standard is the statistical mean or median of the spectral feature vector set;

[0045] The matching degree is used as the likelihood function P(X|C i );

[0046] Posterior probability calculation: According to the Bayesian formula, the posterior probability that the sample belongs to each chemical category is calculated; its expression is:

[0047]

[0048] In the formula, C i is the chemical category; X is the characteristic vector of the spectrum; P(C i ) is the prior probability of the chemical category; P(X|C i ) is the likelihood function; P(X) is the evidence.

[0049] S5) Model application: the new spectral feature vectors collected and extracted in real time are input into the trained Bayesian model to output the posterior probability of belonging to a certain chemical category;

[0050] The category with the largest posterior probability is selected as the detection result.

[0051] Preferably, in the step S4) of constructing the Bayesian model, a Gaussian mixture distribution (GMM) is used to fit the spectral distribution of each chemical category, and its corresponding probability density function is calculated; and the probability density function is used as the likelihood function of the observed data.

[0052] Preferably, the step of calculating the probability density function comprises:

[0053] For each chemical class, the distribution of its spectral feature vectors was modeled using Gaussian mixture distribution (GMM);

[0054] Determine an initial number of mixture components K (i.e., the number of Gaussian distributions) and perform subsequent optimization using the Akaike Information Criterion (AIC) or the Bayesian Information Criterion (BIC) to ensure a balance between model complexity and data fitting ability;

[0055] The expectation maximization (EM) algorithm was used to fit the Gaussian mixture model parameters, including the mean vector, covariance matrix, and mixing coefficients of each spectral feature vector;

[0056] Use the EM algorithm to iterate the Gaussian mixture model:

[0057] Step E: Calculate the posterior probability of each Gaussian component given the current parameters;

[0058] Step M: Update the parameters to maximize the log-likelihood function of the model until convergence;

[0059] For each chemical category, its probability density function is expressed as:

[0060]

[0061] In the formula, N(X;μik ,Σ ik ) is the multidimensional Gaussian distribution corresponding to the eigenvector X; μ ik Each chemical category C i The mean vector of ik It is a chemical category C i The covariance matrix of ik It is a chemical category C i The mixing coefficient.

[0062] Preferably, the method further includes: setting a credibility threshold for the posterior probability output by the Bayesian model; if the maximum posterior probability is lower than the credibility threshold, triggering an alarm mechanism to indicate the uncertainty of the model.

[0063] Beneficial effects of the present invention:

[0064] 1. Near-infrared spectroscopy technology has the characteristics of rapid detection and can realize real-time monitoring of hazardous chemical leaks; and through the ICA method, it can effectively separate overlapping absorption peaks and improve the accuracy of identifying complex mixtures.

[0065] 2. By constructing a Bayesian probability model; the scheme first defines the prior probability, then constructs the likelihood function (using the Euclidean distance method or the better Gaussian mixture model method), and finally calculates the posterior probability of each chemical category according to the Bayesian theorem to achieve classification detection of multiple mixed chemical categories. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0067] Figure 1 The present invention is a flowchart of the steps of the dangerous chemical leakage detection method based on near infrared spectroscopy.

[0068] Figure 2 The figure is a flow chart of step S4) in the method for detecting leakage of hazardous chemicals based on near infrared spectroscopy of the present invention. DETAILED DESCRIPTION

[0069] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0070] See also Figure 1-Figure 2 As shown, the method for detecting leakage of hazardous chemicals based on near infrared spectroscopy comprises the following steps:

[0071] S1) Spectral acquisition:

[0072] Use broadband near-infrared light source and light intensity stabilizer to ensure the stability of absorption spectrum collection;

[0073] Configure a detector and a near-infrared spectrometer to detect the corresponding absorption spectrum of the leaked gas or liquid;

[0074] Set up intermittent continuous scanning mode and record the absorption spectrum by adjusting the acquisition frequency and scanning resolution;

[0075] Furthermore, in the step S1) of spectrum acquisition, the detectors selected are InGaAs detectors and PbS detectors; the near-infrared spectrometer selects an array NIR near-infrared spectrometer or a FT-NIR near-infrared spectrometer.

[0076] In the specific implementation process, FT-NIR spectrometer has higher resolution and accuracy, but the cost is higher; array NIR spectrometer has faster scanning speed and is more suitable for real-time monitoring. In actual application, it must be optimized and verified according to factors such as the absorption spectrum characteristics of specific chemicals, environmental conditions, and detection sensitivity requirements.

[0077] Acquisition frequency: 1-10Hz is usually sufficient to monitor most chemical leaks. However, for highly toxic, fast-diffusing gases such as ammonia or hydrogen sulfide, a higher acquisition frequency (10-50Hz) may be required for rapid response.

[0078] Scanning resolution: 2-5nm resolution is sufficient for most chemicals. For ammonia and hydrogen sulfide, a higher scanning resolution (1-2nm) may be required due to their relatively narrow absorption peaks.

[0079] As shown in Table 1 below, the embodiments of the present invention only list several common categories of hazardous chemicals and provide some preliminary suggestions for selecting spectrometer parameters. In actual applications, adjustments and optimizations need to be made according to specific circumstances.

[0080]

[0081] S2) Data preprocessing: Use the baseline spectrum to correct the absorption spectrum and eliminate the influence of light source inhomogeneity or stray light in the optical path;

[0082] The de-noising algorithm is used to smooth the absorption spectrum and improve the signal-to-noise ratio;

[0083] Furthermore, the specific steps of correcting the absorption spectrum in the data preprocessing of step S2) include:

[0084] The background spectrum is collected without gas leakage, which is the baseline spectrum;

[0085] The collected absorption spectrum is obtained by subtracting the baseline spectrum to obtain the net absorption spectrum;

[0086] The baseline drift trend was fitted using a polynomial fitting algorithm and subtracted to correct the net absorbance spectrum.

[0087] Furthermore, the data preprocessing in step S2) further includes: using a standardization or normalization method to normalize all spectral data to the same scale to eliminate the influence of amplitude differences between different spectra.

[0088] Specifically, the purpose of correcting the absorption spectrum is to eliminate the effects of baseline drift and light source inhomogeneity in the spectral data and ensure the accuracy of the spectral signal. The baseline spectrum can be collected multiple times and the average value can be taken to reduce the influence of random noise. The number of acquisitions depends on the noise level and the required accuracy.

[0089] The subtraction operation of the baseline spectrum can effectively remove most of the systematic errors caused by the instrument and light source. Here, it is necessary to ensure that the absorption spectrum and the baseline spectrum have the same wavelength range and number of sampling points.

[0090] In addition, if there is a significant drift trend in the baseline, a simple subtraction correction may not be accurate enough. Therefore, a polynomial fitting algorithm is also needed to fit the trend of baseline drift. The order of the polynomial needs to be selected according to the complexity of the baseline drift. Too high an order may lead to overfitting. Subtract the fitting curve from the baseline spectrum to obtain the corrected baseline spectrum. Subtract the corrected baseline spectrum from the absorption spectrum to obtain the final corrected net absorption spectrum.

[0091] As an optional implementation method, the purpose of normalization is to eliminate the influence of amplitude differences between different spectra, make the spectral data statistically feasible, and thus improve the generalization ability of the model. Select appropriate baseline correction, denoising and normalization methods, and optimize related parameters to ensure the accuracy and effectiveness of the final model.

[0092] S3) Spectral feature extraction:

[0093] S31) Wavelength selection: using recursive feature elimination method to select the wavelength point with the highest discrimination between different chemical categories in the spectrum as the feature;

[0094] S32) Feature extraction: using principal component analysis (PCA) or independent component analysis (ICA) to reduce the high-dimensional spectral data of wavelength points to a low-dimensional feature space, retaining the main information to extract spectral feature parameters;

[0095] The spectral characteristic parameters include peak position, peak intensity, peak area and half-peak width; wherein,

[0096] Peak position λ i : Find the wavelength point with the highest absorbance in each independent signal;

[0097] Peak intensity I: calculate the maximum value of absorbance;

[0098] Peak area A: integration of the area under the absorption peak of the signal;

[0099] Half-peak width F: Calculate the width at which the light intensity at the peak drops to half.

[0100] Specifically, step S3) of spectral feature extraction aims to extract characteristic parameters that can effectively distinguish different chemical categories from the preprocessed high-dimensional spectral data.

[0101] The principle of the recursive feature elimination method in step S31) wavelength selection is to iteratively remove the features that contribute the least to model prediction until a preset number of features is reached or a preset condition is met. In this way, redundant and irrelevant features can be effectively removed, the generalization ability and efficiency of the model can be improved, and the complexity of the model can be reduced. The specific implementation process is:

[0102] Model selection: Choose a suitable classification model as the base model for feature selection, such as support vector machine (SVM), random forest (RF), or logistic regression.

[0103] Feature importance evaluation: Use the selected base model to train the spectral data of the full wavelength range. Most machine learning models provide the function of feature importance evaluation, such as the weight coefficient of SVM, the feature importance score of RF, etc. These indicators reflect the contribution of each wavelength to the classification result.

[0104] Iterative elimination: According to the feature importance index, iteratively remove the wavelength points with the lowest importance. In each iteration, the base model is retrained and the feature importance of the remaining wavelength points is re-evaluated. This process continues until the preset number of features is reached or the feature importance index meets certain conditions.

[0105] Feature subset selection: The final set of wavelength points retained is the selected feature subset. This subset contains the wavelength points with the highest discrimination for different chemical categories.

[0106] In step S32) feature extraction, the principle of principal component analysis (PCA) is to project high-dimensional data into low-dimensional space to retain the variance information in the data to the maximum extent. The principle of independent component analysis (ICA) is to find a set of statistically independent signal sources, which usually represent different chemical components. Whether using PCA or ICA, the low-dimensional data needs to be further processed after dimensionality reduction to extract specific characteristic parameters, such as peak position, peak intensity, peak area and half-peak width. These characteristic parameters need to be interpreted in combination with specific chemical knowledge and spectroscopy knowledge. Some image processing or signal processing techniques can be used to identify and quantify these features. Among them,

[0107] Peak position λ i : Find the wavelength point with the highest absorbance in each independent signal;

[0108] Peak intensity I: Calculate the maximum value of absorbance

[0109] Specifically, absorbance is often defined using the Lambert-Beer law:

[0110] Where: I0(λ) is the background light intensity; I t (λ) is the transmitted light intensity.

[0111] Peak area A: The area under the absorption peak of the signal is integrated; the calculation formula of peak area A is:

[0112] Where: λ1 and λ i are the starting wavelength and ending wavelength of the absorption peak integration, respectively, and determine the integration range; I(λ) represents the wavelength λ i The absorbance at i Represents a small wavelength increment of the integration variable, used for continuous integration.

[0113] Half-peak width F: Calculate the width at which the light intensity at the peak drops to half. The specific calculation method is:

[0114] Find the peak height: determine the maximum intensity value I at the peak max .

[0115] Determine the half-peak height: Calculate the half-peak height, which is half of the peak height. max / 2.

[0116] Find the two wavelength points corresponding to the half-peak height: On both sides of the peak, find the two wavelength points (λ 1, λ2). Interpolation methods can be used to determine these two wavelength points more accurately. For example, linear interpolation.

[0117] Calculate the half-peak width: The half-peak width F is equal to the difference between the two wavelength points: F = λ1-λ2.

[0118] As an optional implementation, spectrum analysis software (such as Origin, MATLAB) provides the function of directly calculating and visualizing the half-peak width.

[0119] Further, the specific steps of wavelength selection in step S31) are as follows:

[0120] Select a classifier or regression model to evaluate the importance of wavelength;

[0121] Train all wavelength points and calculate the weight or contribution score of each wavelength;

[0122] Remove the wavelength point with the lowest contribution score, retrain the model, and update the weights;

[0123] Continue iterating until the optimal set of wavelengths remains;

[0124] According to the contribution score curve, determine the wavelength point λ that has the highest discrimination for chemical categories i .

[0125] Furthermore, the specific steps of extracting spectral characteristic parameters using independent component analysis method include:

[0126] The ICA algorithm is used to decompose the spectral data, and the relevant parameters of the ICA algorithm are set, including the number of iterations and the convergence threshold;

[0127] X = A·S;

[0128] Where X is the spectral data; S is the independent signal source in the spectrum, and each column represents an independent component; A is the mixing matrix, which describes how the independent components are mixed to form the spectral data;

[0129] Use non-Gaussian measure functions to separate independent signal sources;

[0130] Peak position, peak intensity, peak area, and half-peak width were extracted and calculated from independent signal sources.

[0131] As an optional implementation, the independent component analysis (ICA) method is used to extract spectral feature parameters, especially when dealing with complex spectral data, that is, when multiple gas or liquid mixtures exist at the same time, it has significant advantages. Because ICA can separate overlapping absorption peaks and extract independent signal sources, this is difficult to achieve with traditional univariate analysis methods. ICA is a blind source separation technology, which means that it does not require prior knowledge of the specific form of each source signal in the mixed signal, but only needs to assume that they are statistically independent. This is very useful in hazardous chemical leak scenarios because the type and concentration of the leaked substance are usually unknown. This is difficult to do with traditional peak area or peak height calculation methods because these methods have difficulty dealing with overlapping peaks.

[0132] In the spectrum of a mixture, the absorption peaks of different substances often overlap, making it difficult to distinguish the individual components. ICA can effectively separate these overlapping absorption peaks and identify the individual components by assuming that the mixed signal is a linear mixture of multiple statistically independent source signals. ICA provides an effective method to separate overlapping absorption peaks and extract independent signal sources.

[0133] S4) Building a Bayesian model:

[0134] Define prior distribution: Based on historical spectral data and the distribution of known chemical categories, initialize the prior probability P(C i );

[0135] In the specific implementation process, if there is a lack of prior knowledge, a uniform prior probability can be assumed, that is, the prior probability of all chemicals is the same. The prior probability can also be estimated by using historical data to count the frequency of occurrence of each chemical. The prior probability reflects the estimated probability of each chemical category occurring in the absence of observed data.

[0136] Constructing likelihood function: The spectral characteristic parameters (such as peak position, peak intensity and peak area, etc.) of the labeled chemical categories are combined into a spectral characteristic vector set and used as observation data for the Bayesian model;

[0137] For each chemical category, the Euclidean distance is used to calculate the degree of match between the observed data and the characteristic reference standard; the characteristic reference standard is the statistical mean or median of the spectral feature vector set;

[0138] The matching degree is used as the likelihood function P(X|C i );

[0139] In the specific implementation, the likelihood function describes the probability of a given chemical category C iThe probability of observing the spectral feature vector X under the condition of . The spectral feature parameters of the labeled chemical categories (such as peak position, peak intensity and peak area, etc.) are combined into a spectral feature vector set as a feature reference standard. The Euclidean distance between the observed data and the feature reference standard (such as mean or median) is calculated. The smaller the distance, the higher the matching degree and the higher the likelihood function value.

[0140] Posterior probability calculation: According to the Bayesian formula, the posterior probability that the sample belongs to each chemical category is calculated; its expression is:

[0141]

[0142] In the formula, C i is the chemical category; X is the characteristic vector of the spectrum; P(C i ) is the prior probability of the chemical category; P(X|C i ) is the likelihood function; P(X) is the evidence.

[0143] S5) Model application: the new spectral feature vectors collected and extracted in real time are input into the trained Bayesian model to output the posterior probability of belonging to a certain chemical category;

[0144] The category with the largest posterior probability is selected as the detection result.

[0145] Specifically, the principle of the Bayesian model is to use Bayes' theorem to combine the prior probability and the likelihood function to calculate the posterior probability. The prior probability reflects the pre-estimate of the occurrence of each chemical category, and the likelihood function reflects the degree of match between the observed data and each chemical category. The posterior probability takes into account the prior probability and the likelihood function, representing an updated estimate of the probability of each chemical category occurring after the data is observed.

[0146] Furthermore, in the step S4) of constructing the Bayesian model, the spectral distribution of each chemical category is fitted with a Gaussian mixture distribution (GMM), and the corresponding probability density function is calculated; and the probability density function is used as the likelihood function of the observed data;

[0147] The calculation steps of the probability density function include:

[0148] For each chemical class, the distribution of its spectral feature vectors was modeled using Gaussian mixture distribution (GMM);

[0149] Determine an initial number of mixture components K (i.e., the number of Gaussian distributions) and perform subsequent optimization using the Akaike Information Criterion (AIC) or the Bayesian Information Criterion (BIC) to ensure a balance between model complexity and data fitting ability;

[0150] The expectation maximization (EM) algorithm was used to fit the Gaussian mixture model parameters, including the mean vector, covariance matrix, and mixing coefficients of each spectral feature vector;

[0151] Use the EM algorithm to iterate the Gaussian mixture model:

[0152] Step E: Calculate the posterior probability of each Gaussian component given the current parameters;

[0153] Step M: Update the parameters to maximize the log-likelihood function of the model until convergence;

[0154] For each chemical category, its probability density function is expressed as:

[0155]

[0156] In the formula, N(X;μ ik ,Σ ik ) is the multidimensional Gaussian distribution corresponding to the eigenvector X; μ ik Each chemical category C i The mean vector of ik It is a chemical category C i The covariance matrix of ik It is a chemical category C i The mixing coefficient.

[0157] Specifically, in the scheme of constructing the likelihood function, the present invention also provides a Gaussian mixture model (GMM) method, by assuming that the spectral feature vector of each chemical category obeys a Gaussian mixture distribution. The EM algorithm is used to fit the GMM parameters, including the mean vector, covariance matrix and mixing coefficient of each Gaussian component. Then, the probability density function of the observed data is calculated using the fitted GMM as the likelihood function.

[0158] It is worth noting that another innovation of the present invention is that in order to improve the reliability of the Bayesian classification model, ICA is combined with the Gaussian mixture model (GMM), and the multi-peak distribution constructed by the Gaussian mixture model is used to fit the spectral characteristic distribution of each chemical category to generate the observation probability of each chemical category, that is, the probability density function. The spectral signals of multiple chemical leakage sources are indirectly identified, making the method suitable for multi-chemical leakage detection in complex scenarios, so as to improve the robustness of the model classification.

[0159] Furthermore, it also includes: setting a credibility threshold for the posterior probability output by the Bayesian model; if the maximum posterior probability is lower than the credibility threshold, triggering an alarm mechanism to prompt the uncertainty of the model.

[0160] The core of the dangerous chemical leakage detection method based on near-infrared spectroscopy is to separate the independent components in the spectral signal by using the independent component analysis (ICA) method, which is particularly suitable for the characteristic decomposition of the spectral data of complex mixtures; the characteristic extraction results of the absorption spectrum provide high-quality input data for chemical leakage detection. Bayesian inference is used, combined with the Gaussian mixture model (GMM) to fit the spectral distribution of multiple categories of chemicals, thereby improving the accuracy, adaptability and real-time response capability of classification.

[0161] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the equipment and tool devices described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0162] In several embodiments provided in the present application, it should be understood that the disclosed methods and processes can be implemented in other ways. For example, the module embodiments described above are only schematic, and the calculation method or steps can be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as independent products. Based on such an understanding, the technical solution of the present application is essentially or part of the prior art that contributes to the technical solution or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

[0163] In the description of the specification, the description with reference to the terms "as an optional implementation", "example", "specifically", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0164] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A method for detecting leakage of hazardous chemicals based on near infrared spectroscopy, characterized in that: The following steps are involved: S1) Spectral acquisition: Use a broadband near-infrared light source and a light intensity stabilizer to ensure the stability of the absorption spectrum; configure a detector and a near-infrared spectrometer to detect the corresponding absorption spectrum of the leaked gas or liquid; set an intermittent continuous scanning mode, and record the absorption spectrum by adjusting the acquisition frequency and scanning resolution; S2) Data preprocessing: Use the baseline spectrum to correct the absorption spectrum to eliminate the influence of light source inhomogeneity or stray light in the optical path; use a denoising algorithm to smooth the absorption spectrum curve to improve the signal-to-noise ratio; S3) Spectral feature extraction: S31) Wavelength selection: using recursive feature elimination method to select the wavelength point with the highest discrimination between different chemical categories in the spectrum as the feature; S32) Feature extraction: using principal component analysis or independent component analysis to reduce the high-dimensional spectral data of wavelength points to a low-dimensional feature space, retaining the main information to extract spectral feature parameters; The spectral characteristic parameters include peak position, peak intensity, peak area and half-peak width; S4) Building a Bayesian model: Based on the historical spectral data and the distribution of known chemical categories, a Bayesian model is built to calculate the posterior probability that the sample belongs to each chemical category; S5) Model application: The new spectral feature vectors collected and extracted in real time are input into the trained Bayesian model, and the posterior probability of belonging to a certain chemical category is output; the category with the largest posterior probability is selected as the detection result.

2. The method for detecting leakage of hazardous chemicals based on near infrared spectroscopy according to claim 1 is characterized in that: In the step S1) of spectrum acquisition, the detectors are InGaAs detectors and PbS detectors; the near-infrared spectrometer is an array-type NIR near-infrared spectrometer or a FT-NIR near-infrared spectrometer.

3. The method for detecting leakage of hazardous chemicals based on near infrared spectroscopy according to claim 1 is characterized in that: The specific steps of correcting the absorption spectrum in the data preprocessing of step S2) include: The background spectrum is collected without gas leakage, which is the baseline spectrum; The collected absorption spectrum is obtained by subtracting the baseline spectrum to obtain the net absorption spectrum; The baseline drift trend was fitted using a polynomial fitting algorithm and subtracted to correct the net absorbance spectrum.

4. The method for detecting leakage of hazardous chemicals based on near infrared spectroscopy according to claim 1 is characterized in that: The data preprocessing in step S2) further includes: using a standardization or normalization method to normalize all spectral data to the same scale to eliminate the influence of amplitude differences between different spectra.

5. The method for detecting leakage of hazardous chemicals based on near infrared spectroscopy according to claim 1 is characterized in that: Among the spectral characteristic parameters, the peak position λ i : Find the wavelength point with the highest absorbance in each independent signal; Peak intensity I: calculate the maximum value of absorbance; Peak area A: integration of the area under the absorption peak of the signal; Half-peak width F: Calculate the width at which the light intensity at the peak drops to half.

6. The method for detecting leakage of hazardous chemicals based on near infrared spectroscopy according to claim 1 is characterized in that: The specific steps of wavelength selection in step S31) are as follows: Select a classifier or regression model to evaluate the importance of wavelength; Train all wavelength points and calculate the weight or contribution score of each wavelength; Remove the wavelength point with the lowest contribution score, retrain the model, and update the weights; Continue iterating until the optimal set of wavelengths remains; According to the contribution score curve, determine the wavelength point λ that has the highest discrimination for chemical categories i .

7. The method for detecting leakage of hazardous chemicals based on near infrared spectroscopy according to claim 1 is characterized in that: The specific steps of extracting spectral characteristic parameters by independent component analysis method include: The ICA algorithm is used to decompose the spectral data, and the relevant parameters of the ICA algorithm are set, including the number of iterations and the convergence threshold; X = A·S; Where X is the spectral data; S is the independent signal source in the spectrum, and each column represents an independent component; A is the mixing matrix, which describes how the independent components are mixed to form the spectral data; Use non-Gaussian measure functions to separate independent signal sources; Peak position, peak intensity, peak area, and half-peak width were extracted and calculated from independent signal sources.

8. The method for detecting leakage of hazardous chemicals based on near infrared spectroscopy according to claim 1 is characterized in that: The specific process of constructing the Bayesian model in step S4) includes: Define prior distribution: Based on historical spectral data and the distribution of known chemical categories, initialize the prior probability P(C i ); Constructing likelihood function: The spectral characteristic parameters of the labeled chemical categories are combined into a spectral characteristic vector set, which is used as the observation data of the Bayesian model; For each chemical category, the Euclidean distance is used to calculate the degree of match between the observed data and the characteristic reference standard; the characteristic reference standard is the statistical mean or median of the spectral feature vector set; The matching degree is used as the likelihood function P(X|C i ); Posterior probability calculation: According to the Bayesian formula, the posterior probability that the sample belongs to each chemical category is calculated; its expression is: In the formula, C i is the chemical category; X is the characteristic vector of the spectrum; P(C i ) is the prior probability of the chemical category; P(X|C i ) is the likelihood function; P(X) is the evidence.

9. The method for detecting leakage of hazardous chemicals based on near infrared spectroscopy according to claim 8 is characterized in that: In the process of constructing the Bayesian model in step S4), the spectral distribution of each chemical category is fitted with a Gaussian mixture distribution, and the corresponding probability density function is calculated; and the probability density function is used as the likelihood function of the observed data.

10. The method for detecting leakage of hazardous chemicals based on near infrared spectroscopy according to claim 9 is characterized in that: The calculation step of the probability density function comprises: For each chemical class, the distribution of its spectral feature vectors was modeled using a Gaussian mixture distribution; Determine an initial number of mixture components K, and perform subsequent optimization using the Akaike Information Criterion or the Bayesian Information Criterion to ensure a balance between model complexity and data fitting ability; The Gaussian mixture model parameters, including the mean vector, covariance matrix and mixing coefficients of each spectral feature vector, were fitted using the expectation maximization algorithm; Use the EM algorithm to iterate the Gaussian mixture model: Step E: Calculate the posterior probability of each Gaussian component given the current parameters; Step M: Update the parameters to maximize the log-likelihood function of the model until convergence; For each chemical category, its probability density function is expressed as: In the formula, N(X;μ ik ,Σ ik ) is the multidimensional Gaussian distribution corresponding to the eigenvector X; μ ik Each chemical category C i The mean vector of ik It is a chemical category C i The covariance matrix of ik It is a chemical category C i The mixing coefficient.

Citation Information

Patent Citations

  • Classification method combining Gaussian regression mixture model and MRF hyperspectral function data

    CN116343032A

  • Fire-fighting hidden danger intelligent identification system and method

    CN117576877A

  • Pollution detection method for food

    CN118010649A

  • System and Method for Spectral Analysis

    US20090001262A1

  • Analysing spectral data for the selection of a calibration model

    US20110071807A1

Cited By

  • Method for identifying gas components in transformer oil and monitoring concentration of gas components in transformer oil based on spectral analysis

    CN119935937A

  • Near infrared spectrum real-time traceability device for hazardous chemical substance leakage

    CN121068111A

  • Real-time near-infrared spectrum tracing device for hazardous chemical leakage

    CN121068111B