Methane concentration intelligent monitoring system based on big data
Patent Information
- Application Number
- CN202610984287.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-03
- Publication Date
- 2026-10-16
AI Technical Summary
[0003]本发明的目的在于提供一种基于大数据的甲烷浓度智能监测系统,以解决现有监测方法在复杂环境干扰下难以准确分离甲烷信号并基于异常事件稀疏特征实现精确浓度标定的问题
通过自适应字典学习模块对甲烷浓度原始数据序列和环境参数序列进行联合稀疏编码,构建同时包含甲烷浓度相关基函数和环境干扰基函数的多模态字典,使得信号模型能够显式刻画甲烷浓度变化模式与温度、湿度、气压等环境扰动模式在变换域中的差异化结构。在稀疏重构阶段,基于该多模态字典对实时观测数据进行稀疏表示时,可以自适应的将观测信号分解为对应甲烷浓度基函数的稀疏贡献和对应环境干扰基函数的稀疏贡献,从而在重构甲烷浓度估计值的过程中主动剥离环境干扰成分,避免环境波动直接混入浓度估计结果,有效抑制了由于环境参数非平稳变化引起的基线漂移和虚假脉冲,使重构的甲烷浓度估计值更贴近真实浓度变化趋势,为后续动态阈值判定提供低干扰的信号基础。浓度标定模块利用异常判定模块标记的异常浓度事件对应的稀疏系数作为输入特征向量,这些稀疏系数本身就是信号在多模态字典下去除环境干扰成分后的高维结构性表征,与甲烷浓度之间具备更本质且更稳定的关联关系。通过预先在实验室标定不同已知甲烷浓度下的稀疏系数特征向量,构建特征向量与浓度的标定数据库,再采用核岭回归模型对异常事件稀疏系数进行非线性映射,核岭回归以高斯核函数计算特征间相似度,能够捕获稀疏系数中隐含的非线性浓度响应关系,同时通过留一交叉验证选择正则化参数,避免过拟合和映射不稳定。这种基于稀疏特征向量的浓度反演方式,使得浓度标定直接建立在异常事件本身的模式特征之上,不依赖于信号幅值等易受干扰影响的粗粒度标量,当传感器响应特性因老化或环境条件改变而发生漂移时,稀疏系数特征仍能保持对甲烷浓度的标识能力,从而实现异常事件下的精确浓度定量分析。
Smart Images

