A method and system for identifying and tracing abnormalities in pressure gauge calibration data
Through adaptive normalization and a five-layer network architecture anomaly recognition model, the problems of data distortion and insufficient anomaly recognition in pressure gauge calibration are solved, and accurate data reflection and efficient anomaly recognition under temperature fluctuations are achieved.
Patent Information
- Application Number
- CN202510919091.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-07-04
AI Technical Summary
Existing technologies suffer from data distortion in pressure gauge calibration, are unable to effectively identify multiple abnormal patterns, are insufficiently sensitive to low-density abnormal areas, and have weak dynamic response capabilities, resulting in missed detections or false detections.
An adaptive normalization method is used to eliminate the nonlinear influence of temperature, and an anomaly recognition model with a five-layer network architecture is constructed, including long short-term memory network, gated multi-head attention, dual-stream gated fusion and multi-scale feature pyramid. Feature mapping is combined with clustering analysis and anomaly injection mechanism to enhance the model's sensitivity to low-density anomalies and its dynamic response capability.
It achieves accurate reflection of the real state of data under temperature fluctuations, can handle long-term and short-term dependencies at the same time, improves the accuracy and dynamic response capability of anomaly recognition, and enhances the ability to recognize low-density anomalies.
Smart Images

Figure CN120429757B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of pressure gauge calibration, and in particular to a method and system for identifying and tracing abnormality in pressure gauge calibration data. Background Art
[0002] In the industrial field, pressure gauges have high requirements for data accuracy, reliability and anomaly detection capabilities during the calibration process. As a key measuring device, the accuracy of pressure gauges is directly related to production safety and product quality.
[0003] Existing technologies such as patents CN120013235A and CN119148044B disclose methods for diagnosing abnormalities in electricity meters. However, conventional normalization methods cannot effectively eliminate the nonlinear influence of ambient temperature, resulting in data distortion or masking of abnormal patterns; it is difficult to simultaneously identify multiple abnormal patterns, and the sensitivity to low-density abnormal areas is insufficient; it cannot effectively enhance key time step features, nor can it suppress the interference of noise features, the dynamic response capability is weak, and it cannot capture instantaneous changes in a timely manner, making the model prone to missed detections or false detections when facing complex working conditions. Summary of the Invention
[0004] In order to solve the technical problems of easy missed detection or false detection in the prior art, the present invention provides a method and system for identifying and tracing abnormalities in pressure gauge calibration data.
[0005] The present invention is achieved through the following technical solutions:
[0006] A method for identifying and tracing abnormalities in pressure gauge calibration data, comprising:
[0007] S1. Pressure gauge calibration data collection and marking;
[0008] S2, temperature compensation normalization processing, including normalization processing based on an adaptive normalization function;
[0009] S3, anomaly recognition model construction, including the construction of anomaly recognition model based on a five-layer network architecture;
[0010] S4, identifying anomalies in pressure gauge calibration data, including identifying anomalies in the input pressure gauge calibration data based on the constructed anomaly recognition model, and outputting anomaly category labels and confidence scores;
[0011] S5. Traceability of pressure gauge calibration data, including building a three-level data chain to check the original sensor data in the event of an abnormal event, or tracking the entire life cycle processing trajectory by calibration batch.
[0012] Furthermore, the construction of the adaptive normalization function includes using a polynomial fitting algorithm to establish a relationship model between ambient temperature and pressure readings, calculating a temperature compensation factor based on the material temperature coefficient, reference temperature and current ambient temperature, and dynamically scaling the range using temperature condition distribution parameters combined with the temperature compensation factor to obtain normalized training data.
[0013] Furthermore, the adaptive normalization function expression is as follows:
[0014]
[0015] Where, After normalization Samples at time Pressure value;
[0016] For the Samples at time The original measured pressure value; Temperature The mean pressure under Temperature Standard deviation of pressure under Temperature Temperature compensation factor under ; For the Samples at time ambient temperature.
[0017] Furthermore, the first layer of the five-layer network architecture is a long short-term memory network layer, the second layer is a gated multi-head attention layer; the third layer is a dual-stream gated fusion module; the fourth layer applies a tensor decomposition dimensionality reduction mechanism to compress the fused third-order feature tensor into a low rank; the fifth layer configures a multi-scale feature pyramid classifier to extract cross-scale features, and finally outputs anomaly classification probability and confidence score.
[0018] Furthermore, the long short-term memory network layer constructs an initialization weight matrix through feature mapping and cluster analysis.
[0019] Furthermore, the long short-term memory network layer adopts an input-dependent adaptive forget gate, which is expressed as:
[0020]
[0021] Where, for The forget gate output vector at the moment; is the Sigmoid activation function; is the learnable weight matrix of the forget gate; for The hidden state vector at time t; is the input vector of LSTM at time t; is the learnable bias vector of the forget gate; is the deviation gain coefficient; is the local deviation vector.
[0022] Furthermore, the long short-term memory network layer adopts an anomaly injection mechanism. Specifically, it adopts a cell state update with an injection of anomaly correction. When updating the cell state vector carrying the long-term memory, an anomaly score item is added based on the standard update method. The anomaly score item is calculated based on the degree of deviation between the current input vector and the global statistical characteristics of the feature map output. After multiplying this anomaly score item by the anomaly injection coefficient, it is directly added to the cell state update result.
[0023] Furthermore, the first level of the three-level data chain stores the original verification data packet; the second level records the data processing trajectory; and the third level binds the model decision evidence, saving the input vector of the anomaly recognition model, the feature activation value output by each network layer, the classification probability distribution and the confidence calculation details.
[0024] The present invention also provides a pressure gauge calibration data anomaly identification and tracing system, based on the pressure gauge calibration data anomaly identification and tracing method described above, comprising:
[0025] Pressure gauge calibration data acquisition and annotation module, which is used to synchronously acquire data from pressure sensors and temperature sensors and perform data annotation;
[0026] A temperature compensation normalization processing module, which is used to perform temperature compensation normalization processing based on an adaptive normalization function;
[0027] Anomaly recognition model construction module, which is used to build anomaly recognition model based on a five-layer network architecture;
[0028] A pressure gauge calibration data anomaly recognition module, which performs anomaly recognition on the input pressure gauge calibration data based on the constructed anomaly recognition model and outputs an anomaly category label and a confidence score;
[0029] The pressure gauge calibration data traceability module is used to check the original sensor data in the event of an abnormal event by building a three-level data chain, or to track the full life cycle processing trajectory by calibration batch.
[0030] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which program instructions of a method for identifying and tracing the abnormality of pressure gauge calibration data are stored. The program instructions of the method for identifying and tracing the abnormality of pressure gauge calibration data can be executed by one or more processors to implement the steps of the method for identifying and tracing the abnormality of pressure gauge calibration data as described above.
[0031] Compared with the prior art, the present invention has the following beneficial effects:
[0032] 1. Adopting the adaptive normalization method, the nonlinear influence of ambient temperature on the pressure gauge calibration data is eliminated by dynamically calculating the temperature-dependent distribution parameters and temperature compensation factors. At the same time, the abnormal characteristics such as drift and mutation are retained, so that the data can still accurately reflect the real state under temperature fluctuations.
[0033] 2. Build a complex network architecture that includes LSTM, gated multi-head attention, dual-stream gated fusion, tensor decomposition, and multi-scale feature pyramid. It can simultaneously process long-term and short-term dependencies, enhance key features, suppress noise, and accurately output anomaly categories and confidence levels through a multi-scale classifier.
[0034] 3. The LSTM initialization weight matrix is constructed through feature mapping and cluster analysis to strengthen the model's focus on low-density abnormal areas, effectively solving the problem of insufficient model sensitivity caused by sparse abnormal samples in existing technologies.
[0035] 4. Adopting input-dependent adaptive forget gate and anomaly injection mechanism, the model’s dynamic response capability to sudden anomalies is enhanced. At the same time, the noise features are filtered through the gated vector to further improve the accuracy of anomaly recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0037] Figure 1 This is a flow chart of a method for identifying abnormalities in pressure gauge calibration data according to an embodiment of the present application;
[0038] Figure 2 is an abnormality detection result in the abnormality mode of pressure gauge calibration data according to an embodiment of the present application;
[0039] Figure 3 This is a comparison of the anomaly recognition accuracy results obtained based on the traditional method and the method of the present invention. DETAILED DESCRIPTION
[0040] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0041] The following describes the embodiments of the present invention through specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0042] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention. The illustrations only show components related to the present invention and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be changed at will, and the component layout form may also be more complicated.
[0043] See also Figure 1 A method for identifying and tracing abnormalities in pressure gauge calibration data includes the following steps:
[0044] S1. Pressure gauge calibration data collection and marking
[0045] The pressure gauge calibration data of the present invention is derived from the real-time interaction between the standard pressure calibration platform and the pressure gauge under test. The data is collected synchronously by a high-precision pressure sensor and a temperature sensor. The pressure sensor records the actual reading of the pressure gauge under test during the pressure increase / decrease calibration cycle at a sampling frequency of 10 times per second, while the temperature sensor collects the ambient temperature value at the same frequency.
[0046] The collected content includes three sets of core data, including the original indication reading sequence of the pressure gauge under the action of the standard pressure source, the ambient temperature value at the corresponding moment, the calibration timestamp and the unique code of the device.
[0047] Furthermore, the collected data is annotated. Data annotation first automatically annotates the basic categories, i.e., “normal” or “out of tolerance”, based on the thresholds set in the verification procedures. Then, the metrology experts review the abnormal patterns.
[0048] The annotation categories are subdivided into four categories, including category “0” corresponding to “normal”, category “1” corresponding to “drift”, category “2” corresponding to “mutation”, and category “3” corresponding to “step”;
[0049] All annotation results are stored in conjunction with the original data, temperature data, and timestamps to form a verification data set with spatiotemporal labels.
[0050] S2. Temperature compensation normalization processing
[0051] Conventional normalization methods, when processing pressure gauge calibration data affected by the nonlinear effects of ambient temperature, can cause data distortion or mask abnormal patterns such as drift and mutation when the temperature fluctuates. This invention eliminates the nonlinear effects of temperature by constructing an adaptive normalization function. The specific steps are as follows:
[0052] 1) Calculate temperature-dependent distribution parameters
[0053] Based on historical calibration data, a polynomial fitting algorithm is used to establish a relationship model between ambient temperature and pressure readings. Then, based on the current ambient temperature, the average and standard deviation of the pressure readings at that temperature are dynamically calculated. The average value reflects the drift law of the pressure reading with temperature changes, and the standard deviation reflects the degree of dispersion of the pressure data at that temperature. The calculation method is expressed as:
[0054]
[0055]
[0056] Where, Temperature The average pressure under the condition of temperature drift is characterized by the temperature drift law of the pressure reading;
[0057] Temperature The pressure standard deviation under , characterizes the degree of dispersion of pressure data;
[0058] is the first polynomial fitting coefficient, obtained by least squares regression fitting of historical data;
[0059] is the second polynomial fitting coefficient, obtained by least squares regression fitting of historical data;
[0060] is the third polynomial fitting coefficient, obtained by least squares regression fitting of historical data;
[0061] For the Samples at time ambient temperature;
[0062] For the Samples at time The original measured pressure value;
[0063] is the total number of historical samples;
[0064] is a positive integer index;
[0065] A positive integer index.
[0066] It should be noted that the polynomial fitting coefficients are obtained by least squares regression fitting of historical data. By collecting a large amount of historical calibration data, which includes measured pressure values at different ambient temperatures, and then using a polynomial fitting algorithm, such as the least squares method, with temperature as the independent variable and pressure as the dependent variable, the above quadratic polynomial relationship is fitted to obtain 、 、 For these three coefficients, the principle of the least squares method is to minimize the sum of the square differences between the observed values and the fitted values, and the coefficients are determined by solving the corresponding normal equations.
[0067] 2) Generate temperature compensation factor
[0068] The material temperature coefficient is set according to the physical characteristics of the pressure gauge. Then, the temperature compensation factor is calculated using the material temperature coefficient, the reference temperature, and the current ambient temperature. This factor is used to dynamically adjust the normalized range and compensate for the range offset caused by temperature changes. It is expressed as:
[0069] Where, Temperature Temperature compensation factor under , used to dynamically scale the normalized range;
[0070] The material temperature coefficient is determined by the physical characteristics of the pressure gauge, for example, it is set to the metal expansion coefficient of the pressure gauge; is the reference temperature, such as, ; For the Samples at time ambient temperature.
[0071] 3) Perform adaptive normalization
[0072] The temperature condition distribution parameters are used to eliminate baseline drift, and the range is dynamically scaled in combination with the temperature compensation factor. Specifically, a preliminary normalization result is obtained based on the original measured pressure value at the current temperature, the average pressure value at that temperature, and the standard deviation of the pressure at that temperature. Then, this preliminary result is multiplied by the temperature compensation factor at the current temperature to obtain the final adaptive normalized pressure value to solve the problem of temperature nonlinear interference while retaining abnormal characteristics such as drift and mutation, which is expressed as:
[0073]
[0074] Where, After normalization Samples at time Pressure value; For the Samples at time The original measured pressure value.
[0075] It should be noted that in the normalization process of the pressure gauge calibration data, the temperature condition distribution parameters and Eliminate baseline drift and incorporate temperature compensation factors Dynamically scale the measurement range to resolve temperature nonlinear interference issues and retain abnormal features such as drift and mutation.
[0076] 4) Training data acquisition
[0077] Define the training data as a vector format and treat the normalized data of each sample as a time series vector, that is, define After normalization samples, representing the training samples;
[0078] After normalization samples consists of the raw measured pressure values at all time steps of a fixed time window, i.e., In time The original measured pressure value is .
[0079] Furthermore, each sample is split into overlapping time step input vectors, and a sliding window is used to generate the input vector of LSTM. Let the time window length be , sliding step length , using continuous windows, the preset window size is , then LSTM in time The input vector is represented as:
[0080] Where, is the input vector of LSTM at time t, such as the last element of the vector is When , the dimension of the input vector of LSTM at time t is 3;
[0081] After normalization Samples at time Pressure value;
[0082] To preset window size;
[0083] After normalization Samples at time Pressure value;
[0084] Indicates transpose.
[0085] In one embodiment, if , , then Sample generation The input vectors of the LSTMs share the same label.
[0086] S3. Construction of anomaly recognition model
[0087] S301. Build an abnormality recognition model
[0088] The anomaly recognition model adopts a 5-layer network architecture, as follows:
[0089] The first layer is the long short-term memory network layer, which receives the time series vector after temperature compensation and normalization, and extracts the temporal dependency features through the memory gating mechanism;
[0090] The second layer is a gated multi-head attention layer, which performs multi-subspace attention weighting on the hidden state sequence output by the long short-term memory network to enhance the key time step features and suppress noise;
[0091] The third layer is a dual-stream gated fusion module, which dynamically fuses the long-term and short-term memory features representing short-term dependencies and the attention features representing long-term dependencies.
[0092] The fourth layer applies a tensor decomposition dimensionality reduction mechanism to compress the fused third-order feature tensor into a low-rank expression to suppress redundancy;
[0093] The fifth layer is configured with a multi-scale feature pyramid classifier, which extracts cross-scale features through parallel multi-layer perceptrons of different granularities and ultimately outputs the anomaly classification probability and confidence score.
[0094] S302, LSTM weight initialization
[0095] To address the problem of insufficient sensitivity of the long short-term memory network to rare anomalies caused by the fact that normal samples far outnumber abnormal samples in pressure gauge calibration data, this paper constructs an initialization weight matrix through feature mapping and cluster analysis to strengthen the model's attention to low-density abnormal areas. The specific steps are as follows:
[0096] 1) Perform feature mapping and cluster analysis
[0097] Apply the feature mapping function to each normalized training sample vector to convert its entire time series into a feature vector. Then, use the k-means clustering algorithm to perform cluster analysis on the feature vectors of all samples to obtain multiple cluster center vectors, which are expressed as:
[0098] Where, For the The output vector of samples after feature mapping; After normalization samples, representing the training samples; Represents k-means clustering operation; For the The center vector of each cluster; is the total number of clusters, determined by the elbow rule; is the feature mapping function; A positive integer index.
[0099] It should be noted that the feature mapping function Feature extraction for time series can optionally be implemented by statistical feature extraction, such as extracting statistical features such as mean, variance, and slope. It can also be implemented by frequency domain feature extraction, such as frequency domain features such as Fourier transform main frequency amplitude. It can also be implemented by deep learning features, such as using convolutional neural networks or autoencoders to extract embedding vectors.
[0100] 2) Calculate the density weight function
[0101] Calculate the density of each cluster, and based on this density, calculate the density weight of the cluster through a specific inverse density weighting function, which is expressed as:
[0102] Where, is the density weight function, with a range of (0,1], which realizes the weighting of low-density clustering; For the The density of a cluster is calculated as ;
[0103] For the The number of samples contained in each cluster;
[0104] For the The radius of a cluster is calculated as the maximum Euclidean distance from the sample in the cluster to the center;
[0105] is the density sensitivity coefficient. The larger the value, the stronger the focus on low-density clustering. For example, ;
[0106] is the natural exponential function.
[0107] 3) Construct cluster correction term
[0108] Multiply the center vector of each cluster by its density weight and the number of samples it contains, then add the weighted results of all clusters, and combine the correction term to adjust the rate to obtain the cluster correction term to enhance the model's initial response ability to low-density abnormal clusters, expressed as:
[0109] Where, is a cluster correction term used to enhance the model's initial response to abnormal clusters;
[0110] Adjust the rate for the correction term and control the correction strength, e.g. .
[0111] 4) Generate initialization weight matrix
[0112] Calculate the global average of all sample feature map output vectors, add this global average to the cluster correction term, and multiply it with the random matrix after dimension expansion to generate the final initialization weight matrix of the long short-term memory network. The initialization weight matrix strengthens the initial sensitivity of the model to abnormal clusters, which is expressed as:
[0113] Where, Initialization weight matrix for LSTM;
[0114] is the LSTM hidden state dimension;
[0115] Indicates repeating the vector times to form a matrix that has the same dimensions as the LSTM initialization weight matrix.
[0116] is a random matrix, e.g., a random matrix sampled from a uniform or normal distribution;
[0117] is the total number of samples.
[0118] It should be noted that through the density weight function The inverse density weighting mechanism is used, that is, low-density clusters get higher weights, so that the initial weight matrix Strengthen the model's initial sensitivity to outlier clusters.
[0119] S303, Adaptive gating processing of LSTM unit
[0120] To address the problems of mixed long-term and short-term dependencies in pressure gauge abnormality patterns and the insufficient dynamic response of the standard long-short-term memory network gating mechanism to sudden abnormalities, the present invention adopts an input-dependent adaptive forget gate and abnormality injection mechanism. The specific steps are as follows:
[0121] 1) Calculate the adaptive forget gate
[0122] A local deviation term is added to the standard forget gate calculation. The local deviation term measures the degree of deviation between the current input vector and the average value in the local time window. The forget gate output vector is obtained based on the local deviation term and the deviation gain coefficient, thereby enhancing the response to local sudden fluctuations. It is expressed as:
[0123]
[0124] Where, for The forget gate output vector at each moment controls the degree of historical memory retention;
[0125] Sigmoid activation function compresses the output to the range [0,1];
[0126] is the learnable weight matrix of the forget gate;
[0127] for The hidden state vector at each moment stores historical timing information;
[0128] is the learnable bias vector of the forget gate;
[0129] is the deviation gain coefficient, which adjusts the local deviation influence strength, such as, Set to 0.2;
[0130] is the local deviation vector, with dimension , characterizes the degree of deviation between the current input and the local mean, and is used to dynamically enhance the responsiveness of the forget gate to local sudden fluctuations. The calculation method is expressed as ;
[0131] is the local mean vector, which is used to calculate the local deviation term. For example, it can be the dimension composed of the average value of the pressure value in the first three time steps of the current moment. It is used to measure the deviation of the current input from the local mean, thereby dynamically adjusting the response ability of the forget gate to local sudden fluctuations.
[0132] 2) Calculate the standard gating signal
[0133] According to the standard long short-term memory network structure, the input gate output vector, candidate state vector and output gate output vector are calculated respectively, which are expressed as:
[0134]
[0135]
[0136]
[0137] Where, for The input gate output vector at the moment controls the entry of new information;
[0138] for The candidate state vector at the moment, storing the new information at the current moment;
[0139] for The output gate output vector at time t controls the final output;
[0140] is the learnable weight matrix of the input gate;
[0141] is the learnable weight matrix of the candidate state;
[0142] is the learnable weight matrix of the output gate;
[0143] is the learnable bias vector of the input gate;
[0144] is the learnable bias vector of the candidate state;
[0145] is the learnable bias vector of the output gate;
[0146] It is the hyperbolic tangent activation function with an output range of [-1,1].
[0147] 3) Inject anomaly-corrected cell state updates
[0148] When updating the cell state vector that carries long-term memory, an anomaly score term is added based on the standard update method. The anomaly score term is calculated based on the degree of deviation between the current input vector and the global statistical characteristics of the feature map output. This anomaly score term is multiplied by the anomaly injection coefficient and directly added to the cell state update result to strengthen the memory of anomaly information that deviates from the global distribution pattern. It is expressed as:
[0149]
[0150] Where, for The cell state vector at each moment carries long-term memory;
[0151] for The cell state vector at the moment;
[0152] is element-wise multiplication;
[0153] is the anomaly injection coefficient, which controls the anomaly correction strength, such as, ;
[0154] is the abnormal score item, and the calculation method is expressed as ;
[0155] is the global mean of the feature map output;
[0156] is the global standard deviation of the feature map output.
[0157] It should be noted that The term representation injects global abnormality information into the cell state to solve the problem of insufficient response to sudden abnormalities.
[0158] 4) Generate hidden state output
[0159] The updated cell state vector is passed through the hyperbolic tangent activation function and then multiplied element-by-element with the output vector of the output gate to generate the hidden state vector at the current moment, which is expressed as:
[0160]
[0161] Where, for The hidden state vector at time t.
[0162] S304, Multi-head Attention Enhancement of Temporal Features
[0163] To address the problem that key features in long sequences are easily diluted and conventional attention mechanisms are insufficient in modeling local continuity, this paper uses a gated multi-head attention layer for feature processing. The specific steps are as follows:
[0164] 1) Calculate the query-key-value projection matrix
[0165] The sequence matrix composed of the hidden state vectors at all moments output by the long short-term memory network layer is linearly projected through three different learnable weight matrices to generate the query matrix, key matrix and value matrix, which are expressed as:
[0166]
[0167] Where, is the query matrix, used to retrieve key time step features; is the key matrix, used to match query features; is a value matrix that stores the feature information to be weighted;
[0168] The hidden state sequence matrix output by the LSTM layer is a matrix composed of the hidden state vectors of all moments arranged in chronological order, where each row corresponds to the hidden state vector of a time step, such as Row correspondence The hidden state vector at time ;
[0169] is the learnable weight matrix for query projection; is the learnable weight matrix for key projection; is the learnable weight matrix for value projection.
[0170] 2) Calculate multi-head attention output
[0171] The query matrix, key matrix, and value matrix are split and projected into multiple subspaces, i.e., multiple attention heads. In each attention head, the dot product of the query matrix and the key matrix is calculated independently and scaled. The attention score is obtained by the Softmax function, and this attention score is multiplied by the value matrix to obtain the weighted output of the attention head. Then, the outputs of all attention heads are spliced and integrated through the linear projection weight matrix to obtain the output matrix of the multi-head attention, so that the model can focus on the information of different feature subspaces in parallel, which can be expressed as:
[0172]
[0173]
[0174] Where, For the The output matrix of the attention head, and is the output matrix of the first attention head, For the The output matrix of the attention head;
[0175] For the The query projection weight of the attention head, dimension ; For the The key projection weight of the attention head, dimension ; For the The value projection weight of the attention head, dimension ;
[0176] The dimension of the query and key vectors for each attention head. This is used to scale the dot product results when computing the attention scores to prevent gradient vanishing. For example, its value is set to the dimension of the input vector divided by the number of attention heads.
[0177] Denotes the attention calculation function, which is calculated by taking the dot product of the transpose of the query matrix and the key matrix and then dividing it by Scale, then convert the result into probability distribution through Softmax function, the probability distribution represents the attention score, and finally multiply the attention score with the value matrix to obtain the weighted value vector, which is calculated as ;
[0178] is the Softmax function;
[0179] The output matrix of the multi-head attention is obtained by concatenating the outputs of multiple attention heads and then performing linear projection. It is used to integrate the information of each attention head and enhance the model's ability to learn different feature subspaces.
[0180] for The transpose of
[0181] The projection weight matrix after multi-head splicing is learned through the training process. It is randomly initialized during model initialization and then continuously updated through the back-propagation algorithm according to the loss function during training to optimize the performance of the model.
[0182] is the splicing operation along the feature dimension;
[0183] is the number of attention heads, such as, .
[0184] 3) Generate gate vector
[0185] The hidden state sequence matrix output by the long short-term memory network layer is processed by the activation function of the linear transformation layer to obtain the gate vector, which is expressed as:
[0186]
[0187] Where, is the gate vector, with the same dimension as same;
[0188] is the gating weight matrix;
[0189] is the gate bias vector.
[0190] 4) Executive gated attention enhancement
[0191] The output matrix of the multi-head attention is multiplied element-by-element by the gate vector. The gate vector is used to suppress the interference of noise features irrelevant to abnormality recognition and enhance the key time step features, which can be expressed as:
[0192]
[0193] Where, Enhance the feature matrix for attention.
[0194] It should be noted that through the gate vector Filter out noise interference that is not related to anomalies and solve the problem of insufficient long-range dependency modeling.
[0195] S305. Feature fusion and dimensionality reduction
[0196] To address the issues of temporal correlation disconnection and overfitting of high-dimensional features caused by traditional fully connected layer splicing features, this paper adopts a dual-stream gated fusion module and a tensor decomposition dimensionality reduction mechanism for feature processing. The specific steps are as follows:
[0197] 1) Constructing long-short dependency feature flow
[0198] The long short-term memory network hidden state sequence matrix representing short-term dependency features and the gated attention enhanced feature matrix representing long-term dependency features are linearly projected into the feature space of the same dimension through their respective learnable projection weight matrices and bias vectors to obtain the short dependency feature flow matrix and the long dependency feature flow matrix, which are expressed as:
[0199]
[0200]
[0201] Where, is the feature matrix after projection of the short dependency feature flow, and its dimension is same;
[0202] is the feature matrix after projection of the long-dependency feature flow, and its dimension is same;
[0203] is the learnable projection weight matrix of the short dependency feature flow, which is optimized through training;
[0204] It is a learnable projection bias vector for the short dependency feature stream, optimized through training;
[0205] It is a learnable projection weight matrix of long-dependency feature flow, optimized through training;
[0206] It is a learnable projection bias vector for long-dependency feature streams, optimized through training;
[0207] is the ReLU activation function;
[0208] The hidden state sequence matrix output by the LSTM layer;
[0209] Enhance the feature matrix for attention.
[0210] 2) Computing dynamic fusion gating
[0211] The short dependency feature flow matrix and the long dependency feature flow matrix are spliced along the feature dimension, and the spliced matrix is passed through the activation function of the linear transformation layer to generate a dynamic fusion gating vector, which is used to adaptively control the fusion ratio of short and long dependency features, expressed as:
[0212]
[0213] Where, is the gating weight matrix;
[0214] is the dynamic fusion gate vector, the value range , control the weighted ratio of short / long dependency features;
[0215] is a gated learnable bias vector optimized through training;
[0216] is the concatenation operation along the feature dimension.
[0217] 3) Perform tensor fusion and dimensionality reduction
[0218] The feature matrix after the projection of the short-dependent feature flow and the feature matrix after the projection of the long-dependent feature flow are fused to obtain a fused third-order tensor. Then, Tucker decomposition is applied to this fused third-order tensor to obtain a reduced-dimensional third-order tensor, thereby suppressing noise redundancy and retaining the low-rank structure of cross-scale abnormal features, which is expressed as:
[0219]
[0220]
[0221] Where, It is the third-order tensor after fusion, representing the features after gated weighted fusion;
[0222] is the third-order tensor after dimensionality reduction, representing the low-rank features after Tucker decomposition compression;
[0223] Indicates that the tensor is The product of the modules, that is, represents the product of the tensor at the first modulus, represents the product of the tensor at the second modulus, Represents the product of the tensor at the 3rd mode;
[0224] is the first modal factor matrix of Tucker decomposition, which is optimized through training;
[0225] is the second modal factor matrix of Tucker decomposition, which is optimized through training;
[0226] is the third modal factor matrix of Tucker decomposition, which is optimized through training.
[0227] Furthermore, define To reduce the dimension of the output feature, the reduced third-order tensor After vectorization.
[0228] It should be noted that after fusion, the third-order tensor In the calculation process, short / long dependency weights are assigned through dynamic gating, and the low-rank structure of cross-scale abnormal features is retained in combination with tensor decomposition to solve the problems of feature redundancy and overfitting.
[0229] It should also be noted that in the dynamic fusion gating mechanism of the present invention, the dynamic fusion gating vector The adaptive weights are generated by the Sigmoid function to achieve weighted fusion of short-term mutations and long-term drifts. The term is used to strengthen short-dependency features, such as step anomalies, The term is used to enhance long-term dependency features, such as slow drift.
[0230] It should also be noted that in the process of Tucker decomposition and dimensionality reduction, the fused third-order tensor After decomposition, we get the third-order tensor with reduced dimensionality Finally, the rank of the factor matrix is used to constrain and suppress noise redundancy, thereby retaining the low-rank structure of cross-scale abnormal features and avoiding overfitting.
[0231] S306: Output of classification results based on subtle perception
[0232] To address the problem that traditional classifiers cannot distinguish boundary samples sufficiently and cannot quantify confidence, this paper uses a multi-scale feature pyramid classifier and a confidence calibration module for feature processing. The specific steps are as follows:
[0233] 1) Constructing a multi-scale feature pyramid
[0234] The dimensionality reduction output features are input into multiple multi-layer perceptrons of different complexity. Each multi-layer perceptron represents a different scale and is used to extract features from different abstraction levels and perform classification prediction. The classification prediction output vector at each scale is obtained, which is expressed as:
[0235]
[0236] Where, For the The predicted output vector at scale, The output dimension is consistent with the number of classification categories;
[0237] For the A multi-layer perceptron for multi-scale feature extraction;
[0238] Output features for dimensionality reduction;
[0239] is the scale index, such as, represents the coarse-grained scale, When represents the medium particle size, When represents a fine-grained scale.
[0240] It should be noted that in the multi-scale feature pyramid module, scale differentiation is essentially the difference in feature abstraction granularity, which is achieved through multi-layer perceptron architectures of different complexities. For example, for coarse-grained scales, shallow multi-layer perceptrons with 1-2 hidden layers are used to extract global statistical features to capture overall trend anomalies. For medium-grained scales, medium-depth multi-layer perceptrons with 3-4 hidden layers are used to extract local dynamic features to identify medium-range anomalies. For fine-grained scales, deep multi-layer perceptrons with 5-6 hidden layers are used to extract high-frequency detail features to detect instantaneous anomalies.
[0241] 2) Calculate KL divergence weighted classification
[0242] Calculate the KL divergence between the probability distributions of the predicted outputs of any two different scales to measure the degree of difference in their predictions. Based on the sum of the pairwise differences between all scales, calculate the weighted weight of the prediction for each scale, and perform weighted summation of the predicted probability distributions of all scales based on the weighted weights to obtain the final weighted classification probability distribution, which is expressed as:
[0243]
[0244]
[0245] Where, For the Classification probability distribution under scale;
[0246] For the Scaled learnable weight matrix;
[0247] For the scaled learnable bias vector;
[0248] For the The weighted weight of the scale is calculated based on the KL divergence and is expressed as ;
[0249] is the KL divergence calculation function, such as, Term used to measure distribution and the differences between;
[0250] For the Classification probability distribution under scale;
[0251] For the Classification probability distribution under scale;
[0252] To distinguish from Another scale index of ;
[0253] To distinguish from Another scale index of ;
[0254] is the final weighted classification probability distribution.
[0255] 3) Generate confidence calibration output
[0256] Based on the maximum probability value and the logic function in the final weighted classification probability distribution, the confidence score is calculated, which comprehensively reflects the certainty of the prediction and the uncertainty of the input, and is expressed as:
[0257]
[0258] Where, is the confidence score;
[0259] is the final weighted classification probability distribution The maximum probability value in represents the certainty of the prediction;
[0260] is the entropy scaling factor, such as, ;
[0261] is the anomaly score scaling factor, such as, ;
[0262] is the final weighted classification probability distribution The entropy of , which measures the uncertainty of the prediction;
[0263] is the abnormal score term, which represents the degree of deviation between the input and the global distribution. The calculation method is expressed as: ;
[0264] Indicates taking The maximum value of the input in the range.
[0265] It should be noted that the confidence score In the calculation process, the denominator Represents the logistic function, which is used to calibrate the confidence level.
[0266] S307. Loss function calculation and parameter update
[0267] Define a density-weighted multi-task loss function to optimize the model. The main loss term calculates the cross entropy loss between the predicted probability distribution of each sample and the true label. The regularization term calculates the Frobenius norm square difference between the long short-term memory network weight matrix after model training and the initialization weight matrix. The total loss function is expressed as:
[0268]
[0269] In the formula is the total loss function;
[0270] is the density weight function;
[0271] is the density of the cluster to which the i-th sample belongs;
[0272] is the cross entropy loss function;
[0273] is the predicted probability distribution of the i-th sample;
[0274] is the true label one-hot encoding of sample i;
[0275] is the regularization coefficient, such as, ;
[0276] is the square of the Frobenius norm, The term is used to measure the difference between the initial weight matrix and the final weight matrix, thereby realizing the weight stability constraint;
[0277] Initialize the weight matrix for LSTM;
[0278] is the LSTM weight matrix after training.
[0279] Furthermore, the Nesterov accelerated gradient descent method is used to update the model parameters.
[0280] S308, stop iterating condition judgment
[0281] During model training, the validation set performance indicators are continuously monitored. When the validation set F1 score improves by less than 0.1% for 20 consecutive iterations, the early stopping mechanism is triggered. Or, when the preset upper limit of 1000 full iterations is reached, the iteration is stopped, indicating that the model training is complete.
[0282] S4. Identification of abnormal pressure gauge calibration data
[0283] During the model deployment phase, the newly input pressure gauge calibration data is first subjected to temperature compensation normalization processing to generate a standardized time series vector.
[0284] The normalized time series vector is then sliced into time windows and fed into the trained anomaly recognition model. A long-short-term memory network extracts temporal features, a multi-head attention layer enhances key nodes, a feature fusion module integrates cross-scale information, and a classifier generates four-category anomaly probability distributions. The system outputs the anomaly category label corresponding to the highest probability in real time and simultaneously calculates a confidence score. Labels 1, 2, and 3 correspond to anomaly categories. When an anomaly category is identified with a confidence score greater than 0.9, an alarm protocol is automatically triggered. The raw data for the anomaly time period, the temperature curve, and the model judgment criteria are packaged to generate a diagnostic report.
[0285] S5. Establishment of pressure gauge calibration data traceability process
[0286] The traceability system builds a three-level data chain, as follows:
[0287] The first level stores the original verification data packet, including the original voltage signal of the pressure sensor, AD conversion parameters, and environmental temperature and humidity logs;
[0288] The second level records the data processing trajectory, storing in detail the dynamic parameter calculation process of temperature compensation normalization, the adaptive function application log and the intermediate results;
[0289] The third level binds the model decision evidence, saving the input vector of the anomaly recognition model, the feature activation values output by each network layer (that is, the output features of the activation function of each network layer), the classification probability distribution, and the confidence calculation details.
[0290] Optionally, blockchain technology is used to build an unalterable storage architecture, in which each data block contains a verification timestamp, device ID, operator electronic signature, and hash value of the previous block. The three-level data chain is linked by a unique traceability code, which supports reverse query of original sensor data based on abnormal events, or tracking of the entire life cycle processing trajectory based on verification batches, thus achieving end-to-end traceability from abnormal alarms to physical sensor signals.
[0291] In one embodiment, Figure 2As shown, the anomaly recognition capability of the present invention is demonstrated through pressure gauge calibration data. The upper figure shows the actual measurement curve containing three anomalies. The orange area is a slow drift (150-300 seconds), the red area is a transient mutation (350 seconds), and the purple area is a continuous step (after 400 seconds). The lower figure shows the detection results of the present invention. The scattered points of different colors accurately identify the time period and type of occurrence of various anomalies. The test results show that the present invention can not only correctly identify obvious step anomalies, but also accurately capture the slow-changing drift with weak characteristics in the initial stage and the transient mutation that only lasts for 0.5 seconds. This verifies the ability of temperature compensation normalization to retain subtle abnormal features and the effect of the gated attention mechanism to enhance the detection of key time steps.
[0292] In another embodiment, to analyze the impact of temperature fluctuation range on the accuracy of abnormality recognition, Figure 3 As shown in the figure, the robustness of the temperature compensation mechanism of this technology is verified through 6 typical temperature scenarios, including three stable temperature ranges (low temperature / normal temperature / high temperature) and three fluctuating temperature ranges (low temperature / medium temperature / high temperature fluctuation). The specific temperature change amplitude is marked in each range. Experimental data show that the traditional method performs well in the temperature stable range, but the accuracy drops significantly when the temperature fluctuates by more than 15°C, especially in the high temperature fluctuation range. The performance degradation is most obvious. However, this technology maintains stable high accuracy in all test scenarios. Even in extreme working conditions with drastic temperature fluctuations of up to 20°C, the accuracy degradation is controlled within an acceptable range. This shows that in the temperature compensation normalization process, the temperature-dependent distribution parameters dynamically eliminate baseline drift, the material temperature compensation factor automatically adjusts the range, and the gated attention mechanism suppresses temperature fluctuation noise. The three work together to ensure the reliability of the model in complex thermodynamic environments.
[0293] In this embodiment, the nonlinear influence of ambient temperature on the pressure gauge calibration data is eliminated, while retaining abnormal characteristics such as drift and mutation, so that the data can still accurately reflect the real state under temperature fluctuations; it can simultaneously process long-term and short-term dependencies, enhance key features, suppress noise, and accurately output abnormal categories and confidence levels through multi-scale classifiers; construct the LSTM initialization weight matrix through feature mapping and cluster analysis, strengthen the model's attention to low-density abnormal areas, and effectively solve the problem of insufficient model sensitivity caused by sparse abnormal samples in the existing technology; enhance the model's dynamic response capability to sudden abnormalities, and at the same time, filter noise characteristics through gating vectors to further improve the accuracy of abnormality recognition.
[0294] The embodiment of the present invention further provides a pressure gauge calibration data anomaly identification and tracing system, based on the pressure gauge calibration data anomaly identification and tracing method described above, comprising:
[0295] Pressure gauge calibration data acquisition and annotation module, which is used to synchronously acquire data from pressure sensors and temperature sensors and perform data annotation;
[0296] A temperature compensation normalization processing module, which is used to perform temperature compensation normalization processing based on an adaptive normalization function;
[0297] Anomaly recognition model construction module, which is used to build anomaly recognition model based on a five-layer network architecture;
[0298] The pressure gauge calibration data anomaly recognition module performs anomaly recognition on the input pressure gauge calibration data based on the constructed anomaly recognition model, and outputs an anomaly category label and a confidence score.
[0299] The pressure gauge calibration data traceability module is used to check the original sensor data in the event of an abnormal event by building a three-level data chain, or to track the full life cycle processing trajectory by calibration batch.
[0300] In addition, an embodiment of the present invention also proposes a computer-readable storage medium, on which program instructions for a method for identifying and tracing anomalies in pressure gauge calibration data are stored. The program instructions for the method for identifying and tracing anomalies in pressure gauge calibration data can be executed by one or more processors to implement the steps of the method for identifying and tracing anomalies in pressure gauge calibration data as described above.
[0301] The embodiments described above are merely descriptions of preferred implementations of the present invention and are not intended to limit the scope of the present invention. Without departing from the spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should fall within the scope of protection determined by the claims of the present invention.
Claims
1. A method for identifying and tracing abnormalities in pressure gauge calibration data, characterized in that: include: S1. Pressure gauge calibration data collection and marking; S2, temperature compensation normalization processing, including normalization processing based on an adaptive normalization function; The construction of the adaptive normalization function includes establishing a relationship model between ambient temperature and pressure readings using a polynomial fitting algorithm, calculating a temperature compensation factor based on a material temperature coefficient, a reference temperature, and a current ambient temperature, and dynamically scaling the measurement range using a temperature condition distribution parameter combined with the temperature compensation factor to obtain normalized training data; S3, anomaly recognition model construction, including the construction of anomaly recognition model based on a five-layer network architecture; S4, identifying anomalies in pressure gauge calibration data, including identifying anomalies in the input pressure gauge calibration data based on the constructed anomaly recognition model, and outputting anomaly category labels and confidence scores; S5. Traceability of pressure gauge calibration data, including building a three-level data chain to check the original sensor data in the event of an abnormal event, or tracking the entire life cycle processing trajectory by calibration batch.
2. The method for identifying and tracing abnormalities in pressure gauge calibration data according to claim 1, characterized in that: The adaptive normalization function expression is as follows: Where, After normalization Samples at time Pressure value; For the Samples at time The original measured pressure value; Temperature The mean pressure under Temperature Standard deviation of pressure under Temperature Temperature compensation factor under ; For the Samples at time ambient temperature.
3. The method for identifying and tracing abnormalities in pressure gauge calibration data according to claim 1, characterized in that: The first layer of the five-layer network architecture is a long short-term memory network layer, the second layer is a gated multi-head attention layer; the third layer is a dual-stream gated fusion module; the fourth layer applies a tensor decomposition dimensionality reduction mechanism to compress the fused third-order feature tensor into a low-rank; the fifth layer configures a multi-scale feature pyramid classifier to extract cross-scale features, and finally outputs anomaly classification probability and confidence score.
4. The method for identifying and tracing abnormalities in pressure gauge calibration data according to claim 3, characterized in that: The long short-term memory network layer constructs an initialization weight matrix through feature mapping and cluster analysis.
5. The method for identifying and tracing abnormality in pressure gauge calibration data according to claim 4, characterized in that: The LSTM network layer uses an input-dependent adaptive forget gate, which is expressed as: Where, for The forget gate output vector at the moment; is the Sigmoid activation function; is the learnable weight matrix of the forget gate; for The hidden state vector at time t; is the input vector of LSTM at time t; is the learnable bias vector of the forget gate; is the deviation gain coefficient; is the local deviation vector.
6. The method for identifying and tracing abnormalities in pressure gauge calibration data according to claim 5, characterized in that: The long short-term memory network layer adopts an anomaly injection mechanism. Specifically, it adopts a cell state update with an injection of anomaly correction. When updating the cell state vector that carries the long-term memory, an anomaly score item is added based on the standard update method. The anomaly score item is calculated based on the degree of deviation between the current input vector and the global statistical characteristics of the feature map output. This anomaly score item is multiplied by the anomaly injection coefficient and directly added to the cell state update result.
7. The method for identifying and tracing abnormalities in pressure gauge calibration data according to claim 1, characterized in that: The first level of the three-level data chain stores the original verification data packet; the second level records the data processing trajectory; the third level binds the model decision evidence and saves the anomaly recognition model input vector, the feature activation value of each network layer, the classification probability distribution and the confidence calculation details.
8. A pressure gauge calibration data anomaly identification and traceability system, based on the pressure gauge calibration data anomaly identification and traceability method according to any one of claims 1 to 7, comprising: Pressure gauge calibration data acquisition and annotation module, which is used to synchronously acquire data from pressure sensors and temperature sensors and perform data annotation; A temperature compensation normalization processing module is used to perform temperature compensation normalization processing based on an adaptive normalization function; the construction of the adaptive normalization function includes using a polynomial fitting algorithm to establish a relationship model between ambient temperature and pressure readings, calculating a temperature compensation factor based on the material temperature coefficient, reference temperature, and current ambient temperature, and dynamically scaling the measurement range using temperature condition distribution parameters combined with the temperature compensation factor to obtain normalized training data; Anomaly recognition model construction module, which is used to build anomaly recognition model based on a five-layer network architecture; A pressure gauge calibration data anomaly recognition module, which performs anomaly recognition on the input pressure gauge calibration data based on the constructed anomaly recognition model and outputs an anomaly category label and a confidence score; The pressure gauge calibration data traceability module is used to check the original sensor data in the event of an abnormal event by building a three-level data chain, or to track the full life cycle processing trajectory by calibration batch.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program instructions for a method for identifying and tracing anomalies in pressure gauge calibration data. The program instructions for the method for identifying and tracing anomalies in pressure gauge calibration data can be executed by one or more processors to implement the steps of the method for identifying and tracing anomalies in pressure gauge calibration data as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Electricity meter abnormality detection method
CN119148044B
Distribution branching line loss and electric energy meter abnormity diagnosis method and related device
CN120013235A
Intelligent temperature control lead-free tin bar production method and device
CN119089367A
Medical quality management method and system based on big data and artificial intelligence
CN119557779A