Multi-parameter real-time detection device and method of intelligent metering device
By extracting the time-frequency domain characteristics of multi-parameter measurement data of intelligent metrology instruments, training the machine learning model to identify the measurement mode, and introducing a self-learning calibration and compensation mechanism, it solves the shortcomings in the accuracy and reliability of measurement results in the existing technology, and realizes efficient and intelligent metrological data detection and calibration.
Patent Information
- Application Number
- CN202510268941.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-03-07
AI Technical Summary
Existing intelligent metrology instruments have shortcomings in multi-parameter real-time detection, metrology pattern recognition, error calibration and machine learning model deployment, resulting in low accuracy and reliability of measurement results.
By obtaining multi-parameter measurement data for preprocessing, extracting time-frequency domain feature data, training machine learning models to identify measurement patterns, introducing self-learning calibration and compensation mechanisms, and reducing model volume through knowledge distillation to achieve efficient deployment.
It improves the accuracy and reliability of metrological data, adapts to intelligent identification and adaptation of different media, dynamic calibration and detection errors, reduces instrument resource usage, and improves intelligence level and practicality.
Smart Images

Figure CN120065106A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of metering instruments, and particularly to a multi-parameter real-time detection device and method for intelligent metering instruments. Background Art
[0002] Intelligent metering instruments can perform real-time detection and measurement of physical parameters of various media. However, current intelligent metering instruments still have many deficiencies in practical applications, mainly reflected in the following aspects:
[0003] Existing intelligent metering instruments mainly rely on the measurement of a single physical parameter, and have weak capabilities for real-time acquisition and analysis of multi-parameters. The data collected by most instruments are not fully subjected to feature extraction and analysis, making it difficult to reflect the comprehensive characteristics of the detected medium, resulting in low accuracy and reliability of measurement results.
[0004] For different detection media, existing intelligent metering instruments lack the ability of targeted metering mode recognition and adaptive adjustment. Due to the diversity and complexity of measurement media, a single metering mode cannot meet the accurate measurement requirements in different application scenarios. Most metering modes in the prior art rely on manual setting, lacking an automatic recognition and intelligent optimization mechanism, and unable to adapt to medium changes in a timely manner, further leading to the generation of measurement errors.
[0005] There is a large problem of error accumulation in the current intelligent metering instruments during the measurement process. Although some instruments have simple error compensation functions, the compensation models are usually relatively rough, failing to consider the complex relationship between errors and various influencing factors, and unable to effectively calibrate and compensate measurement errors, affecting the accuracy and stability of measurement results. During the long-term operation process, the error compensation model also lacks a self-learning and dynamic update mechanism, resulting in a gradual decline in the performance of the instrument.
[0006] In summary, the prior art is difficult to meet the high-precision, real-time, and intelligent requirements of modern industrial production and intelligent metering applications. Therefore, there is an urgent need for an intelligent metering instrument detection method that can achieve multi-parameter real-time detection, intelligent recognition of metering modes, self-learning calibration of errors, and efficient deployment of machine learning models to improve measurement accuracy and system performance.
[0007] In view of this, the present invention proposes a multi-parameter real-time detection device and method for intelligent metering instruments. Summary of the Invention
[0008] To achieve the above object, the present invention provides a multi-parameter real-time detection device and method for intelligent metering instruments. The specific technical solutions are as follows: The multi-parameter real-time detection method for intelligent metering instruments includes:
[0009] Step 1: Obtain multi-parameter metering data collected by the metering instrument when detecting the medium, and preprocess the metering data;
[0010] Step 2: Analyze the obtained measurement data, extract the characteristic parameters of the measurement data, including the time-frequency domain characteristic data of the measurement data, and perform feature selection and dimensionality reduction;
[0011] Step 3: Based on the extracted time-frequency domain characteristic data of the measurement data, train a machine learning model to identify the measurement mode required for detecting the current medium;
[0012] Step 4: According to the identified measurement mode, introduce a self-learning calibration and compensation mechanism to calibrate and compensate the data detection error in the current measurement mode;
[0013] Step 5: Perform knowledge distillation on the trained machine learning model to reduce the volume of the model occupied by the metering instrument, and realize the deployment of the machine learning model in the intelligent metering instrument.
[0014] Preferably, obtain multiple parameters of the medium detected by the intelligent metering instrument, including multiple types of electrical data; each physical parameter is collected and converted into an electrical signal by the corresponding sensor, and then converted into a digital quantity by the signal acquisition circuit through analog-to-digital conversion;
[0015] Let the collected physical parameter be x 1 , x 2 ,..., x n , where n is the number of collected physical parameters; the corresponding digital quantity is represented as d 1 , d 2 ,..., d n ; the conversion relationship between the digital quantity and the physical quantity is:
[0016] d n = k n ·x n + b n
[0017] where k n is the sensitivity coefficient of the physical quantity sensor corresponding to the nth collected physical parameter, and b i is the zero offset; preprocess the obtained digital quantity data, and form a data matrix D of the multi-parameter digital quantity data in the order of sampling time:
[0018]
[0019] where m is the number of sampling time points and n is the number of collected physical parameters; the data matrix D is the multi-parameter measurement data for subsequent analysis.
[0020] Preferably, perform feature extraction on the multi-parameter measurement data matrix D obtained after preprocessing; the extracted features include time domain features and frequency domain features;
[0021] Extract the time-domain features of multi-parameter measurement data, and calculate the statistical feature quantities of each physical parameter data, including: mean value μ i , standard deviation σ i , kurtosis β i and skewness S i ;
[0022] Extract the frequency-domain features of multi-parameter measurement data, perform a fast Fourier transform on each physical parameter data to obtain the frequency-domain signal X i (f); Calculate the frequency-domain feature quantities according to the frequency-domain signal, including: frequency-domain energy E i and frequency-domain entropy H i ;
[0023] Combine the extracted time-domain features and frequency-domain features into a feature vector v:
[0024] v = [μ 1 , σ 1 , β 1 , S 1 , E 1 , H 1 , …, μ n , σ n , β n , S n , E n , H n T
[0025] The dimension of the feature vector is 6n, where n is the number of physical parameters.
[0026] Preferably, principal component analysis is used to select and reduce the dimension of the extracted features; the feature vector v is centered to obtain the centered feature matrix X c :
[0027]
[0028] where, is the mean value of the sampling features at the m-th sampling time, m is the number of sampling time points, n is the number of physical parameters, v mn is the sampling feature value of the n-th physical parameter at the m-th sampling time;
[0029] Calculate the covariance matrix S of the centered feature matrix X c and perform eigenvalue decomposition on the covariance matrix S: X c = UΣU T ; where U is the eigenvector matrix, U T is the transpose of the eigenvector matrix, and Σ is the eigenvalue matrix;
[0030] Select the eigenvectors corresponding to the top r largest eigenvalues to form the dimensionality reduction matrix W: W = [u 1 , u 2 ,..., u r ; r is determined according to the cumulative contribution rate γ:
[0031]
[0032] where δ is the cumulative contribution rate threshold;
[0033] Use the dimensionality reduction matrix W to map the centralized feature matrix X c to a low-dimensional space to obtain the dimensionality-reduced feature matrix Y: Y = X c W; Denote the feature vector of each sample in Y as v * , i.e.: v * = [y 1 , y 2 ,..., y r T ; v * is the new feature vector obtained after dimensionality reduction by principal component analysis, with dimension r.
[0034] Preferably, divide the extracted time-frequency domain feature data into a training set N train and a test set where is the feature vector of the i-th sample in the training set, l i is the measurement pattern label corresponding to the i-th sample in the training set, is the feature vector of the i'-th sample in the test set, l i' is the measurement pattern label corresponding to the i'-th sample in the test set, N is the number of data sets, and N train is the number of divided training sets;;
[0035] Select the neural network in the machine learning model as the measurement pattern recognition model and train it; Use the training set D train to train the selected machine learning model;
[0036] Design a fully connected structure with L hidden layers, and use the cross-entropy loss function and the Adam optimization algorithm for training;
[0037] Use the test set D test to test the trained machine learning model and evaluate the accuracy, precision, recall, and F1-score performance metrics of the model.
[0038] Preferably, according to the recognized measurement pattern, introduce a self-learning calibration and compensation mechanism to calibrate and compensate the data detection error in the current measurement pattern; Specifically as follows:
[0039] For a given measurement mode Establish a mathematical model between the measurement error and the influencing factors; Let the true physical quantity be x, and the measured value of the measuring instrument be Then the measurement error is expressed as:
[0040] Introduce the influencing factor vector ξ = [ξ 1 , ξ 2 ,..., ξ K T , where K is the number of influencing factors; Assume that there is a linear relationship between the measurement error and the influencing factors, then the error model is expressed as: ε 2 = α T ψ(ξ) + β; where, α = [α 1 , α 2 ,..., α H T is the model weight vector, ψ(ξ) = [ψ 1 (ξ), ψ 2 (ξ),..., ψ H (ξ)] T is the characteristic mapping function of the influencing factors, β is the bias term, and H is the dimension of the characteristic mapping function.
[0041] Preferably, construct a self-learning calibration error model to perform self-learning calibration on the parameters α and β of the error model; Record the measured values within a preset time true value x e and the corresponding influencing factors ξ e , where, e = 1, 2,..., N s , N s is the number of calibration samples;
[0042] Use the gradient descent method to optimize the loss function, update the error model parameters α and β, and iterate until the loss function converges or reaches the preset number of iterations;
[0043] Use the calibrated error model to perform real-time compensation on the measured values of the intelligent measuring instrument; For the current measured value and the influencing factor ξ, calculate the measurement error:
[0044] Subtract the measurement error from the measured value to obtain the compensated measured value: That is the measurement result after compensating for the measurement error and is used as the final output of the intelligent measuring instrument;
[0045] During the operation of the measuring instrument, adaptively update the error model regularly using newly collected data.
[0046] Preferably, knowledge distillation is performed on the trained machine learning model to reduce the volume of the model occupied by the metering instrument, and the deployment of the machine learning model in the intelligent metering instrument is realized. Specifically, it includes: using the trained metering pattern recognition model as the teacher model, denoted as f T (·); designing a student model, denoted as f S (·), and the student model adopts a shallow neural network model;
[0047] Using the knowledge of the teacher model to guide the training of the student model, and using the soft label as the training target of the student model. The soft label is obtained by temperature scaling of the output of the teacher model; the temperature parameter τ controls the smoothness of the soft label; let z T and z S be the outputs of the teacher model and the student model respectively, then the calculation formula of the soft label y T is:
[0048]
[0049] where softmax(·) is the softmax function, and z T,q is the q-th element of z T ; the training loss function L S of the student model is the weighted sum of the cross-entropy loss and the soft label loss:
[0050]
[0051] where L CE (·) is the cross-entropy loss function, y is the true label, and L KL (·) is the KL divergence loss function, is the weight coefficient; by minimizing the loss function L S , the student model simultaneously learns the information of the true label and the knowledge of the teacher model.
[0052] Preferably, after the knowledge distillation training, the original training set is used to adjust the student model. During the adjustment process, the loss function of the student model for the cross-entropy loss is: L finetune = L CE (y, f S (x));
[0053] Use the test set to evaluate the performance of the student model. If the performance of the student model meets the requirements, deploy it to the intelligent metering instrument; otherwise, adjust the structure of the student model or re-perform the knowledge distillation training;
[0054] Convert the trained student model into a format suitable for running in the intelligent metering instrument and load it into the program memory of the instrument; during the operation of the metering instrument, collect new data regularly and perform incremental training and update on the student model to adapt to the changes in the metering environment.
[0055] A multi-parameter real-time detection device for an intelligent metering instrument, which is used to implement the multi-parameter real-time detection method of the intelligent metering instrument, including: a data acquisition module, a data analysis module, a metering mode recognition module, an error compensation module, and a distillation deployment module;
[0056] The data acquisition module acquires multi-parameter metering data collected by the metering instrument when detecting the medium and preprocesses the metering data;
[0057] The data analysis module analyzes the acquired metering data, extracts the characteristic parameters of the metering data, including the time-frequency domain characteristic data of the metering data, and performs feature selection and dimensionality reduction;
[0058] The metering mode recognition module trains a machine learning model based on the extracted time-frequency domain characteristic data of the metering data to identify the metering mode required for detecting the current medium;
[0059] The error compensation module introduces a self-learning calibration and compensation mechanism according to the identified metering mode to calibrate and compensate the data detection error in the current metering mode;
[0060] The distillation deployment module performs knowledge distillation on the trained machine learning model, reduces the volume of the model occupied by the metering instrument, and realizes the deployment of the machine learning model in the intelligent metering instrument.
[0061] Advantages of the present invention: By collecting and preprocessing multi-parameter metering data, the present invention removes noise and outliers, ensures the accuracy and reliability of the input data, and provides a high-quality data basis for subsequent feature analysis.
[0062] By extracting time-domain and frequency-domain features, as well as feature selection and dimensionality reduction, the present invention reduces data redundancy, highlights key features, and improves the efficiency of data analysis and the training speed of the machine learning model.
[0063] Based on the time-frequency domain characteristic data, the present invention trains a machine learning model to accurately identify the best metering mode for detecting the medium, improves the accuracy of metering mode selection, and adapts to diverse detection requirements.
[0064] The present invention introduces a self-learning mechanism to automatically calibrate and compensate metering errors, dynamically adapts to different metering modes, and significantly improves the accuracy of data detection and the reliability of the intelligent metering instrument.
[0065] The present invention reduces the complexity of a machine learning model through knowledge distillation, reduces the resource occupancy of a metering instrument, realizes efficient deployment, and ensures that the model still has good performance under hardware constraints.
[0066] The technical solution of the present invention realizes intelligent identification and adaptation of different media, automatically calibrates detection errors, and effectively improves the accuracy and reliability of metering data. At the same time, by means of knowledge distillation, the model volume is reduced, enabling the machine learning model to be efficiently deployed in the metering instrument, reducing the hardware resource occupancy, enhancing the intelligence level and practicality of the instrument, and meeting the metering requirements of multiple scenarios. Brief Description of the Drawings
[0067] Figure 1 It is a flowchart of a multi-parameter real-time detection method for the intelligent metering instrument provided by the present invention;
[0068] Figure 2 It is a structural diagram of a multi-parameter real-time detection device for the intelligent metering instrument provided by the present invention. Detailed Embodiments
[0069] To better understand the present invention, more detailed descriptions of various aspects of the present invention will be made with reference to the accompanying drawings. It should be understood that these detailed descriptions are only descriptions of exemplary embodiments of the present invention and do not limit the scope of the present invention in any way. Throughout the specification, the same reference numerals refer to the same elements. The expression "and / or" includes any and all combinations of one or more of the associated listed items.
[0070] In the drawings, for ease of illustration, the sizes, dimensions, and shapes of the elements have been slightly adjusted. The drawings are only examples and are not drawn strictly to scale. As used herein, terms such as "substantially", "about", and similar terms are used as terms indicating approximation and not as terms indicating degree, and are intended to account for the inherent deviations in measured or calculated values that would be recognized by those of ordinary skill in the art. Additionally, in the present invention, the order of description of the various step processes does not necessarily represent the order in which these processes occur in actual operation, unless otherwise clearly specified or derivable from the context.
[0071] It should also be understood that expressions such as "including", "comprising", "having", "containing" and / or "comprising of" in this specification are open rather than closed expressions, which mean that the stated features, elements and / or components exist, but do not exclude the existence of one or more other features, elements, components and / or their combinations. In addition, when an expression such as "at least one of..." appears after a list of listed features, it modifies the entire list of features, rather than just an individual element in the list. In addition, when describing embodiments of the present invention, the use of "may" means "one or more embodiments of the present invention". And the term "exemplary" is intended to refer to an example or illustration.
[0072] Unless otherwise defined, all terms used herein (including engineering terms and technical terms) have the same meaning as commonly understood by those of ordinary skill in the art to which this invention belongs. It should also be understood that unless clearly stated in the present invention, words defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the related art, and should not be interpreted in an idealized or overly formal sense.
[0073] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
[0074] Example 1
[0075] Referring to Figure 1 , the first embodiment of the present invention provides a multi-parameter real-time detection method for intelligent metering instruments.
[0076] Step 1: Obtain multi-parameter measurement data collected by the metering instrument when detecting the medium, and preprocess the measurement data.
[0077] Obtain multi-parameters of the intelligent metering instrument for detecting the medium, including multi-types of electrical data; each physical parameter is collected and converted into an electrical signal by the corresponding sensor, and then converted into a digital quantity by the signal acquisition circuit through analog-to-digital conversion.
[0078] Let the collected physical parameter be x 1 , x 2 ,..., x n , where n is the number of collected physical parameters; the corresponding digital quantity is expressed as d 1 , d 2 ,..., d n ; the conversion relationship between the digital quantity and the physical quantity is:
[0079] d n = k n ·x n + bn
[0080] Among them, k n is the sensitivity coefficient of the physical quantity sensor corresponding to the nth physical parameter, and b i is the zero-point offset; k i and b i are determined through the sensor calibration experiment.
[0081] Since the original digital quantity data collected by the sensor may contain noise data such as outliers and missing values, preprocessing is required to improve the data quality. The preprocessing of the obtained digital quantity data includes: outlier detection and removal, missing value filling, and data smoothing.
[0082] The preprocessed multi-parameter digital quantity data is composed into a data matrix D in the order of sampling time:
[0083]
[0084] Among them, m is the number of sampling time points, and n is the number of physical parameters collected; the data matrix D is the multi-parameter measurement data for subsequent step analysis, and d mn is the digital quantity of the nth physical parameter sampled at the mth sampling time.
[0085] Step 2: Analyze the obtained measurement data, extract the characteristic parameters of the measurement data, including the time-frequency domain characteristic data of the measurement data, and perform feature selection and dimensionality reduction.
[0086] Extract features from the multi-parameter measurement data matrix D obtained after preprocessing; the extracted features include time domain features and frequency domain features.
[0087] Time domain feature extraction; calculate the statistical characteristic quantities of each physical parameter data, including:
[0088] Mean value:
[0089] Standard deviation:
[0090] Kurtosis:
[0091] Skewness:
[0092] Among them, m is the number of sampling time points, n is the number of physical parameters collected, is the digital quantity of the ith physical parameter at the jth sampling moment.
[0093] Frequency domain feature extraction, perform fast Fourier transform (FFT) on each physical parameter data to obtain the frequency domain signal X i(f); Calculate the frequency-domain characteristic quantities, including:
[0094] Frequency-domain energy: E i = ∑ f |X i (f)| 2 , i = 1, 2, ..., n;
[0095] Frequency-domain entropy: H i = -∑ f P i (f)·logP i (f), i = 1, 2, ..., n;
[0096] Among them, is the normalized power spectral density.
[0097] Combine the extracted time-domain features and frequency-domain features into a feature vector v:
[0098] v = [μ 1 , σ 1 , β 1 , S 1 , E 1 , H 1 , …, μ n , σ n , β n , S n , E n , H n T
[0099] The dimension of the feature vector is 6n, where n is the number of physical parameters.
[0100] Use principal component analysis (PCA) to select and reduce the dimension of the extracted features; perform centering processing on the feature vector v to obtain the centered feature matrix X c :
[0101]
[0102] Among them, is the mean of the sampling features at the mth sampling time, m is the number of sampling time points, n is the number of physical parameters, and v mn is the sampling feature value of the nth physical parameter at the mth sampling time.
[0103] Calculate the covariance matrix S of the centered feature matrix X c and perform eigenvalue decomposition on the covariance matrix S: X c = UΣU T ; where U is the eigenvector matrix, U Tis the transpose of the eigenvector matrix, and Σ is the eigenvalue matrix.
[0104] Select the eigenvectors corresponding to the first r largest eigenvalues to form the dimensionality reduction matrix W: W = [u 1 , u 2 ,..., u r ; r can be determined according to the cumulative contribution rate γ:
[0105]
[0106] where δ is the cumulative contribution rate threshold, generally taking values from 0.8 to 0.95;
[0107] Use the dimensionality reduction matrix W to map the centralized feature matrix X c to the low-dimensional space to obtain the dimensionality-reduced feature matrix Y: Y = X c W; Denote the eigenvector of each sample in Y as v * , that is: v * = [y 1 , y 2 ,..., y r T ; v * is the new eigenvector obtained after dimensionality reduction by principal component analysis, and the dimension is r.
[0108] Divide the extracted time-frequency domain feature data into a training set and a test set where is the eigenvector of the i-th sample in the training set, l i is the measurement mode label corresponding to the i-th sample in the training set, is the eigenvector of the i'-th sample in the test set, l i' is the measurement mode label corresponding to the i'-th sample in the test set, N is the number of data sets, and N train is the number of the divided training set.
[0109] Step 3: Based on the extracted time-frequency domain feature data of the measurement data, train a machine learning model to identify the measurement mode required for detecting the current medium.
[0110] Select the neural network in the machine learning model as the measurement mode recognition model and train it; Use the training set D train to train the selected machine learning model.
[0111] Design a fully connected structure with L hidden layers, and use the cross-entropy loss function: and the Adam optimization algorithm for training, where θ is the neural network parameter, l ih and pih respectively represent the h-th elements of the true label and the predicted label, and M is the total number of categories in the classification task.
[0112] Use the test set D test to test the trained machine learning model and evaluate the performance metrics of the model, such as accuracy, precision, recall, and F1-score. If the model performance meets the requirements, it can be used for subsequent metering pattern recognition tasks; otherwise, the model structure, hyperparameters need to be adjusted, or more training data needs to be added, and then retraining and testing are carried out.
[0113] Step 4: According to the recognized metering pattern, introduce a self-learning calibration and compensation mechanism to calibrate and compensate the data detection error in the current metering pattern.
[0114] According to the recognized metering pattern, introduce a self-learning calibration and compensation mechanism to calibrate and compensate the data detection error in the current metering pattern; specifically as follows:
[0115] Construct a metering error model. For a given metering pattern establish a mathematical model between the metering error and the influencing factors; let the true physical quantity be x, and the measured value of the metering instrument be Then the metering error is expressed as:
[0116] Introduce the influencing factor vector ξ = [ξ 1 , ξ 2 ,..., ξ K T , where ξ K is the K-th influencing factor vector, and K is the number of influencing factors; assume that there is a linear relationship between the metering error and the influencing factors, then the error model is expressed as: ε 2 = α T ψ(ξ) + β; where, α = [α 1 , α 2 ,..., α H T is the model weight vector, α H is the weight vector of the H-th dimension, ψ(ξ) = [ψ 1 (ξ), ψ 2 (ξ0,..., ψ H (ξ)] T is the feature mapping function of the influencing factors, ψ H (·) is the feature mapping function of the H-th dimension, and β is the bias term, and H is the dimension of the feature mapping function.
[0117] Construct a self-learning calibration error model, and use the data collected by the intelligent metering instrument during the actual measurement process to perform self-learning calibration on the parameters α and β of the error model; record the measured values within the preset time True value x e and the corresponding influencing factor ξ e where e = 1, 2,..., N s N s is the number of calibration samples; define the loss function of the error model as the mean squared error (MSE):
[0118]
[0119] where ε e is the measurement error of the e-th calibration sample.
[0120] Use the gradient descent method to optimize the loss function, update the error model parameters α and β, and iteratively update until the loss function converges or reaches the preset number of iterations.
[0121] Use the calibrated error model to perform real-time compensation on the measured values of the intelligent metering instrument; for the current measured value and the influencing factor ξ, calculate the estimated measurement error:
[0122] Subtract the estimated measurement error from the measured value to obtain the compensated measured value: That is the measurement result after compensating for the measurement error and serves as the final output of the intelligent metering instrument.
[0123] During the long-term operation of the metering instrument, regularly use the newly collected data to adaptively update the error model. Adaptively update the error model; maintain the effectiveness and robustness of the error model.
[0124] Through the above self-learning calibration and compensation mechanism, the intelligent metering instrument can adaptively calibrate and compensate the data detection error in the current mode according to the identified metering mode, improving the accuracy of the metering data.
[0125] Step 5: Perform knowledge distillation on the trained machine learning model to reduce the volume of the model occupied by the metering instrument and achieve the deployment of the machine learning model in the intelligent metering instrument.
[0126] Perform knowledge distillation on the trained machine learning model to reduce the volume of the model occupied by the metering instrument and achieve the deployment of the machine learning model in the intelligent metering instrument; specifically as follows:
[0127] Take the trained metering mode recognition model as the teacher model, denoted as f T (·); the teacher model has a high recognition accuracy, but the model complexity is relatively high and it is not suitable for direct deployment in resource-constrained intelligent metering instruments.
[0128] Construct a simplified student model, design a student model with a simple structure and few parameters, denoted as f S (·). The student model adopts a shallow neural network model to reduce the model complexity and computational resource occupancy.
[0129] Use the knowledge of the teacher model to guide the training of the student model. Use the soft label as the training target of the student model. The soft label is obtained by temperature scaling the output of the teacher model; the temperature parameter τ controls the smoothness of the soft label. The higher the temperature, the smoother the soft label. Let z T and z S be the outputs of the teacher model and the student model respectively. Then the calculation formula for the soft label y T is:
[0130]
[0131] where softmax(·) is the softmax function, z T,q is the q-th element of z T . The training loss function L S of the student model is the weighted sum of the cross-entropy loss and the soft label loss:
[0132]
[0133] where L CE (·) is the cross-entropy loss function, y is the true label, L KL (·) is the KL divergence loss function, is the weight coefficient; by minimizing the loss function L S , the student model can learn the information of the true label and the knowledge of the teacher model simultaneously.
[0134] After knowledge distillation training, use the original training set to adjust the student model to further improve the performance of the student model; during the adjustment process, the loss function of the student model is the cross-entropy loss: L finetune = L CE (y, f S (x)).
[0135] Through adjustment, the student model can better adapt to the original task and reach a performance level close to that of the teacher model.
[0136] Use the test set to evaluate the performance of the student model, including indicators such as accuracy, precision, recall, and F1 score; if the performance of the student model meets the requirements, deploy it to the intelligent metering instrument; otherwise, adjust the structure of the student model or re-conduct the knowledge distillation training.
[0137] Convert the trained student model into a format suitable for running in an intelligent metering instrument (such as C language code), and load it into the program memory of the metering instrument; during the operation of the instrument, regularly collect new data, and perform incremental training and updating on the student model in the cloud or locally to adapt to the changes in the metering environment.
[0138] Through the above knowledge distillation technology, a complex metering pattern recognition model can be transformed into a simplified student model, reducing the computing and storage resources occupied by the model in the metering instrument, and realizing the efficient deployment and real-time inference of the machine learning model in the resource-constrained intelligent metering instrument; at the same time, through model adjustment and incremental update, the long-term adaptability and robustness of the model are maintained.
[0139] Embodiment 2
[0140] Refer to Figure 2 , which is the second embodiment of the present invention, provides a multi-parameter real-time detection device for an intelligent metering instrument, including: a data acquisition module, a data analysis module, a metering pattern recognition module, an error compensation module, and a distillation deployment module;
[0141] The data acquisition module acquires multi-parameter metering data collected by the metering instrument when detecting the medium, and preprocesses the metering data;
[0142] The data analysis module analyzes the acquired metering data, extracts the characteristic parameters of the metering data, including the time-frequency domain characteristic data of the metering data, and performs feature selection and dimensionality reduction;
[0143] The metering pattern recognition module trains a machine learning model based on the extracted time-frequency domain characteristic data of the metering data to identify the metering pattern required for detecting the current medium;
[0144] The error compensation module introduces a self-learning calibration and compensation mechanism according to the identified metering pattern to calibrate and compensate the data detection error in the current metering pattern;
[0145] The distillation deployment module performs knowledge distillation on the trained machine learning model to reduce the volume of the model occupied by the metering instrument and realize the deployment of the machine learning model in the intelligent metering instrument.
[0146] The above order of steps for the method is only for illustration, and the steps of the method of the present invention are not limited to the above specifically described order, unless otherwise specifically stated.
[0147] In addition, in some embodiments, the present invention can also be implemented as a program recorded in a recording medium, and these programs include machine-readable instructions for implementing the method according to the present invention. Therefore, the present invention also covers a recording medium storing a program for executing the method according to the present invention.
[0148] In addition, parts of the above technical solutions provided in the embodiments of the present invention that have the same implementation principle as the corresponding technical solutions in the prior art are not described in detail to avoid excessive repetition.
[0149] As described above in the specific embodiments, the objectives, technical solutions, and beneficial effects of the present invention have been further described in detail. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A multi-parameter real-time detection method for intelligent metering instruments, characterized in that: include: Step 1: Obtain multi-parameter measurement data collected by the measuring instrument when detecting the medium, and pre-process the measurement data; Step 2: Analyze the acquired measurement data, extract characteristic parameters of the measurement data, including the time-frequency domain characteristic data of the measurement data, and perform feature selection and dimensionality reduction; Step 3: Based on the time-frequency domain feature data of the extracted measurement data, a machine learning model is trained to identify the measurement mode required for detecting the current medium; Step 4: According to the identified measurement mode, a self-learning calibration and compensation mechanism is introduced to calibrate and compensate for the data detection error in the current measurement mode; Step 5: Perform knowledge distillation on the trained machine learning model to reduce the size of the model occupied by the metering instrument and implement the deployment of the machine learning model in the smart metering instrument.
2. The multi-parameter real-time detection method of the intelligent metering instrument according to claim 1 is characterized in that: Acquire multiple parameters of the measuring instrument's detection medium, including multiple types of electrical data; each physical parameter is collected by the corresponding sensor and converted into an electrical signal, which is then converted into a digital value by the signal acquisition circuit; Assume that the collected physical parameters are x1, x2, ..., x n , where n is the number of physical parameters collected; the corresponding digital quantities are expressed as d1, d2, ..., d n ; The conversion relationship between digital quantity and physical quantity is: d n =k n ·x n +b n Among them, k n is the sensitivity coefficient of the physical quantity sensor corresponding to the nth physical parameter, b i is the zero point offset; the acquired digital data is preprocessed, and the preprocessed multi-parameter digital data is organized into a data matrix D in the order of sampling time: Among them, m is the number of sampling time points, n is the number of physical parameters collected; the data matrix D is the multi-parameter measurement data.
3. The multi-parameter real-time detection method of the intelligent metering instrument according to claim 2 is characterized in that: Perform feature extraction on the multi-parameter metrology data matrix D obtained after preprocessing; the extracted features include time domain features and frequency domain features; Extract the time domain characteristics of multi-parameter measurement data and calculate the statistical characteristics of each physical parameter data, including: mean μ i , standard deviation σ i , Kurtosis β i And the skewness S i ; Extract the frequency domain features of multi-parameter measurement data, perform fast Fourier transform on each physical parameter data, and obtain the frequency domain signal X i (f); Calculate frequency domain features based on frequency domain signals, including: frequency domain energy E i and frequency domain entropy H i ; The extracted time domain features and frequency domain features are combined into a feature vector v: v=[μ1,σ1,β1,S1,E1,H1,…,μ n ,s n ,b n ,S n ,E n ,H n ] T The dimension of the feature vector is 6n, where n is the number of physical parameters.
4. The multi-parameter real-time detection method of the intelligent metering instrument according to claim 3 is characterized in that: Principal component analysis is used to select and reduce the extracted features; the feature vector v is centralized to obtain the centralized feature matrix X c : in, is the mean of the sampling characteristics at the mth sampling time, m is the number of sampling time points, n is the number of physical parameters, v mn is the sampling characteristic value of the nth physical parameter at the mth sampling time; Calculate the centered feature matrix X c The covariance matrix S of , and perform eigenvalue decomposition on the covariance matrix S: Among them, U is the eigenvector matrix, U T is the transpose of the eigenvector matrix, Σ is the eigenvalue matrix; Select the eigenvectors corresponding to the first r largest eigenvalues to form a dimensionality reduction matrix W: W = [u1, u2, ..., u r ]; r is determined according to the cumulative contribution rate γ: Among them, δ is the cumulative contribution rate threshold; Use the dimension reduction matrix W to centralize the feature matrix X c Map to low-dimensional space and get the reduced-dimensional feature matrix Y: Y = X c W; the feature vector of each sample in Y is recorded as v * , that is: v * =[y1,y2,...,y r ] T ;v * That is, the new feature vector obtained after dimensionality reduction by principal component analysis has a dimension of r.
5. The multi-parameter real-time detection method of the intelligent metering instrument according to claim 4 is characterized in that: Divide the extracted time-frequency domain feature data into training sets and test set in is the feature vector of the i-th sample in the training set, l i is the measurement mode label corresponding to the i-th sample in the training set, is the feature vector of the i'th sample in the test set, l i' is the measurement mode label corresponding to the i'th sample in the test set, N is the number of data sets, N train is the number of divided training sets; Select the neural network in the machine learning model as the quantitative pattern recognition model and train it; use the training set D train Train the selected machine learning model; Design a fully connected structure with L hidden layers, and use the cross entropy loss function and Adam optimization algorithm for training; Using the test set D test Test the trained machine learning model and evaluate the model's accuracy, precision, recall, and F1 score performance indicators.
6. The multi-parameter real-time detection method of the intelligent metering instrument according to claim 5 is characterized in that: According to the identified measurement mode, a self-learning calibration and compensation mechanism is introduced to calibrate and compensate for the data detection error in the current measurement mode; the details are as follows: For a given metering mode Establish a mathematical model between measurement error and influencing factors; let the real physical quantity be x, and the measurement value of the measuring instrument be The measurement error is expressed as: Introduce the influencing factor vector ξ=[ξ1,ξ2,...,ξ K ] T , where k is the number of influencing factors; assuming that there is a linear relationship between measurement error and influencing factors, the error model is expressed as: ε2 = α T ψ(ξ)+β; Where α=[α1,α2,...,α H ] T is the model weight vector, ψ(ξ)=[ψ1(ξ),ψ2(ξ),...,ψ H (ξ)] T is the feature mapping function of the influencing factor, β is the bias term, and H is the dimension of the feature mapping function.
7. The multi-parameter real-time detection method of the intelligent metering instrument according to claim 6 is characterized in that: Construct a self-learning calibration error model, perform self-learning calibration on the error model parameters α and β; record the measurement values within the preset time True value x e And the corresponding influencing factors ξ e , where e = 1, 2, ..., N s , N s is the number of calibration samples; The loss function is optimized using the gradient descent method, the error model parameters α and β are updated, and the update is iterated until the loss function converges or the preset number of iterations is reached; Use the calibrated error model to compensate the measured value of the smart meter in real time; for the current measured value And the influencing factor ξ, calculate the measurement error: Subtract the metrological error from the measured value to obtain the compensated measured value: That is, the measurement result after compensating for the measurement error, which serves as the final output of the smart metering instrument; During the operation of the meter, the error model is adaptively updated regularly using newly collected data.
8. The multi-parameter real-time detection method of the intelligent metering instrument according to claim 7 is characterized in that: Perform knowledge distillation on the trained machine learning model to reduce the volume of the model occupied by the metering instrument and realize the deployment of the machine learning model in the smart metering instrument. Specifically, the trained metering pattern recognition model is used as the teacher model, denoted as f T (·); design the student model, denoted by f S (·), the student model adopts a shallow neural network model; The knowledge of the teacher model is used to guide the training of the student model. The soft label is used as the training target of the student model. The soft label is obtained by scaling the output of the teacher model with temperature. The temperature parameter τ controls the smoothness of the soft label. Let z T and z S are the outputs of the teacher model and the student model respectively, then the soft label y T The calculation formula is: Among them, softmax(·) is the softmax function, z T,q For z T The qth element of the student model; the training loss function L S It is the weighted sum of cross entropy loss and soft label loss: Among them, L CE (·) is the cross entropy loss function, y is the true label, L KL (·) is the KL divergence loss function, is the weight coefficient; by minimizing the loss function L S , the student model learns both the information of the true label and the knowledge of the teacher model.
9. The multi-parameter real-time detection method of the intelligent metering instrument according to claim 8 is characterized in that: After knowledge distillation training, the student model is adjusted using the original training set. During the adjustment process, the loss function of the student model is the cross entropy loss: L finetune =L CE (y,f S (x)); Use the test set to evaluate the performance of the student model. If the performance of the student model meets the requirements, it will be deployed in the smart metering instrument; otherwise, adjust the structure of the student model or re-perform knowledge distillation training; Convert the trained student model into a format suitable for running in a smart meter and load it into the program memory of the meter; During the operation of the metering instrument, new data is collected regularly, and the student model is incrementally trained and updated to adapt to changes in the metering environment.
10. A multi-parameter real-time detection device for an intelligent metering instrument, which is used to implement the multi-parameter real-time detection method for an intelligent metering instrument according to any one of claims 1 to 9, characterized in that: include: Data acquisition module, data analysis module, measurement pattern recognition module, error compensation module and distillation deployment module; The data acquisition module acquires multi-parameter measurement data collected by the measuring instrument when detecting the medium, and pre-processes the measurement data; The data analysis module analyzes the acquired measurement data, extracts characteristic parameters of the measurement data, including time-frequency domain characteristic data of the measurement data, and performs feature selection and dimensionality reduction; The metering mode recognition module trains a machine learning model based on the time-frequency domain feature data of the extracted metering data to identify the metering mode required for detecting the current medium; The error compensation module introduces a self-learning calibration and compensation mechanism according to the identified measurement mode to calibrate and compensate for the data detection error in the current measurement mode; The distillation deployment module performs knowledge distillation on the trained machine learning model, reduces the volume of the model occupied by the metering instrument, and realizes the deployment of the machine learning model in the smart metering instrument.
Citation Information
Patent Citations
External transformer correction in an electricity meter
CA2387941A1
Airport engineering project construction risk assessment method based on artificial intelligence
CN117035431A
Method and device for realizing code vulnerability identification processing based on artificial intelligence, processor and computer readable storage medium thereof
CN118013529A
Financial counterfeiting detection method based on big data analysis
CN118037464A
System and method for training student friendly teacher model and student model
US20220207431A1
Cited By
Oil and gas block evaluation method and system based on two-factor model, and storage medium
CN121958916A