Figure CN122922330A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of methane concentration monitoring technology, specifically to a big data-based intelligent methane concentration monitoring system. Background Technology
[0002] Methane concentration monitoring faces the dual challenges of complex environmental interference and accurate quantification of low concentrations in fields such as coal mine safety, natural gas pipeline inspection, and greenhouse gas emission assessment. Existing monitoring schemes mostly use a single sensor with a fixed alarm threshold, directly filtering and comparing the collected signals. Under the influence of temperature fluctuations, humidity changes, pressure disturbances, and cross-sensitivity to other gases, the sensor output contains a large number of environmental interference components unrelated to methane concentration, making the fixed threshold method prone to false alarms or missed alarms. Some improved schemes introduce multi-sensor data fusion and statistical process control, using environmental parameter regression models for compensation. However, these methods rely on pre-established linear or simple nonlinear compensation relationships. When environmental parameters undergo non-stationary changes or multiple interferences occur, the compensation accuracy significantly decreases, and the interference separation strategy cannot be adaptively adjusted. Sparse representation-based signal processing methods have been applied in fault diagnosis and pattern recognition. However, they typically use a single source to train the dictionary, failing to jointly sparsely encode the environmental parameter sequence with the methane concentration sequence. This results in the learned dictionary failing to explicitly represent environmental interference patterns, making it difficult to effectively isolate environmental interference components from mixed signals during reconstruction. The residual sequence still contains environmental fluctuation information, limiting the reliability of anomaly detection. In concentration calibration, existing techniques usually establish a linear or polynomial fitting relationship between the amplitude or integral value of the observed signal and the calibrated concentration. However, the nonlinear response characteristics of the sensor and the coupling with environmental interference cause the mapping relationship between amplitude features and true concentration to drift when abnormal concentration events occur. Sparse coefficients, as a structural representation of the signal under a high-dimensional overcomplete dictionary, contain the intrinsic characteristics of methane concentration after separation from environmental interference. However, effective means to achieve accurate inversion using the robust mapping relationship between sparse coefficients and calibrated concentrations still lack. To address the above issues, it is necessary to solve the problems of how to separate methane concentration signals from multimodal observation data and achieve high-precision anomaly detection under strong environmental interference, and how to use the sparse characterization corresponding to the anomaly events to achieve quantitative concentration inversion from qualitative alarm. Summary of the Invention
[0003] The purpose of this invention is to provide an intelligent methane concentration monitoring system based on big data, so as to solve the problem that existing monitoring methods are difficult to accurately separate methane signals under complex environmental interference and achieve accurate concentration calibration based on the sparse characteristics of abnormal events.
[0004] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides a big data-based intelligent methane concentration monitoring system, including a data acquisition module, an adaptive dictionary learning module, a sparse reconstruction module, an anomaly detection module, and a concentration calibration module. The data acquisition module is used to acquire raw methane concentration data sequences and environmental parameter sequences from multiple sensor nodes within a preset spatiotemporal window; the adaptive dictionary learning module is used to perform joint sparse coding on the raw methane concentration data sequences and environmental parameter sequences to construct a multimodal dictionary, which includes basis functions related to methane concentration and environmental interference basis functions; the sparse reconstruction module is used to perform sparse representation of the real-time observation data at the current moment based on the multimodal dictionary, and solve for the sparse coefficients using a regularized orthogonal matching pursuit algorithm to reconstruct the methane concentration estimate; the anomaly detection module is used to compare the methane concentration estimate with a dynamic threshold established based on historical data to mark abnormal concentration events; the concentration calibration module is used to invert and obtain accurate concentration values using the mapping relationship between the sparse coefficients corresponding to the abnormal concentration events marked by the anomaly detection module and known calibration gas concentrations. Through the collaboration of various modules, environmental interference can be separated from multimodal sensing data, enabling anti-interference reconstruction and accurate calibration of methane concentration.
[0005] As a preferred embodiment of the present invention, the data acquisition module is specifically used for: aligning the original methane concentration data sequence and the environmental parameter sequence with timestamps, and identifying missing values; applying a time-series decomposition-based interpolation method to the missing values, decomposing the data from two sampling points before and after the missing value into trend components, seasonal components, and residual components, interpolating the residual components, and superimposing the trend components and seasonal components to obtain interpolated values; and outputting the aligned and interpolated methane concentration data sequence and environmental parameter sequence. Preferably, the time-series decomposition uses the STL decomposition algorithm, performing cubic spline interpolation on the residual components, and then superimposing them with the trend components and seasonal components to obtain interpolated values. This preserves the temporal characteristics and local variation patterns of the data, providing complete and smooth data input for subsequent dictionary learning.
[0006] As a preferred embodiment of the present invention, the adaptive dictionary learning module is specifically used for: segmenting the historical methane concentration data sequence according to a preset sliding window length, performing empirical mode decomposition on each segment to obtain multiple intrinsic mode functions as initial dictionary atoms; merging all initial dictionary atoms into an initial matrix, and iteratively updating it using the K-SVD algorithm. In each iteration, the dictionary is first fixed to perform sparse encoding on each data segment, and then the dictionary atoms and corresponding coefficients are updated based on the sparse encoding results until the reconstruction error converges, outputting the multimodal dictionary. The sliding window length is determined based on the delay time corresponding to the first zero-crossing point of the autocorrelation function of the historical methane concentration data sequence, thereby adaptively matching the main change cycle of the data. During the iterative update of the K-SVD algorithm, the iteration stops when the relative change in reconstruction error between two adjacent iterations is less than a preset percentage threshold. This module, through the combination of empirical mode decomposition and dictionary learning, can automatically extract representative basis functions from historical data and explicitly model environmental interference factors as interference basis functions in the dictionary, enhancing the dictionary's sparse representation capability of the methane concentration signal.
[0007] As a preferred embodiment of the present invention, the sparse reconstruction module is specifically used for: vectorizing the real-time observation data, performing sparse representation using the multimodal dictionary, and introducing an environmental parameter sequence as a regularization weight vector; using the weighted L1 norm of the regularization weight vector as a penalty term, employing a regularized orthogonal matching pursuit algorithm to progressively select dictionary atoms, calculating the residual vector, stopping the iteration when the residual norm is less than a preset threshold, and outputting the sparse coefficients and the reconstructed methane concentration estimate. By introducing environmental parameter weighting, dictionary atoms that are strongly correlated with current environmental disturbances can be actively suppressed during the reconstruction process, thereby reducing the impact of environmental fluctuations on methane concentration estimation and improving the accuracy and robustness of the reconstruction.
[0008] As a preferred embodiment of the present invention, the anomaly detection module is specifically used for: calculating the mean and standard deviation of the residuals within a sliding window based on the reconstructed residuals of the historical methane concentration data sequence; detecting mean change points in the residual sequence using a penalized linear regression change point detection algorithm based on the Bayesian information criterion; dynamically calculating a high percentage threshold for each segment of the residual distribution after segmentation by the mean change point; comparing the reconstructed residuals of the current methane concentration estimate with the high percentage threshold; and marking moments exceeding the threshold as anomalous concentration events. Specifically, the penalized linear regression change point detection algorithm based on the Bayesian information criterion involves: constructing a linear regression model of the reconstructed residual sequence in chronological order; adding a penalty term to limit the number of change points; dynamically searching for the set of change point positions that minimizes the Bayesian information criterion through dynamic programming; and outputting the segmented mean of the residual sequence. This method can automatically divide intervals and set dynamic thresholds based on changes in the statistical characteristics of the data itself, avoiding false alarms and false negatives caused by fixed thresholds, and significantly improving the sensitivity and reliability of anomaly concentration event detection.
[0009] As a preferred embodiment of the present invention, the concentration calibration module is specifically used for: obtaining sparse coefficient feature vectors of sensor nodes under different known methane concentrations in the laboratory beforehand, and constructing a calibration database of feature vectors and concentrations; for the sparse coefficient feature vectors corresponding to abnormal concentration events, using a kernel ridge regression model to map and obtain accurate concentration values, wherein the kernel ridge regression model calculates the similarity between feature vectors using a Gaussian kernel function and selects regularization parameters through leave-one-out cross-validation. Using sparse coefficients as features for concentration inversion can eliminate redundancy and interference components in the original signal, while kernel ridge regression can effectively handle nonlinear mapping relationships, thus obtaining high-precision methane concentration calibration results even in complex environments.
[0010] The technical effects and advantages provided by the present invention in the above technical solution are as follows: An adaptive dictionary learning module jointly sparsely encodes the original methane concentration data sequence and the environmental parameter sequence, constructing a multimodal dictionary that simultaneously includes methane concentration-related basis functions and environmental disturbance basis functions. This allows the signal model to explicitly characterize the differentiated structure of methane concentration change patterns and environmental disturbance patterns such as temperature, humidity, and air pressure in the transform domain. During the sparse reconstruction stage, when sparsely representing real-time observation data based on this multimodal dictionary, the observed signal can be adaptively decomposed into sparse contributions corresponding to the methane concentration basis functions and sparse contributions corresponding to the environmental disturbance basis functions. This proactively removes environmental disturbance components during the reconstruction of the methane concentration estimate, preventing environmental fluctuations from directly contaminating the concentration estimation results. This effectively suppresses baseline drift and spurious impulses caused by non-stationary changes in environmental parameters, making the reconstructed methane concentration estimate closer to the true concentration change trend and providing a low-interference signal foundation for subsequent dynamic threshold determination. The concentration calibration module uses the sparse coefficients corresponding to anomalous concentration events marked by the anomaly detection module as input feature vectors. These sparse coefficients are themselves high-dimensional structural representations of the signal after removing environmental interference components under a multimodal dictionary, possessing a more fundamental and stable correlation with methane concentration. By pre-calibrating the sparse coefficient feature vectors at different known methane concentrations in the laboratory, a calibration database of feature vectors and concentrations is constructed. Then, a kernel ridge regression model is used to nonlinearly map the sparse coefficients of anomalous events. Kernel ridge regression calculates the similarity between features using a Gaussian kernel function, which can capture the nonlinear concentration response relationship implicit in the sparse coefficients. At the same time, leave-one-out cross-validation is used to select regularization parameters to avoid overfitting and mapping instability. This concentration inversion method based on sparse feature vectors allows concentration calibration to be directly established on the pattern characteristics of the anomalous events themselves, without relying on coarse-grained scalars such as signal amplitude that are easily affected by interference. When the sensor response characteristics drift due to aging or changes in environmental conditions, the sparse coefficient features can still maintain their ability to identify methane concentration, thereby achieving accurate quantitative analysis of concentration under anomalous events. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0012] Figure 1 This is a schematic diagram of a smart methane concentration monitoring system based on big data. Figure 2 This is a flowchart of the adaptive dictionary learning module constructing a multimodal dictionary; Figure 3 This is a flowchart of sparse reconstruction based on weighted L1 norm regularized orthogonal matching pursuit; Figure 4 This is a flowchart for determining methane concentration anomalies based on the sliding window residual mean change point detection. Figure 5 This is a schematic diagram of time series decomposition and missing value imputation of methane concentration data; Figure 6 This is a schematic diagram of the autocorrelation function of historical methane concentration data series and the first zero-crossing point; Figure 7 It is a comparison curve of real-time observation data, methane concentration estimates, and reconstructed residuals; Figure 8 This is a schematic diagram of reconstructing the residual sequence and determining dynamic threshold anomalies; Figure 9 This is a comparison chart of the concentration prediction results calibrated by the nuclear ridge regression model. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0014] See Figure 1 This invention provides an intelligent methane concentration monitoring system based on big data, comprising a data acquisition module, an adaptive dictionary learning module, a sparse reconstruction module, an anomaly detection module, and a concentration calibration module. The data acquisition module acquires raw methane concentration data sequences and environmental parameter sequences from multiple sensor nodes within a preset spatiotemporal window. The adaptive dictionary learning module performs joint sparse encoding on the raw methane concentration data sequences and environmental parameter sequences to construct a multimodal dictionary, which includes basis functions related to methane concentration and environmental interference basis functions. The sparse reconstruction module performs sparse representation of the real-time observation data based on the multimodal dictionary, solves for the sparse coefficients using a regularized orthogonal matching pursuit algorithm, and reconstructs the estimated methane concentration. The anomaly detection module compares the estimated methane concentration with a dynamic threshold established based on historical data and marks abnormal concentration events. The concentration calibration module uses the mapping relationship between the sparse coefficients corresponding to the abnormal concentration events marked by the anomaly detection module and the known calibration gas concentration to invert and obtain the accurate concentration value.
[0015] Example 1:
[0016] In practice, the data acquisition module obtains raw methane concentration data sequences and environmental parameter sequences from multiple sensor nodes within a preset spatiotemporal window. The environmental parameter sequences include environmental variables such as temperature, humidity, and air pressure, which aid in monitoring changes in methane concentration. The data acquisition module timestamps the raw methane concentration data sequences and environmental parameter sequences. Since there may be slight deviations in the sampling times of different sensor nodes, the data acquisition module uses a unified reference timestamp and employs the nearest neighbor interpolation method to map the data points of each sensor node onto the same time grid, generating aligned methane concentration data sequences and aligned environmental parameter sequences.
[0017] After timestamp alignment, the data acquisition module identifies missing values in the aligned methane concentration data sequence and the aligned environmental parameter sequence. Missing values are identified by checking if a corresponding sensor reading exists at each time point on the time grid. If no record is found at a time point, that time point is marked as a missing value location. For each identified missing value location, the data acquisition module performs an interpolation method based on time series decomposition. Taking the missing value processing in the methane concentration data sequence as an example, two valid sampling points are taken before and after the missing value location, obtaining a local methane concentration data segment containing four sampling points before and after the missing value. If the missing value is located near the sequence boundary, resulting in fewer than two valid sampling points before and after it, the number of available sampling points before or after the missing value location is expanded to two. If necessary, a mirror extension method is used to supplement the sampling points.
[0018] The data acquisition module applies a time-series decomposition algorithm to the local methane concentration data segments. The time-series decomposition algorithm uses the STL decomposition algorithm, which models the local methane concentration data segments as an additive model.
[0019] in, This indicates the index of the sampling point in the local methane concentration data segment. Values , This refers to the number of sampling points contained in a local methane concentration data segment, where there are two valid sampling points before and after the location of the missing value. ; The index of the local methane concentration data segment is... The methane concentration data values corresponding to the sampling points; The trend component obtained after decomposing a local methane concentration data fragment is indicated by the index number. The value at; The seasonal component obtained after decomposing a local methane concentration data fragment is indicated by the index number. The value at; This indicates the residual components obtained after decomposing a local methane concentration data fragment, as shown in the index. The value at that location.
[0020] When the STL decomposition algorithm performs decomposition, the seasonal component periodic parameter is determined by the periodic characteristics of the original methane concentration data sequence. In practice, spectral analysis can be performed on historical methane concentration data sequences to extract the frequency corresponding to the maximum peak value in the amplitude spectrum, and the reciprocal of this frequency can be used as the seasonal component periodic parameter. If the spectral analysis results are not clear or there is a lack of sufficient historical data, the seasonal component periodic parameter can be set according to a preset default value, for example, a default period of 24 sampling points can be set for hourly collected data.
[0021] The smoothing parameters for the trend component and the seasonal component control the smoothness of the trend and seasonal terms, respectively. The smoothing parameter for the trend component is set to an odd value greater than the period parameter for the seasonal component, while the smoothing parameter for the seasonal component is set to a smaller odd value, typically 7 or 15. The number of iterations for STL decomposition is set to two inner loops and one outer loop to strike a balance between decomposition accuracy and computational efficiency.
[0022] Trend components are obtained through STL decomposition. Seasonal portion and residual components Subsequently, the data acquisition module interpolates the residual component values corresponding to the missing value positions in the residual components. In some embodiments, linear interpolation is performed on the residual components. The linear interpolation method is as follows: using the residual component values of two valid sampling points before and after the missing value position, the interpolated residual component value at the missing value position is calculated according to the linear proportional relationship of the time index. If the missing value position is the th There are 1 sampling point, and the indices of the two valid sampling points before and after it are respectively... and ,and Then the interpolated residual component at the location of the missing value is calculated using the linear interpolation formula.
[0023] In other embodiments, cubic spline interpolation is performed on the residual components. The cubic spline interpolation method involves constructing a cubic spline function using the residual component values of all valid sampling points in the local methane concentration data segment as nodes. The spline function is required to have continuous second derivatives at the nodes, and natural boundary conditions are applied at the boundaries. Using the constructed cubic spline function, the interpolated residual component values corresponding to the missing value locations are calculated.
[0024] After obtaining the imputed residual values at the missing value locations, the data acquisition module superimposes the trend component value, the seasonal component value, and the imputed residual value at each missing value location to obtain the imputed value at that location. Specifically, the imputed value equals the sum of the trend component value, the seasonal component value, and the imputed residual value at the missing value location. For missing values in the environmental parameter sequence, the data acquisition module performs imputation using the same steps as for the methane concentration data sequence, i.e., it performs time series decomposition and residual component imputation separately for each type of environmental parameter sequence to obtain the imputed values at the missing value locations for each type of environmental parameter sequence. After completing the imputation for all missing value locations, the data acquisition module outputs the aligned and imputed methane concentration data sequence and environmental parameter sequence as input to the adaptive dictionary learning module.
[0025] See Figure 5 In the graph, the horizontal axis represents time (in units of sampling points), and the vertical axis represents methane concentration (in ppm). The solid curve represents the aligned and interpolated methane concentration data sequence, showing the trend of methane concentration over time. The dashed curve represents the trend component, showing a slow upward trend overall, reflecting the long-term trend of methane concentration data. The dotted curve represents the seasonal component, showing obvious periodic fluctuations, with the period corresponding to the number of peaks and troughs on the time axis, indicating the seasonal periodicity in the methane concentration data. The dotted "×" marks indicate the location of missing values, distributed at different time points on the solid curve, indicating missing data during the data collection process. The dashed-dot curve represents the residual component, fluctuating around zero with a small amplitude, reflecting random fluctuations in methane concentration data not explained by the trend and seasonal components.
[0026] The missing values in the figure are all located near the aligned and interpolated methane concentration data sequence curve, indicating that the missing values were imputed using the superposition of trend, seasonal, and residual components in the time series decomposition algorithm. The residual components underwent linear or cubic spline imputation at the missing value locations to ensure the smoothness and continuity of the imputed values. The overall curve exhibits a steady increase in the trend component and periodic fluctuations in the seasonal component within the range of approximately 0 to 720 sampling points, consistent with the time series decomposition and missing value imputation process using STL decomposition in Example 1. Furthermore, the small amplitude and uniform fluctuations of the residual components demonstrate that the imputation method effectively preserved the randomness and overall structure of the data.
[0027] Example 2:
[0028] In specific implementation, please refer to Figure 2 The adaptive dictionary learning module receives the aligned and interpolated methane concentration data sequence and environmental parameter sequence output by the data acquisition module. The process of constructing a multimodal dictionary by the adaptive dictionary learning module is as follows.
[0029] After acquiring historical methane concentration data sequences, the adaptive dictionary learning module calculates the autocorrelation function (ACF) of these sequences. The delay variable of the ACF starts from zero and increases with sampling intervals. For each delay value, the ACF coefficient of the historical methane concentration data sequence at that delay is calculated. When the ACF coefficient first crosses zero from a positive value to a negative value with increasing delay, the delay time corresponding to this zero-crossing is recorded. The delay time corresponding to the first zero-crossing of the ACF function is used as the sliding window length. If the sampling frequency of the historical methane concentration data sequence is once per hour, and the ACF function shows its first zero-crossing at a delay of 12 sampling points, then the sliding window length is set to 12 sampling points. The environmental parameter sequence uses the same sliding window length as the methane concentration data sequence.
[0030] After determining the sliding window length, the adaptive dictionary learning module slides across the historical methane concentration data sequence with a preset sliding step size, extracting multiple methane concentration data segments. The sliding step size is set to half the sliding window length. Simultaneously, at the same time position in the environmental parameter sequence, multiple environmental parameter data segments are extracted with the same sliding window length and sliding step size, ensuring that each methane concentration data segment has a strictly temporally corresponding environmental parameter data segment. Each pair of corresponding methane concentration data segments and environmental parameter data segments is standardized using z-score standardization, i.e., subtracting the mean of each sequence segment and dividing by the standard deviation of the respective sequence segment. The standardized methane concentration data segment vector and environmental parameter data segment vector are concatenated end-to-end to form a joint feature vector, which serves as a training sample. All training samples are arranged column-wise to form a training sample matrix, with each column of the training sample matrix being a training sample vector.
[0031] The adaptive dictionary learning module performs empirical mode decomposition on the methane concentration data segment in each training sample to obtain a set of intrinsic mode functions. The implementation of empirical mode decomposition is as follows: Find all local maxima and local minima in the methane concentration data segment, and construct the upper and lower envelopes respectively using cubic spline interpolation; calculate the mean of the upper and lower envelopes, and subtract this mean from the methane concentration data segment to obtain the intermediate signal; determine whether the intermediate signal satisfies the criteria for intrinsic mode functions (IMFs). The criteria include that the number of extreme points of the intermediate signal is equal to or differs by at most one from the number of zero-crossing points, and that the mean of the upper envelope determined by the local maxima and the lower envelope determined by the local minima at any point is zero; if the criteria are met, the intermediate signal is taken as an IMF, and this IMF is subtracted from the methane concentration data segment to obtain the residual component; repeat the above process of finding the mean and judging the residual component until the residual component becomes a monotonic function or a constant; finally, all the IMFs obtained from the decomposition of the methane concentration data segment constitute the initial dictionary atoms of the methane concentration data segment. Empirical Mode Decomposition (EMD) is also performed on the environmental parameter data segments in the training samples to obtain the intrinsic mode functions (IMFs) corresponding to the environmental parameter data segments as initial dictionary atoms. After collecting all IMFs obtained from the decomposition of all training samples, they are normalized according to the vector dimension to form an initial dictionary atom set. Redundancy removal is performed on the initial dictionary atom set, and the cosine similarity between any two normalized initial dictionary atoms is calculated. If the cosine similarity between two initial dictionary atoms is higher than a preset similarity threshold, one initial dictionary atom is retained, and the other is deleted. The preset similarity threshold is set to 0.95. The redundancy-removed initial dictionary atoms are arranged column-wise to form the initial dictionary matrix.
[0032] After obtaining the initial dictionary matrix, the adaptive dictionary learning module utilizes... The algorithm iteratively updates the multimodal dictionary. The algorithm takes a training sample matrix and an initial dictionary matrix as input. An iteration counter is set. The initial value is Current dictionary matrix This is the initial dictionary matrix. (In the iteration counter...) At this time, perform an initial sparse encoding: fix the current dictionary matrix. For each training sample vector in the training sample matrix, the orthogonal matching pursuit algorithm is used to calculate the sparse coefficient vector; the upper limit of sparsity for the orthogonal matching pursuit algorithm is set to . That is, each training sample vector can be used at most The dictionary atoms are used for representation; the orthogonal matching pursuit algorithm uses an additional stopping condition that the residual energy is less than one-hundredth of the energy of the original training sample vector. After obtaining the sparse coefficient vector of all training sample vectors, they are arranged column-wise to form a sparse coefficient matrix. And calculate the initial reconstruction error. , It equals the sum of squared reconstruction errors of all training sample vectors in the training sample matrix, and the reconstruction error vector of a single training sample vector is the training sample vector minus the current dictionary matrix. The product of the sparse coefficient vector corresponding to the training sample vector.
[0033] Then it enters the iterative update process. The specific steps of this iteration are as follows: from Start incrementing. Sparse coding stage: Fix the dictionary matrix after the previous iteration update. For each training sample vector in the training sample matrix, the orthogonal matching pursuit algorithm is used to recalculate the sparse coefficient vector. The sparsity upper limit and additional stopping conditions are the same as in the initial sparse coding stage, resulting in the updated sparse coefficient matrix. Dictionary update phase: This involves updating the dictionary matrix. Each atom in each column of the dictionary matrix, i.e., each dictionary atom, is updated sequentially according to its atom index. Let the atom to be updated be the [number]th atom in the dictionary matrix. Atoms In the sparse coefficient matrix Find the one that used the first Set of training sample vector indices of atoms , using the The definition of the _ atom is the _ th atom in the corresponding sparse coefficient vector. The coefficients are all non-zero. If the index set If empty, then keep the first The number of atoms remains unchanged. If the index set If not empty, then calculate the residual matrix. residual matrix The calculation method is as follows: extract the corresponding index set from the training sample matrix. Submatrix formed by columns Subtracting the first The sum of the products of all atoms other than the first atom and their corresponding rows in the submatrix coefficients; the summation over all other atoms is within the range of all atom indices in the dictionary. , For each atom index Obtain the coefficient submatrix Corresponding atomic index The row vectors, and the atoms Perform the outer product operation and sum the results. For the residual matrix... Perform singular value decomposition to obtain ,in It is a left singular vector matrix. It is a diagonal singular value matrix. This is the right singular vector matrix. Take the left singular vector matrix. The first column serves as the updated atoms Take the right singular vector matrix The first column and The first singular value The result of the multiplication is used as the updated coefficient row vector, which is then used to replace the sparse coefficient matrix. The middle corresponds to the index set The The original coefficient values in the row. Thus, the first... The update of the first atom and its corresponding coefficient is complete. Perform the above update operation sequentially on all atoms in the dictionary matrix to obtain the first atom. The new dictionary matrix after the next iteration Calculate the first... Reconstruction error after the second iteration , Equal to all training sample vectors in the training sample matrix using a dictionary matrix sparse coefficient matrix The reconstructed sum of squared errors.
[0034] After each iteration, the adaptive dictionary learning module performs a convergence check and calculates the relative change in reconstruction error between two adjacent iterations:
[0035] in, This represents the relative change in reconstruction error during the t-th iteration; This represents the reconstruction error value after the t-th iteration; This represents the reconstruction error value after the (t-1)th iteration; This represents the current iteration number. .
[0036] The adaptive dictionary learning module calculates the relative change value of the reconstruction error. Compared with preset percentage threshold Compare. Preset percentage threshold. The value is 0.1%. The basis for setting it to 0.1% is as follows: During the analysis of historical data in the offline training phase, after a certain number of iterations, the relative change of reconstruction error continues to decrease. When the relative change drops below 0.1%, the computation time required for continued iteration is disproportionate to the improvement in the accuracy of the obtained dictionary representation. The performance of atomic morphology and sparse representation tends to stabilize. Therefore, 0.1% is selected as the stopping threshold.
[0037] when When the K-SVD algorithm converges and the iteration stops, the dictionary matrix at this point is... This is the final multimodal dictionary. If... If the condition is met, increment t by 1 and proceed to the next iteration. After the iteration stops, the adaptive dictionary learning module outputs a multimodal dictionary. The dictionary atoms in the multimodal dictionary are recorded according to their source: dictionary atoms originating from intrinsic mode functions obtained through empirical mode decomposition of the methane concentration data segment are labeled as methane concentration-related basis functions; dictionary atoms originating from intrinsic mode functions obtained through empirical mode decomposition of the environmental parameter data segment are labeled as environmental interference basis functions. The multimodal dictionary output is used by the sparse reconstruction module.
[0038] See Figure 6 In the graph, the horizontal axis represents the time delay in units of sampling points, and the vertical axis represents the autocorrelation coefficient of the methane concentration data series, ranging from -1 to 1. The solid line curve in the graph is the autocorrelation function of the historical methane concentration data series, with an initial value of 1. As the time delay increases, the autocorrelation coefficient exhibits a periodic oscillating decay trend, indicating that the methane concentration data has obvious periodicity and correlation. The dashed line in the graph is the zero-value reference line; the intersection of the autocorrelation function and the zero-value reference line is the zero-crossing point of the autocorrelation function.
[0039] The circled area marks the first point where the autocorrelation function crosses zero from a positive value to a negative value, with a delay of approximately 20 sampling points. This first zero-crossing delay is recorded and used to determine the sliding window length. Specifically, when the sliding window length is set to this zero-crossing delay value, the main correlation characteristics of the methane concentration data can be captured, thus providing a suitable historical data truncation length for the subsequent adaptive dictionary learning module.
[0040] Example 3:
[0041] In specific implementation, please refer to Figure 3 The sparse reconstruction module acquires the real-time observation data at the current moment. This data includes methane concentration readings and corresponding environmental parameter readings collected by multiple sensor nodes at the current moment. The sparse reconstruction module converts the real-time observation data into a column vector using the same arrangement as when constructing the training sample vector, resulting in the real-time observation data vector. The arrangement is as follows: first, the methane concentration readings of each sensor node are placed sequentially, followed by the corresponding environmental parameter readings.
[0042] The sparse reconstruction module extracts the current environmental parameter values from the environmental parameter sequence and constructs a regularized weight vector. The steps for constructing the regularized weight vector are as follows: Each environmental parameter value is standardized using the mean and standard deviation of the historical environmental parameter sequence; the absolute value of the standardized environmental parameter value is then added to a preset first normal constant to obtain the environmental parameter weight component. The first normal constant is set to 0.01 to prevent the weight component from being zero. For each dictionary atom in the multimodal dictionary, its source attribute is determined. If the dictionary atom is labeled as an environmental interference basis function, the corresponding regularized weight component is set to the corresponding environmental parameter weight component; if the dictionary atom is labeled as a methane concentration-related basis function, the corresponding regularized weight component is set to a preset baseline weight value of 1.0. Following the order of the dictionary atoms in the multimodal dictionary, all weight components are organized into a column vector, which is the regularized weight vector, denoted as [vector name missing]. Using regularized weight vectors Construct the diagonal weight matrix , The diagonal elements are composed of The components are arranged sequentially, and all off-diagonal elements are zero.
[0043] The sparse reconstruction module employs a regularized orthogonal matching pursuit algorithm, combined with a regularized weight vector weighting. The norm is used as a penalty term to solve for the sparse coefficient vector. The input to the algorithm is a vector of real-time observation data. Multimodal dictionary Diagonal weight matrix and preset threshold Preset threshold Set as real-time observation data vector of The norm is multiplied by a scaling factor of 0.05. The scaling factor is set to 0.05 because in offline experimental analysis, when the residual energy drops to 5% of the observed signal energy, the reconstructed signal can stably maintain the effective characteristics of methane concentration changes. Further reducing the residual energy has limited effect on improving the accuracy of concentration estimation and will increase the number of iterations.
[0044] Initialize residual vector Supports collection An empty set, an iteration counter Set to 0. In the first... In the next iteration, the residual vector is calculated. With multimodal dictionary The inner product vector is obtained by taking the inner product of each dictionary atom. Using a diagonal weight matrix For inner product vectors Apply weighting Norm penalty effect, calculating the corrected inner product vector The correction method is to change the inner product vector. Each component is divided by the sum of its corresponding weighted component and the second positive constant, i.e. ,in Represents the modified inner product vector The One portion, Represents the inner product vector The One portion, Represents the diagonal weight matrix The diagonal elements, The penalty intensity coefficient, Atomic index for the dictionary. Penalty strength coefficient. The value is 0.1, which is used to adjust the degree of influence of environmental parameter weights on atom selection.
[0045] Corrected inner product vector After taking the absolute value, select the one with the largest absolute value. A set of dictionary atoms as candidate atoms Set to 5. Perform regularized grouping and filtering on the candidate atom set: Use the atom with the largest absolute value of the modified inner product in the candidate atom set as the reference atom. Select all atoms in the candidate atom set whose absolute value of the modified inner product is not less than 0.5 times the absolute value of the modified inner product of the reference atom to form the selected atom subset. Add all atom indices from the selected atom subset to the support set and update the support set. .
[0046] With the updated support set Based on, from the multimodal dictionary Extract the corresponding columns to form a sub-dictionary matrix In the sub-dictionary matrix The solution is weighted. The least squares problem of norm penalty terms, obtaining the coefficient vector on the support set. The solution is in the form of:
[0047] in, Represents the coefficient variable to be solved; For real-time observation data vectors; To support the sub-dictionary matrix corresponding to the set; The Euclidean norm of a vector is denoted as . Norm; Representing vectors Norm; This is a regularization parameter used to balance reconstruction error and sparsity. The value is 0.01; From the diagonal weight matrix Extract the diagonal submatrix consisting of rows and columns corresponding to the support set, where the diagonal elements are the weight components corresponding to each index in the support set. The above minimization problem is solved using the coordinate descent method to obtain the sparse coefficient subvector. Set all coefficient values corresponding to indices in the non-supporting set to zero, and combine them to obtain the complete sparse coefficient vector. .
[0048] Calculate the reconstructed signal vector Update the residual vector. Determine the stopping condition for the iteration; the stopping condition is the residual vector. Norm less than preset threshold .like If the condition is met, the iteration terminates and the current sparse coefficient vector is output. As the final sparse coefficient vector. If not, then let Then proceed to the next iteration. After the iteration terminates, the sparse reconstruction module retrieves the final reconstructed signal vector. The reconstructed methane concentration portion is extracted from the real-time observed data vector based on the arrangement of methane concentration readings. This reconstructed methane concentration portion is then de-standardized using the mean and standard deviation of historical methane concentration data to obtain an estimated methane concentration. The sparse reconstruction module outputs the final sparse coefficient vector and the estimated methane concentration.
[0049] See Figure 7 In the figure, the horizontal axis represents time (sampling point), the left side of the vertical axis represents methane concentration (ppm), and the right side of the vertical axis represents reconstruction residual (ppm). The solid curve represents the comparison between the methane concentration estimate output by the sparse reconstruction module and the real-time observation data, the dashed curve represents the methane concentration estimate, and the dotted curve represents the reconstruction residual, that is, the difference between the methane concentration estimate and the real-time observation data.
[0050] As shown in the figure, the dashed line representing the methane concentration estimate largely overlaps with the solid line representing the real-time observation data. This indicates that the sparse reconstruction module, based on a multimodal dictionary and a regularized orthogonal matching pursuit algorithm, has effectively represented and accurately estimated the methane concentration at the current moment. The methane concentration exhibits obvious periodic fluctuations, with a period of approximately 100 sampling points, consistent with the time-varying dynamic characteristics of methane concentration under the influence of environmental parameters.
[0051] The reconstructed residual curves are displayed as dotted lines with small amplitude variations, mainly fluctuating within ±1.0 ppm. The residuals exhibit a random distribution without significant systematic bias, indicating that the sparse reconstruction module effectively suppresses the influence of environmental interference basis functions on the estimation results, maintaining the stability and accuracy of the concentration estimation. The magnitude of the residuals is smaller compared to the overall methane concentration variation range (approximately 44 ppm to 56 ppm), validating the effectiveness of the regularized weight vector and weighted average. The norm penalty term effectively modulates the solution of sparse coefficients.
[0052] Example 4:
[0053] In specific implementation, please refer to Figure 4 The anomaly detection module obtains the reconstructed residual sequence corresponding to the historical methane concentration data sequence from the sparse reconstruction module. The historical methane concentration data sequence refers to the set of methane concentration observation data covering a sufficiently long time span, used to construct the multimodal dictionary and perform sparse reconstruction. The reconstructed residual sequence is generated as follows: for each time point in the historical methane concentration data sequence, the reconstructed methane concentration estimate is obtained using the trained multimodal dictionary and the regularized orthogonal matching pursuit algorithm. The difference between the methane concentration estimate and the original methane concentration observation is calculated, and this difference is used as the reconstructed residual value. The reconstructed residual values of each time point are arranged in chronological order to form the reconstructed residual sequence.
[0054] The anomaly detection module sets a fixed sliding window length of 24 sampling points. This value is based on the following: for hourly methane concentration monitoring scenarios, 24 sampling points correspond to a diurnal cycle, which can adequately cover periodic fluctuations caused by environmental factors, while avoiding the introduction of excessive historical noise due to an excessively long window. The anomaly detection module uses the fixed-length sliding window to slide point-by-point across the reconstructed residual sequence, with a sliding step of 1 sampling point. For each segment of the reconstructed residual sequence covered by the sliding window, the arithmetic mean of all reconstructed residual values within that segment is calculated to obtain the mean of the sliding window residuals corresponding to that window; the sample standard deviation of all reconstructed residual values within that segment is calculated to obtain the standard deviation of the sliding window residuals corresponding to that window. The mean of the sliding window residuals is arranged according to the position of the window's center time point to form a sequence of mean of the sliding window residuals. The standard deviation of the sliding window residuals is arranged according to the position of the window's center time point to form a sequence of standard deviation of the sliding window residuals. The two endpoints of the sliding window residual mean sequence are processed by shrinking the window, that is, the number of reconstructed residual sampling points actually contained in the starting and ending windows gradually increases from 1 to the set sliding window length.
[0055] The anomaly detection module employs a penalized linear regression change point detection algorithm based on the Bayesian information criterion to detect mean changes in the sliding window residual mean sequence. The time index of the sliding window residual mean sequence ranges from 1 to U, where U equals the total number of time points in the reconstructed residual sequence. The sliding window residual mean sequence is denoted as... Construct a piecewise constant linear regression model, assuming there are M variable points, whose positions are denoted as follows in ascending order of time: and agreed , Within the k-th segment, i.e., the time index range Inside, The model assumes that the mean sequence of observations of the sliding window residuals Equal to a constant mean Adding independent and identically distributed Gaussian noise, with a mean of zero and a variance of... .
[0056] The penalized linear regression change point detection algorithm uses dynamic programming to search for the set of change point locations that minimizes the Bayesian information criterion. During the dynamic programming process, for each time index... Maintenance from start to finish The optimal segmentation scheme and the corresponding Bayesian information criterion value are determined. The Bayesian information criterion value is calculated as follows:
[0057] in, This indicates that the number of variable points is And the set of variable point positions is Bayesian information criterion value at time; This is the total length of the sliding window residual mean sequence; The time index in the sliding window residual mean sequence is... Observed values; Indicates a given set of variable points The fitted value reconstructed using the mean of each segment is as follows: Belongs to the period of time Equal to all within this segment The mean; The number of model parameters, including One segmented mean parameter and one variance parameter; The function is the natural logarithm; the summation term is... This is the sum of squared residuals.
[0058] Number of Variable Points Subject to penalty items, the penalty items are: This penalty term increases linearly with the number of variables, limiting the number of segments and preventing over-segmentation. In the specific search operation of the dynamic programming algorithm, a maximum number of variables is set. , Values The integer part, i.e., the number of change points, does not exceed 5% of the sequence length. By traversing all possible change point partitions, the value that makes the change point partitions equal to the integer part of the sequence length is calculated. The globally smallest set of change points is the set of mean change points in the output sliding window residual mean sequence. This set of mean change points divides the sliding window residual mean sequence into several consecutive time periods.
[0059] The anomaly detection module divides the original reconstructed residual sequence into multiple residual distribution segments based on the set of mean change point locations. Specifically, the segmentation method is as follows: taking the time intervals corresponding to two adjacent mean change point locations, all reconstructed residual values within the same time interval are extracted from the reconstructed residual sequence to form a residual distribution segment. Since mean change points are detected on the mean residual sequence of the sliding window, and each mean change point location corresponds to the center time point of the sliding window, the entire interval of the time index corresponding to adjacent mean change points is taken when segmenting the reconstructed residual sequence.
[0060] For each segment of the residual distribution obtained from the segmentation, the anomaly detection module calculates the empirical cumulative distribution of all reconstructed residual values within that segment and obtains the high percentage threshold from the empirical cumulative distribution. The percentage of the high percentage threshold is set to 95%, that is, the 95th percentile of the reconstructed residual values within that segment is taken as the dynamic threshold for that residual distribution segment. If the length of the residual distribution segment is short enough that the 95th percentile falls between two ordinal statistics, a linear interpolation method is used to estimate the percentile value. When performing anomaly detection for the current moment, the anomaly detection module obtains the reconstructed residual of the current methane concentration estimate and determines the corresponding dynamic threshold based on the time period to which the current moment belongs. The reconstructed residual of the current methane concentration estimate is compared with the corresponding dynamic threshold. If the reconstructed residual is greater than the dynamic threshold, the current moment is marked as an anomalous concentration event moment, and an anomaly flag is output.
[0061] See Figure 8In the graph, the horizontal axis represents time (in units of sampling points), and the vertical axis represents the reconstructed residuals (in ppm). The solid curve represents the reconstructed residual sequence corresponding to the historical methane concentration data series. The curve exhibits significant fluctuations overall, reflecting the time-varying nature of the residuals. The dashed curve represents the mean residual sequence of the sliding window. A sliding window with a fixed length of 24 sampling points is used to smooth the mean of the reconstructed residual sequence, showing a stable trend in the mean residual value and capturing the variation characteristics of the mean residual value within the diurnal cycle. The dotted-line curve represents the dynamic threshold, whose value adjusts over time. Its overall trend is similar to but slightly higher than the mean residual sequence of the sliding window, reflecting the dynamic distribution characteristics of the residuals.
[0062] The mean change points, marked by multiple vertical dashed lines in the figure, divide the sliding window residual mean sequence into several continuous intervals. The residual mean remains stable within each interval, while significant jumps exist between intervals, indicating a substantial change in the statistical characteristics of the residual mean at these points. This aligns with the mean change point locations obtained by the penalized linear regression change point detection algorithm based on the Bayesian information criterion. Based on these mean change points, the anomaly detection module divides the original reconstructed residual sequence into several residual distribution segments and then calculates the corresponding dynamic threshold for each segment.
[0063] As shown in the figure, within the time interval from 0 to approximately 140 sampling points, the reconstructed residual sequence exhibits relatively small fluctuations, with both the residual mean and the dynamic threshold remaining at a low level below 0.7 ppm. At the first mean change point, the mean of the sliding window residuals increases significantly. In the subsequent time interval (approximately 140 to 300 sampling points), the residual mean stabilizes at approximately 1 ppm, and the dynamic threshold increases accordingly, reflecting the increase in the background residual level during this stage. Subsequently, at approximately 300 sampling points, a second mean change point occurs, with the residual mean further increasing to approximately 1.5 ppm, and the dynamic threshold also increasing synchronously, indicating a further intensification of the anomaly. Subsequently, at approximately 460 sampling points, both the residual mean and the dynamic threshold decrease significantly, returning to near their initial levels, and the fluctuation amplitude of the reconstructed residuals also decreases significantly, indicating the mitigation or disappearance of the anomaly.
[0064] Example 5:
[0065] In practical implementation, the concentration calibration module pre-builds a calibration experimental platform in a laboratory environment to obtain the sparse coefficient feature vectors of sensor nodes under different known methane concentrations, which are used to construct a calibration database of feature vectors and concentrations. The laboratory environment generates a series of standard gases with known methane concentrations through a gas mixing system. The accuracy of the known methane concentrations is determined by the mass flow controller in the gas mixing system. The concentration values cover multiple discrete points from 0 ppm to the upper limit of the sensor range. The number of concentration values is set to 20, with a denser distribution in the low concentration range and a relatively sparse distribution in the high concentration range. The specific concentration points are set as follows: 0, 5, 10, 20, 30, 50, 70, 100, 150, 200, 300, 400, 500, 700, 1000, 1500, 2000, 3000, 4000, and 5000 ppm. For each known methane concentration value, the sensor node is placed in a standard gas environment and run stably for a preset time, which is set to 10 minutes, to ensure that the sensor response reaches a balanced state. Then, the raw methane concentration data sequence and environmental parameter sequence collected by the sensor node within the preset time and space window are recorded. The environmental parameter sequence includes temperature, humidity and air pressure readings.
[0066] For each known methane concentration, the raw methane concentration data sequence and environmental parameter sequence collected are used. The concentration calibration module utilizes a pre-trained multimodal dictionary and a regularized orthogonal matching pursuit algorithm to sparsely represent the real-time observation data at each sampling time, obtaining the sparse coefficient vector corresponding to each sampling time. The sparse coefficient vectors corresponding to all sampling times at a known methane concentration are arranged column-wise, and the column mean of the sparse coefficient vector matrix is calculated. This column mean vector is used as the sparse coefficient feature vector corresponding to that known methane concentration. After obtaining the sparse coefficient feature vectors corresponding to all known methane concentrations, each sparse coefficient feature vector is paired with its corresponding known methane concentration value to form a record. All records constitute the calibration database. The calibration database is stored in tabular form, with each row containing the component values of each dimension of a sparse coefficient feature vector and the corresponding known methane concentration value.
[0067] The training process of the kernel ridge regression model uses data from a calibration database. All sparse coefficient eigenvectors in the calibration database are used as the input feature matrix, with each row representing a sample and corresponding to a sparse coefficient eigenvector at a known methane concentration. The dimension of the input feature matrix is the number of samples multiplied by the dimension of the sparse coefficient eigenvectors. All known methane concentration values in the calibration database are used as the output target vector, with the dimension of the output target vector being the number of samples.
[0068] The kernel ridge regression model uses a Gaussian kernel function to calculate the similarity between two sparse coefficient feature vectors in the input space. The Gaussian kernel function is expressed as follows: ,in This represents the sparse coefficient feature vector of the a-th sample. This represents the sparse coefficient feature vector of the b-th sample. This represents the Euclidean distance between two sparse coefficient eigenvectors. The bandwidth parameter of the Gaussian kernel function. It is an exponential function with base e. Bandwidth parameter. The value is set to ,in This represents the dimension of the eigenvectors of the sparse coefficients. This represents the mean variance of each dimension of the eigenvectors of all sparse coefficients in the calibration database. This setting allows the response scale of the Gaussian kernel function to adapt to the distribution range of the input data.
[0069] The prediction function of the kernel ridge regression model is ,in This represents the sparse coefficient feature vector corresponding to the abnormal concentration event to be predicted. This represents the total number of samples in the calibration database; For sample index; This represents the combination coefficient corresponding to the sample with index 'a'; This represents the sparse coefficient feature vector of the sample with index a. With the eigenvector of the sparse coefficients to be predicted The Gaussian kernel function values between. Combination coefficient vector. The objective function is obtained by minimizing the regularized mean square error on the training set. ,in Let be the kernel matrix, and the element in the a-th row and b-th column of the kernel matrix is... ; The output target vector is represented by the a-th element, which is the known methane concentration value corresponding to the a-th sample in the calibration database. These are the regularization parameters. The candidate values are selected from a pre-defined set of candidate values using leave-one-out cross-validation. The candidate value set is set as follows: .
[0070] The specific steps of leave-one-out cross-validation are as follows: for each candidate regularization parameter in the candidate value set... The algorithm sequentially uses all samples from the calibration database except for the a-th sample as training subsets, solves for the combination coefficient vector, predicts the concentration value of the a-th sample, and calculates the squared error between the predicted concentration value and the known methane concentration value of the a-th sample. It then iterates through all samples a from 1 to N, obtaining N squared prediction error values, and calculates the average of these N squared prediction error values as the candidate regularization parameter. The corresponding cross-validation error. Compare the cross-validation errors of all candidate regularization parameters, and select the candidate regularization parameter that minimizes the cross-validation error as the final regularization parameter. The closed-form solution for the combination coefficient vector is: ,in To train the kernel matrix corresponding to the subset, To train the target vector corresponding to the subset, It is an identity matrix.
[0071] During the online inversion phase of abnormal concentration events, the concentration calibration module receives the sparse coefficient vector corresponding to the abnormal concentration events marked by the anomaly judgment module, and uses this sparse coefficient vector as the sparse coefficient feature vector to be predicted. The input is then fed into the trained kernel ridge regression model. The concentration calibration module utilizes all the sparse coefficient eigenvectors in the stored calibration database and the optimal regularization parameter selected through leave-one-out cross-validation. Alternatively, the global combination coefficient vector can be recalculated, or it can be stored during the training phase and used directly in the online phase. The calculation method involves using the sparse coefficient feature vectors of all N samples in the calibration database and the known methane concentration values, along with regularization parameters. The combination coefficient vector is calculated using the closed-form formula for the combination coefficients. For sparse coefficient eigenvectors Calculate the Gaussian kernel function value between it and the sparse coefficient eigenvector of each sample in the calibration database to obtain the kernel vector. Kernel vector The a-th component is Kernel vector With combination coefficient vector Perform a dot product operation to obtain the precise concentration value. The output precise concentration value serves as the final calibration result of the methane concentration corresponding to this abnormal concentration event.
[0072] See Figure 9 In the figure, the horizontal axis represents the known methane concentration (unit: ppm), and the vertical axis represents the predicted accurate concentration (unit: ppm). The legend uses star-shaped markers to indicate known concentration points of the calibration samples, covering multiple discrete concentration values from 0 ppm to 5000 ppm, consistent with the concentration setting range of the calibration database described in Example 5. Circular markers represent the corresponding predicted accurate concentration values, and the dashed line represents the ideal fitting line, indicating the ideal state where the predicted concentration value is completely consistent with the known concentration value.
[0073] The predicted precise concentration values in the figure are densely distributed near the ideal fitting line, demonstrating the high accuracy of the kernel ridge regression model in online inversion of anomalous concentration events using the calibration database. In particular, it maintains good fitting performance in both the low concentration range (0~1000ppm) and the high concentration range (4000~5000ppm), verifying the effectiveness of the kernel ridge regression mapping relationship between the sparse coefficient eigenvector and methane concentration in Example 5. The known concentration points marked by the star are evenly distributed, and the difference between the predicted and known concentration values is minimal, further illustrating the accuracy and reliability of the correspondence between the sparse coefficient eigenvector and concentration constructed by the calibration database.
[0074] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A big data-based intelligent methane concentration monitoring system, characterized in that, The system includes: The data acquisition module is used to acquire raw data sequences of methane concentration and environmental parameters from multiple sensor nodes within a preset spatiotemporal window. An adaptive dictionary learning module is used to perform joint sparse coding on the original methane concentration data sequence and the environmental parameter sequence to construct a multimodal dictionary, which includes basis functions related to methane concentration and environmental interference basis functions. The sparse reconstruction module is used to perform sparse representation of the real-time observation data at the current moment based on the multimodal dictionary, and to solve the sparse coefficients through the regularized orthogonal matching pursuit algorithm to reconstruct the methane concentration estimate. An anomaly detection module is used to compare the estimated methane concentration with a dynamic threshold established based on historical data and mark abnormal concentration events. The concentration calibration module is used to invert and obtain accurate concentration values by utilizing the mapping relationship between the sparse coefficients corresponding to the abnormal concentration events marked by the anomaly determination module and the known calibration gas concentrations.
2. The intelligent methane concentration monitoring system based on big data as described in claim 1, characterized in that, The data acquisition module specifically performs the following: The original methane concentration data sequence and the environmental parameter sequence were timestamped to identify missing values; The missing value is imputed using a time series decomposition-based method. The data of the two sampling points before and after the missing value are decomposed into trend components, seasonal components and residual components. The residual components are linearly imputed, and the trend components and seasonal components are superimposed to obtain the imputed value. Output aligned and interpolated methane concentration data sequences and environmental parameter sequences.
3. The intelligent methane concentration monitoring system based on big data as described in claim 1, characterized in that, The adaptive dictionary learning module is specifically executed as follows: The historical methane concentration data sequence is segmented according to a preset sliding window length, and each segment is subjected to empirical mode decomposition to obtain multiple intrinsic mode functions as initial dictionary atoms. All initial dictionary atoms are merged into an initial matrix, and the K-SVD algorithm is used for iterative updates. In each iteration, the dictionary is fixed and each data segment is sparsely encoded. Then, the dictionary atoms and corresponding coefficients are updated according to the sparse encoding results until the reconstruction error converges, and the multimodal dictionary is output.
4. The intelligent methane concentration monitoring system based on big data as described in claim 1, characterized in that, The sparse reconstruction module is specifically executed as follows: The real-time observation data is vectorized, sparsely represented using the multimodal dictionary, and an environmental parameter sequence is introduced as a regularization weight vector. Using the weighted L1 norm of the regularized weight vector as a penalty term, the dictionary atoms are selected step by step using the regularized orthogonal matching pursuit algorithm, and the residual vector is calculated. When the residual norm is less than a preset threshold, the iteration stops, and the sparse coefficients and the reconstructed methane concentration estimate are output.
5. The intelligent methane concentration monitoring system based on big data as described in claim 1, characterized in that, The anomaly detection module specifically performs the following: Based on the reconstructed residuals of the historical methane concentration data sequence, the mean and standard deviation of the residuals within the sliding window are calculated. A penalized linear regression change point detection algorithm based on the Bayesian information criterion is used to detect the change point of the mean of the residual sequence. For each segment of residual distribution after the mean change point is divided, a high percentage threshold is dynamically calculated. The reconstructed residual of the current methane concentration estimate is compared with the high percentage threshold, and the moment that exceeds the threshold is marked as an abnormal concentration event.
6. The intelligent methane concentration monitoring system based on big data as described in claim 1, characterized in that, The concentration calibration module performs the following specific actions: The sparse coefficient feature vectors of sensor nodes at different known methane concentrations were obtained in advance in the laboratory, and a calibration database of feature vectors and concentrations was constructed. For the sparse coefficient feature vectors corresponding to abnormal concentration events, a kernel ridge regression model is used to map and obtain accurate concentration values. The kernel ridge regression model calculates the similarity between feature vectors using a Gaussian kernel function and selects regularization parameters through leave-one-out cross-validation.
7. The intelligent methane concentration monitoring system based on big data as described in claim 3, characterized in that, When the adaptive dictionary learning module segments the historical methane concentration data sequence according to a preset sliding window length, the sliding window length is determined based on the delay time corresponding to the first zero-crossing point of the autocorrelation function of the historical methane concentration data sequence.
8. The intelligent methane concentration monitoring system based on big data as described in claim 3, characterized in that, When the adaptive dictionary learning module iterates and updates using the K-SVD algorithm, the iteration stops when the relative change in reconstruction error between two adjacent iterations is less than a preset percentage threshold.
9. The intelligent methane concentration monitoring system based on big data as described in claim 5, characterized in that, When the anomaly detection module uses the penalized linear regression change point detection algorithm based on the Bayesian information criterion, it constructs a linear regression model of the reconstructed residual sequence in chronological order, adds a penalty term to limit the number of change points, searches for the set of change point positions that minimizes the Bayesian information criterion through dynamic programming, and outputs the mean segmentation result of the residual sequence.
10. The intelligent methane concentration monitoring system based on big data as described in claim 2, characterized in that, When the data acquisition module uses a time series decomposition-based interpolation method for missing values, the time series decomposition uses the STL decomposition algorithm to decompose the data of the two sampling points before and after the missing value into trend components, seasonal components, and residual components. The residual components are then subjected to cubic spline interpolation and superimposed with the trend components and seasonal components to obtain the interpolated value.
