Water supply pipeline leakage diagnosis method and system based on attention entropy and storage medium
The method addresses pipeline leakage diagnosis by using multi-scale attention entropy and an adjustable energy parameter with an upper limit L2 norm in a heterogeneous least squares twin support vector machine, enhancing accuracy and robustness in classifying pipeline states.
Patent Information
- Application Number
- CN202411189347.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-13
AI Technical Summary
Current pipeline leakage diagnosis methods face challenges in accurately classifying leakage conditions due to high computational complexity, sensitivity to outliers, and inefficiency in existing algorithms, and the need for parameter setting in feature extraction, leading to misclassification and reduced accuracy.
A method utilizing multi-scale attention entropy for feature extraction, combined with an adjustable energy parameter and upper limit L2 norm in a heterogeneous least squares twin support vector machine, and AdaBoost algorithm to classify the pipeline leakage states, and a heterogeneous least squares twin support vector machine, and AdaBoost algorithm to classify the pipeline states.
A method utilizing multi-scale attention entropy for feature extraction, combined with an adjustable energy parameter and upper limit L2 norm in a heterogeneous least squares twin support vector machine, and AdaBoost algorithm to classify the pipeline states, improving accuracy and robustness.
Smart Images

Figure CN119123340A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to pipeline leakage diagnosis, and in particular to a water supply pipeline leakage diagnosis method, system and storage medium based on attention entropy. Background Art
[0002] With the rapid development of human society and the continuous expansion of urbanization, various underground pipeline network systems are becoming increasingly complex. Due to various factors such as pipeline corrosion, geological changes and human damage, leakage in various pipeline systems is inevitable and will bring many very bad effects. The pipeline transportation system is the lifeline to ensure the transportation of energy required by the city, and plays an increasingly important role in economic development. The water supply network system is susceptible to a variety of unstable factors during operation, which makes it difficult to completely avoid pipeline leakage. Although some cities have achieved networked water supply of pipelines in different periods and regions, due to the mixed materials of pipelines, some areas with weak pressure bearing capacity are overloaded, causing pipe burst accidents and causing great waste of water resources. Leakage in the water supply network not only increases the additional cost of water supply facilities, but also increases the risk of secondary disasters. Therefore, reducing pipeline leakage and saving water resources have become important tasks for society. It is urgent to study and explore more advanced pipeline leakage diagnosis models in depth to meet the challenges of safety and reliability in the water resource transportation process.
[0003] The core of identifying different pipeline leakage conditions lies in analyzing leakage signals and classifying various leakage conditions. This process involves extracting features from the collected pipeline leakage signals, establishing a data set, and classifying and identifying them through a classification model. In this process, the extraction of features and the effectiveness of the classification model directly affect the accuracy of identifying pipeline leakage conditions. Due to its good theoretical explanatory power and excellent feature extraction performance, the feature extraction method based on entropy theory is widely used in the field of pipeline leakage diagnosis. However, whether it is permutation entropy, fuzzy entropy or spread entropy, two or more hyperparameters need to be set in the feature extraction stage, which weakens the generalization of the algorithm.
[0004] For classification models, current research focuses on finding algorithms that have both high classification accuracy and efficient computing capabilities to maximize the accuracy of pipeline leakage identification. Although Twin Support Vector Machine (TSVM) is a commonly used method, its training process requires solving two quadratic programming problems, resulting in high computational complexity.
[0005] The Least Squares Twin Support Vector Machine (LSTSVM) proposed by Kumar et al. is an improvement on TSVM. It modifies the original quadratic programming problem through the least squares method and replaces the inequality constraints with equality constraints, which simplifies the calculation process, improves the training speed, and maintains classification accuracy similar to TSVM. However, LSTSVM is susceptible to outlier samples during training, resulting in a decrease in model classification accuracy. TSVM and most of its variants, including LSTSVM, use the squared L2 norm distance metric that is sensitive to outliers, because the square operation easily amplifies the negative impact of outliers, especially when dealing with a large number of outliers. If these outlier data dominate the metric function, the learned classifier may deviate from the basic facts, causing the classification performance to decrease in the presence of outliers. This leads to the problem of misclassification of samples, affecting the accuracy of pipeline leak detection.
[0006] In the process of collecting pipeline operating data, environmental noise will inevitably produce abnormal samples, which are usually far from the normal data distribution. Since LSTSVM assigns the same weight to normal samples and abnormal samples, these abnormal samples may interfere with the classification results, causing misclassification. In the end, if only the trained LSTSVM is used for classification, the classification accuracy is not high. Summary of the invention
[0007] Purpose of the invention: The purpose of the present invention is to provide a water supply pipeline leakage diagnosis method, system and storage medium based on attention entropy that can accurately diagnose pipeline leakage types and has good generalization.
[0008] Technical solution: The water supply pipeline leakage diagnosis method based on attention entropy of the present invention comprises the following steps:
[0009] S1. Collect multiple sets of signal data of multiple dimensions of the liquid in the pipeline under different states, calculate the multi-scale attention entropy of the signal data, and screen out the attention entropy whose correlation with the classification label meets the set requirements to construct a fusion feature data set;
[0010] S2. Use the fused feature data set to train a heterogeneous least squares twin support vector machine that introduces an adjustable energy parameter and an upper limit L2 norm, where the upper limit L2 norm is the minimum value of the square of the L2 norm and a set threshold ε; the all-one vector on the right side of the constraint equation of the heterogeneous least squares twin support vector machine is replaced with an adjustable energy parameter; the fused feature data of each pipeline state is used to train multiple heterogeneous least squares twin support vector machines;
[0011] S3. Construct multiple weak classifiers, wherein the weak classifiers include one heterogeneous least squares twin support vector machine corresponding to all pipeline states; use the AdaBoost algorithm to train the multiple weak classifiers to obtain a strong classifier for classifying the pipeline state.
[0012] Based on the above method, step S1 calculates the multi-scale attention entropy of the signal data, that is, extracts features from the signal data. Since attention entropy is a data-driven complexity measurement method, it characterizes the dynamic characteristics of the sequence by counting the changes in the extreme points inside the time series, and does not require any parameters to be set. Therefore, feature extraction is relatively simpler. Moreover, since no parameters are set, feature extraction based on attention entropy has strong generalization. At the same time, compared with the traditional entropy method that focuses on the frequency distribution of all observations in the time series and requires a relatively long time series, attention entropy only focuses on the key mode and has no requirements on the length of the time series. Therefore, feature extraction based on attention entropy has better robustness to the length of the time series. Screening of attention entropy also ensures the accuracy of the classification of the heterogeneous least squares twin support vector machine trained subsequently.
[0013] In step S2, an upper limit L2 norm and an adjustable energy parameter are introduced on the basis of the least squares twin support vector machine, wherein the upper limit L2 norm is equivalent to setting an upper limit value for the square value of the L2 norm, that is, setting a threshold value ε. When the square value of the L2 norm is greater than ε, the upper limit L2 norm is equal to ε. This can reduce the erroneous influence of the L2 norm of individual abnormal values on the metric function because their L2 norms are far from the normal value, avoid the learned classifier from deviating from the basic facts, and improve the accuracy of the classifier; introduce an adjustable capacity parameter to replace the all-one vector e on the right side of the original constraint equation, so that the interval between each sample and the decision boundary is no longer fixed to 1, but becomes an adjustable parameter, thereby improving the generalization performance of the classifier;
[0014] In step S3, each heterogeneous least squares twin support vector machine corresponding to all pipeline states is constructed as a weak classifier. Each weak classifier can give a classification result of the pipeline state. Then, multiple weak classifiers are trained in sequence through the AdaBoost algorithm. A lower weight is assigned to the weak classifier with a high error rate in each training, and a higher weight is assigned to the misclassified samples. The new weak classifier is trained continuously with the samples with redistributed weights so that the misclassified samples receive more attention. In this way, the classification accuracy of the strong classifier finally obtained can realize the accurate classification of the pipeline state, that is, the leakage type.
[0015] Preferably, step S1 calculates the attention entropy composition of the signal data of all dimensions of the liquid in the pipeline at different scales to form a characteristic variable, counts the pipeline state values corresponding to the signal data of all dimensions of the liquid in the pipeline to form a classification label variable, and screens the characteristic variable by calculating the Pearson correlation coefficient between the characteristic variable and the classification label variable.
[0016] Calculating the multi-scale attention entropy of the liquid in the pipeline in each dimension can extract the characteristics of the signal data at different time scales, which can more comprehensively reflect the characteristics of the signal data, thereby ensuring the training effect of the subsequent support vector machine; by calculating the characteristics With classification labels The Pearson correlation coefficient can filter out features that meet certain correlations with the classified notes. Eliminate useless features The fused feature data set constructed from the filtered features is used to train the support vector machine. A smaller amount of data can improve the training efficiency. Only features that have a certain degree of relevance to the classification label are used for training, avoiding the interference of useless features on the training and improving the classification accuracy of the support vector machine after training.
[0017] Preferably, the Pearson correlation coefficient calculation formula is:
[0018]
[0019] Where r is the Pearson correlation coefficient, is the attention entropy of the lth signal data of the i-th dimension of the liquid in the pipeline at the j-th scale, is the pipeline state value corresponding to the lth signal data of the i-th dimension of the liquid in the pipeline; t i,j is the average value of the entropy of all signal data of the i-th dimension of the liquid in the pipeline at the j-th scale; is the average value of the pipeline state values corresponding to all signal data of the i-th dimension of the liquid in the pipeline;
[0020] Calculate feature variables at different scales in all dimensions With categorical label variables Pearson correlation coefficient, retaining feature variables with an absolute value of r greater than 0.6 Used to construct fusion feature dataset.
[0021] Preferably, the heterogeneous least squares twin support vector machine in step S2
[0022] For linear data sample optimization problem,
[0023]
[0024] st-(Bw(1) +eb (1) )+ξ1=E (1)
[0025]
[0026] st(Aw (2) +eb (2) )+ξ2=E (2)
[0027] Among them, A and B are the feature matrices of sample data of different categories respectively; w (1) and w (2) are the weight vectors of two undetermined hyperplanes; b (1) and b (2) are the bias vectors of the two undetermined hyperplanes; c1 and c2 are penalty coefficients; ξ1 and ξ2 are slack variables; e is an all-one vector; E (1) and E (2) They represent the adjustable energy parameters of two undetermined hyperplanes respectively;
[0028] For the nonlinear sample data optimization problem,
[0029]
[0030] st-(K(B,C T ) (1) +eγ (1) )+ξ1=E (1)
[0031]
[0032] st(K(A,C T ) (1) +eγ (1) )+ξ2=E (2)
[0033] Among them, C = [A; B], u (1) and u (2) They are w (1) and w (2) The weight vectors of the two undetermined hypersurfaces mapped to the kernel space; γ (1) and γ (2) b (1) and b (2) Bias vectors for two undetermined hypersurfaces mapped into kernel space.
[0034] Preferably, the heterogeneous least squares twin support vector machine outputs the sample category through the decision function
[0035] For linear data samples, the decision function is
[0036]
[0037] For nonlinear data samples, the decision function is
[0038]
[0039] Among them, xi is the i-th data in the sample, the decision function output value of 1 indicates that the pipeline state is classified as the target pipeline state that can be recognized by the heterogeneous least squares twin vector machine, and the decision function output value of 2 indicates that the pipeline state is classified as a state other than the target pipeline state.
[0040] Preferably, the signal data collected in step S1 is first denoised using a wavelet algorithm and then its multi-scale attention entropy is calculated.
[0041] Denoising information data through wavelet algorithm can make the characteristics of the original data more obvious.
[0042] Preferably, in step S1, signal data of three dimensions, namely, dynamic pressure, acceleration and sound wave of the liquid in the pipeline, are collected.
[0043] Preferably, in step S1, signal data of the liquid in the pipeline under normal state and four leakage states are collected.
[0044] The water supply pipeline leakage diagnosis system based on attention entropy of the present invention comprises:
[0045] Data collection and screening module: used to collect multiple sets of signal data of multiple dimensions of liquid in the pipeline under different states, calculate the multi-scale attention entropy of the signal data, and screen out the attention entropy that meets the set requirements for correlation with the classification label to construct a fusion feature data set;
[0046] Support vector machine training module: used to train a heterogeneous least squares twin support vector machine with an adjustable energy parameter and an upper limit L2 norm using a fused feature data set, where the upper limit L2 norm is the minimum value of the square of the L2 norm and a set threshold ε; the all-one vector on the right side of the constraint equation of the heterogeneous least squares twin support vector machine is replaced with an adjustable energy parameter; multiple heterogeneous least squares twin support vector machines are trained for each state of the pipeline;
[0047] Strong classifier construction module: used to construct multiple weak classifiers, wherein the weak classifiers include one heterogeneous least squares twin support vector machine corresponding to all pipeline states; the AdaBoost algorithm is used to train multiple weak classifiers to obtain a strong classifier for classifying pipeline states.
[0048] The computer-readable storage medium storing one or more programs according to the present invention includes instructions, and when the instructions are executed by a computing device, the computing device executes any one of the above methods.
[0049] Beneficial effects: Compared with the prior art, the present invention has the following significant effects: by extracting feature information through entropy without setting parameters, the feature extraction process is simplified and the robustness and anti-interference ability of feature extraction are improved; by training a heterogeneous least squares twin support vector machine with adjustable energy parameters and an upper limit L2 norm to classify the pipeline status, the generalization of the support vector machine is increased and its classification accuracy, that is, the correct rate of leakage type diagnosis, is improved; finally, a weak classifier composed of multiple heterogeneous least squares twin support vector machines is trained through the Adaboost algorithm to obtain a strong classifier, which further improves the accuracy of leakage type diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 is a schematic diagram of the process of this method;
[0051] Figure 2 Schematic diagram of the experimental pipeline structure used for signal acquisition in this method;
[0052] Figure 3 This is a comparison chart of the acceleration sensor signal before and after wavelet threshold denoising; Figure 3 a is the original data diagram of the acceleration sensor signal. Figure 3 b is the data diagram of the acceleration sensor signal after denoising;
[0053] Figure 4 This is a comparison chart of the acoustic sensor signal before and after wavelet threshold denoising; Figure 4 a is the original data diagram of the acoustic sensor signal. Figure 4 b is the data diagram of the acoustic sensor signal after denoising;
[0054] Figure 5 This is a comparison diagram of the dynamic pressure sensor signal before and after wavelet threshold denoising; Figure 5 a is the original data diagram of the dynamic pressure sensor signal, Figure 5 b is the data diagram of the dynamic pressure sensor signal after denoising;
[0055] Figure 6 The fitting curve of the multi-scale attention entropy of the acceleration signal;
[0056] Figure 7 The fitting curve of multi-scale attention entropy of acoustic signal;
[0057] Figure 8 The fitting curve of multi-scale attention entropy of dynamic pressure signal;
[0058] Fig. 9 It is the fitting curve of attention entropy in the fusion feature dataset;
[0059] Fig.10 is the confusion matrix of multiple classifiers, where Fig.10 a is the confusion matrix of ECL2-LSTSVM-AdaBoost, Fig.10 b is the confusion matrix of ECL2-LSTSVM, Fig.10 c is the confusion matrix of LSTSVM, Fig.10 d is the confusion matrix of TSVM, Fig.10 e is the confusion matrix of SVM;
[0060] Fig.11 Radar chart of performance indicators for multiple classifiers. DETAILED DESCRIPTION
[0061] In order to simplify the expression, the heterogeneous least squares twin support vector machine in the present invention is represented as ECL2-LSTSVM, the strong classifier obtained by training multiple ECL2-LSTSVMs by the AdaBoost algorithm is represented as ECL2-LSTSVM-AdaBoost, the least squares twin support vector machine is represented as LSTSVM, the twin support vector machine is represented as TSVM, and the support vector machine is represented as SVM.
[0062] As shown in the figure, the water supply pipeline leakage diagnosis method based on attention entropy of the present invention comprises the following steps:
[0063] S1. Collect multiple sets of signal data of multiple dimensions of the liquid in the pipeline under different states, calculate the multi-scale attention entropy of the signal data, and screen out the attention entropy whose correlation with the classification label meets the set requirements to construct a fusion feature data set;
[0064] S2. Use the fused feature data set to train a heterogeneous least squares twin support vector machine that introduces an adjustable energy parameter and an upper limit L2 norm, where the upper limit L2 norm is the minimum value of the L2 norm and a set threshold ε; the all-one vector on the right side of the constraint equation of the heterogeneous least squares twin support vector machine is replaced with an adjustable energy parameter; the fused feature data of each state of the pipeline is used to train multiple heterogeneous least squares twin support vector machines;
[0065] S3. Construct multiple weak classifiers, wherein the weak classifiers include one heterogeneous least squares twin support vector machine corresponding to all pipeline states; use the AdaBoost algorithm to train the multiple weak classifiers to obtain a strong classifier for classifying the pipeline state.
[0066] The different states of the pipeline in step S1 are different leakage states of the pipeline, including five states: no leak (NL), circumferential crack (CC), longitudinal crack (LC), gasket leak (GL) and orifice leak (OL); the multiple dimensions refer to the three data dimensions of acceleration, dynamic pressure and sound wave. Of course, signal data of more dimensions can be collected, and multiple groups of signal data are collected in each dimension.
[0067] Taking the water supply of the chemical park as the research target, experimental simulation is carried out and relevant data is obtained, and then the simulation data is preprocessed; the acquisition and preprocessing of signal data includes the following steps:
[0068] S1.1: Collect relevant data on the liquid in the pipeline;
[0069] The measured data is from Figure 2 The branched water distribution network test bench shown in the figure is generated. The system is composed of PVC pipes with a diameter of 152.4 mm. The water distribution network is based on the set working state and simulates five states of the pipeline under different background conditions such as flow conditions and noise. Accelerometers (A), hydrophones (H), and dynamic pressure sensors (P) are arranged on the pipeline, two of each, and each sensor records 30 seconds of data.
[0070] S1.2: Perform wavelet threshold denoising on the collected data;
[0071] Due to the presence of environmental noise and other external interference, the collected sensor data usually contains a lot of noise. In order to reduce the impact of noise on fault diagnosis effect and improve the accuracy of the model, the present invention adopts wavelet threshold denoising method to denoise the sensor data, so as to make the characteristics of the original data more obvious and improve the effectiveness of data feature extraction.
[0072] Firstly, the db10 wavelet is used to decompose the original signal into 6 layers; then the modulus maximum of the decomposed wavelet coefficients is calculated, and the modulus maximum with the smallest variance is selected as the threshold; then, the noisy wavelet coefficients are processed using the soft threshold method to obtain the denoised signal components; finally, the denoised signal components are merged to obtain the denoised signal.
[0073] Among them, the formula for soft threshold processing is:
[0074]
[0075] Among them, ω λ is the processed wavelet coefficient; ω is the original wavelet coefficient; λ is the threshold.
[0076] Calculating multi-scale attention entropy and screening the preprocessed signal data includes the following steps:
[0077] S1.3: The preprocessed signal data is coarse-grained with a mean value of 8, and the specific scale can be changed according to actual needs;
[0078] Analyzing signals only from a single scale is difficult to fully reflect the effective information of complex nonlinear and non-stationary signals such as leakage signals. Multi-scale analysis introduces a scale factor based on the single scale and analyzes the signal at multiple time scales. This can more comprehensively capture the weak characteristic information of the signal. Multi-scale division, that is, mean coarse-graining processing, is an existing technology, and this article will not go into details about the specific process.
[0079] S1.4: Calculate the attention entropy of the coarse-grained signal data, that is, calculate the attention entropy of the signal data at each scale;
[0080] Attention entropy is a data-driven method to measure the complexity of time series. It characterizes the dynamic characteristics of the sequence by counting the changes in the extreme points inside the time series. Compared with other entropy methods, it does not need to set parameters such as embedding dimension and similarity tolerance, so it has strong generalization. Attention entropy has no special requirements for the length of time series. Therefore, feature extraction based on attention entropy has better robustness to the length of time series than traditional entropy methods. Attention entropy is easy to calculate and does not require any parameters to be set. The following is the specific algorithm flow of attention entropy:
[0081] S1.4.1: Use the peak point as the key mode. i When the following conditions are met, x i Defined as a peak point, the peak point includes the local maximum and local minimum:
[0082] Local maximum: x i >x i-1 and x i >x i+1 (Max)
[0083] Local minimum: x i <x i-1 and x i <x i+1 (Min)
[0084] S1.4.2: Determine the interval between consecutive critical patterns, considering the following four cases:
[0085] The interval from local maximum to local maximum (Max-Max)
[0086] The interval from local minimum to local minimum (Min-Min)
[0087] The interval from the local maximum to the local minimum (Max-Min)
[0088] The interval between the local minimum and the local maximum (Min-Max)
[0089] The two key modes before and after are defined as the first key mode and the second key mode respectively. The continuous key mode means that there is no key mode that is the same as the second key model between the two key modes. For example, in Max-Max, there can be a local minimum between two local maxima but there cannot be a third local maximum. For another example, in Max-Min, there is no other local minimum between the local maximum and the local minimum. There are 4 types of continuous key modes.
[0090] There are multiple types of interval points for each of the above continuous key modes. For example, Max-Max, the signal data has multiple local maxima on the entire time scale. For the convenience of expression, we take four local maxima and name them Max1, Max2, Max3 and Max4 respectively. The interval between Max1 and Max2 is 5, the interval between Max2 and Max3 is 7, and the interval between Max3 and Max4 is 3. The intervals of the remaining local maxima can be the same as any of these three types or different from them. That is, Max-Max has 3 or more types of interval points.
[0091] S1.4.3: The average Shannon entropy of the four key pattern intervals is used as the attention entropy. The specific calculation formula is as follows:
[0092]
[0093] Among them, T i (m) is the probability of occurrence of the mth interval point type in the i-th continuous key pattern.
[0094] Calculate the attention entropy composition feature variables of all signal data of the i-th dimension of the liquid in the pipeline at the j-th scale in is the attention entropy of the nth signal data of the ith dimension of the liquid in the pipeline at the jth scale, n is the total number of signal data of each dimension of the liquid in the pipeline, that is, the total number of signal data collected in each dimension of the liquid in the pipeline is the same and is n; in this embodiment, it is necessary to calculate the attention entropy of all signal data of three dimensions of the liquid in the pipeline at eight scales. Assuming that 100 signal data are collected in each dimension, there will be 2400 attention entropies in the end.
[0095] S1.5: Screening feature variables by Pearson correlation coefficient The filtered feature variables Build a fusion feature dataset;
[0096] Too much attention entropy will reduce the model's operating speed, and even redundant attention entropy will reduce the model's accuracy. Therefore, the present invention adopts the Pearson correlation analysis method to eliminate irrelevant features by calculating the Pearson correlation coefficient between features and categories, thereby screening out the optimal feature variables.
[0097] Before calculating the Pearson correlation coefficient, it is necessary to form a classification label variable with the pipeline state values corresponding to all signal data of the liquid in the pipeline in the i-th dimension in is the pipeline state value corresponding to the nth signal data of the i-th dimension of the liquid in the pipeline. The pipeline state value is an artificially assigned value. The five pipeline states in this embodiment are assigned different values, such as 0, 1, 2, 3, and 4 respectively.
[0098] By calculating the characteristic variables With categorical label variables Pearson correlation coefficient to screen feature variables The specific formula is:
[0099]
[0100] Where r is the Pearson correlation coefficient, is the attention entropy of the lth signal data of the i-th dimension of the liquid in the pipeline at the j-th scale, is the pipeline state value corresponding to the lth signal data of the i-th dimension of the liquid in the pipeline; is the average value of the entropy of all signal data of the i-th dimension of the liquid in the pipeline at the j-th scale; is the average value of the pipeline state values corresponding to all signal data of the i-th dimension of the liquid in the pipeline.
[0101] Calculate feature variables at different scales in all dimensions With categorical label variables The Pearson correlation coefficient is: when r = 1, it means that the two variables are completely positively correlated; when r = -1, it means that the two variables are completely negatively correlated; when r = 0, it means that there is no linear relationship between the two variables. The characteristic variables with an absolute value of r greater than 0.6 are retained. Used to construct fusion feature dataset.
[0102] In the step S2, the heterogeneous least squares twin support vector machine uses the upper limit L2 norm to measure the distance, and the upper limit L2 norm is the minimum value of the square value of the L2 norm and the set threshold ε. Because the distance is measured by the square operation of the L2 norm in LSTSVM, the upper limit L2 norm is used to avoid the negative impact of the L2 norm square operation amplifying the noise and outliers, causing misclassification and affecting the accuracy of pipeline leakage diagnosis.
[0103] The goal of ECL2-LSTSVM is to minimize the intra-class distance of samples through the upper L2 norm during training and eliminate the influence of outliers. When the upper L2 norm is used for measurement, no matter how misclassified the sample is, its square value is at most ε. When ε is set appropriately, the square value of the upper L2 norm is bounded, which can ensure better robustness. Then, by introducing an adjustable energy parameter E to replace the all-one vector on the right side of the constraint equation, the interval between each sample and the decision boundary is no longer fixed to 1, but becomes an adjustable parameter, thereby improving the generalization performance of the classifier, that is, ECL2-LSTSVM.
[0104] Assume that the data set Z = {(x1,y1),(x2,y2),…,(x m ,y m )}, where x i ∈R n is the training sample, y i For sample x i The category label of . Assume that the sample matrix Represents a matrix composed of data samples of the positive class, It is represented as a matrix composed of negative class data samples, where the total number of samples is m=m1+m2 and the number of attributes of the samples is l. The linear data sample optimization problem of ECL2-LSTSVM can be expressed as
[0105]
[0106] st-(Bw (1) +eb (1) )+ξ1=E (1)
[0107]
[0108] st(Aw (2) +eb (2) )+ξ2=E (2)
[0109] Among them, A and B are the feature matrices of sample data of different categories respectively; w (1) and w (2) are the weight vectors of two undetermined hyperplanes; b(1) and b (2) are the bias vectors of the two undetermined hyperplanes; c1 and c2 are penalty coefficients; ξ1 and ξ2 are slack variables; e is an all-one vector; E (1) and E (2) They represent the adjustable energy parameters of the two undetermined hyperplanes.
[0110] For nonlinear sample data, the kernel function K is introduced, and the following surface generated by the kernel is considered:
[0111] K(A,C T ) (1) +γ (1) = 0 and K(B,C T ) (2) +γ (2) =0
[0112] On this basis, the ECL2-LSTSVM optimization problem for nonlinear data samples can be expressed as
[0113]
[0114] st-(K(B,C T ) (1) +eγ (1) )+ξ1=E (1)
[0115]
[0116] st(K(A,C T ) (1) +eγ (1) )+ξ2=E (2)
[0117] Among them, C = [A; B], u (1) and u (2) They are w (1) and w (2) The weight vectors of the two undetermined hypersurfaces mapped to the kernel space; γ (1) and γ (2) b (1) and b (2) Bias vectors for two undetermined hypersurfaces mapped into kernel space.
[0118] The training process of ECL2-LSTSVM includes taking the fused feature dataset as the input of ECL2-LSTSVM, taking the pipeline state corresponding to the fused feature dataset as the output, and determining the classification hyperplane.
[0119] For linear sample data, the process is as follows: use the fused feature data set as the input of the linear ECL2-LSTSVM model, determine the optimal combination of penalty parameters and energy parameters through the grid search method, and solve the optimization problem of the linear model under the optimal parameter combination, so as to determine the two optimal non-parallel hyperplanes and obtain the ECL2-LSTSVM linear detection model based on attention entropy.
[0120] For nonlinear sample data, the process is as follows: the fused feature data set is used as the input of the nonlinear ECL2-LSTSVM model, RBF is used as the kernel function, the optimal combination of penalty parameters, energy parameters, and kernel parameters is determined by the grid search method, and the optimization problem of the nonlinear model under the optimal parameter combination is solved, thereby determining two optimal non-parallel hypersurfaces and obtaining the ECL2-LSTSVM nonlinear detection model based on attention entropy.
[0121] The fused feature data of each pipeline state is used to train multiple ECL2-LSTSVMs; specifically, the fused feature dataset has multiple fused feature data, namely constitute, and each All are extracted from a piece of information data, which corresponds to a clear pipeline status For all signal data with a pipeline status value of 0, all It is used to train multiple ECL2-LSTSVMs to identify the pipeline state. For all signal data with other values of the pipeline state, all extracted Performing the same operation, there are multiple ECL2-LSTSVMs that can identify any specific state of the pipeline.
[0122] After training, ECL2-LSTSVM outputs sample categories through decision functions
[0123] For linear data samples, the decision function is
[0124]
[0125] For nonlinear data samples, the decision function is
[0126]
[0127] Among them, x iFor the i-th data in the sample, the decision function output value of 1 indicates that the pipeline state is classified as the target pipeline state that can be recognized by the ECL2-LSTSVM, and the decision function output value of 2 indicates that the pipeline state is classified as a state other than the target pipeline state; that is, each ECL2-LSTSVM can identify a specific target pipeline state, for example, if the target pipeline state is no leakage, then the sample is input into the ECL2-LSTSVM, and its decision function output 1 indicates that the pipeline has no leakage. If it is output 2, it indicates that the pipeline is in a state other than no leakage, which in this embodiment is any one of annular cracks, longitudinal cracks, gasket leakage and orifice leakage. However, the ECL2-LSTSVM cannot identify the specific leakage type, and needs to cooperate with other ECL2-LSTSVMs that can identify these four leakage states to finally determine the state of the pipeline; this is actually to expand multiple binary classification models to multi-classification models through a one-to-many strategy.
[0128] The weak classifiers constructed in step S3 include one ECL2-LSTSVM corresponding to all the states of the pipeline, that is, each weak classifier includes one ECL2-LSTSVM that can identify five different states of the pipeline, so that each weak classifier can classify the pipeline into a certain clear state through the cooperation of five ECL2-LSTSVMs.
[0129] The AdaBoost algorithm is ensemble learning, and ensemble learning is a technique for combining two or more machine learning algorithms, which can obtain better performance than using a single algorithm. The Boosting algorithm continuously corrects the mistakes made by the previous model through iterative training, and combines the weights calculated according to the prediction results of all weak classifiers to obtain the final strong classifier. The present invention adopts a classic Boosting algorithm-AdaBoost, and combines it with ECL2-LSTSVM to construct an ECL2-LSTSVM-AdaBoost classifier. In AdaBoost, multiple different ECL2-LSTSVMs are combined, and each iteration of the ECL2-LSTSVM model is assigned a larger weight to the wrongly classified samples, and a smaller weight to the correctly classified samples, thereby ensuring that the subsequent iteration of the ECL2-LSTSVM model pays more attention to the previously misclassified samples, thereby improving the accuracy and robustness of the model.
[0130] AdaBoost consists of the following sub-steps:
[0131] S3.1. Assuming the total number of samples is n, initialize the sample weights and assign the same weight to each sample. D1 represents the initial sample weight distribution.
[0132] D1=(w 1,1 ,…,w1,t )
[0133]
[0134] where w 1,i Represents the weight of the i-th sample in the initial sample.
[0135] S3.2, set the number of iterations Q, and then start the iteration, according to the weight distribution D q The training set trains the weak classifier h q , where D q Represents the weight distribution of samples during the qth training;
[0136] S3.3. Calculate the error rate of the weak classifier: h q (x i ) is the classification result of the qth generation weak classifier for sample xi, and yi is x i The true label of the weak classifier is calculated as:
[0137]
[0138] Among them, I represents the qth generation weak classifier h q For the classification result of sample xi, if [h q (x i )≠y i ], I[h q (x i )≠y i ]=1, otherwise I[h q (x i )≠y i ]=0;
[0139] S3.4. Calculate the weak classifier coefficients
[0140]
[0141] S3.5. Update training sample weights
[0142]
[0143] Among them, Z q is the normalization factor
[0144]
[0145] S3.6. Repeat steps S3.2 to S3.5 until the maximum number of iterations Q is reached, and finally a strong classifier is obtained by weighting according to the weights of each generation of weak classifiers.
[0146] S4. In order to better verify the effect of this method on pipeline leakage diagnosis, data analysis and verification are carried out, including:
[0147] Calculate the confusion matrix and the accuracy, sensitivity, and specificity of the confusion matrix;
[0148] Accuracy refers to the ratio of the number of samples correctly predicted by the model to the number of all predicted samples. The formula is as follows:
[0149]
[0150] Sensitivity refers to the proportion of samples that are actually positive that the model correctly predicts as positive. The formula is as follows:
[0151]
[0152] Specificity refers to the proportion of samples that are actually negative that the model correctly predicts as negative. The formula is as follows:
[0153]
[0154] Where TP is the number of samples predicted by the model as positive and actually positive, TN is the number of samples predicted by the model as negative and actually negative, FP is the number of samples predicted by the model as positive but actually negative, and FN is the number of samples predicted by the model as negative but actually positive.
[0155] Analyze and verify the calculation results;
[0156] This paper uses SVM, TSVM, LSTSVM, ECL2-LSTSVM and ECL2-LSTSVM-AdaBoost algorithms for comparison. The performance is shown in Table 1, which shows the specificity, sensitivity and accuracy results of the five algorithms.
[0157] Table 1 Specificity, sensitivity and accuracy of different algorithms
[0158] method Spe Sen Acc <![CDATA[ECL2-LSTSVM-AdaBoost]]> 0.9956 0.9833 0.9821 <![CDATA[ECL2-LSTSVM]]> 0.9822 0.9287 0.9272 LSTSVM 0.9531 0.8173 0.8000 TSVM 0.9032 0.5913 0.5636 SVM 0.9348 0.7335 0.7272
[0159] As can be seen from Table 1, the sensitivity of the five classifiers is all above 0.9, and the ECL2-LSTSVM-AdaBoost model reaches the highest 0.9956; the specificity and accuracy are also the highest in the ECL2-LSTSVM-AdaBoost model, reaching above 0.98, while the lowest is SVM at around 0.56.
[0160] Attached Fig.10 The confusion matrix diagram of each algorithm is shown in Figure 2. Fig.10It can be seen that the ECL2-LSTSVM-AdaBoost model proposed in this paper has the best classification effect, followed by the ECL2-LSTSVM model without ensemble learning; the remaining three models are relatively poor compared to the first two. Fig.11 The radar chart of the performance indicators of each algorithm shows that ECL2-LSTSVM-AdaBoost has the largest area compared to other models, which means that the model of the present invention has a preference for all indexes compared to other models. In general, the ECL2-LSTSVM-AdaBoost proposed in this paper achieves better classification results in pipeline leakage diagnosis.
[0161] The water supply pipeline leakage diagnosis system based on attention entropy of the present invention comprises:
[0162] Data collection and screening module: used to collect multiple sets of signal data of multiple dimensions of liquid in the pipeline under different states, calculate the multi-scale attention entropy of the signal data, and screen out the attention entropy that meets the set requirements for correlation with the classification label to construct a fusion feature data set;
[0163] Support vector machine training module: used to train a heterogeneous least squares twin support vector machine with an adjustable energy parameter and an upper limit L2 norm using a fused feature data set, where the upper limit L2 norm is the minimum value of the square of the L2 norm and a set threshold ε; the all-one vector on the right side of the constraint equation of the heterogeneous least squares twin support vector machine is replaced with an adjustable energy parameter; multiple heterogeneous least squares twin support vector machines are trained for each state of the pipeline;
[0164] Strong classifier construction module: used to construct multiple weak classifiers, wherein the weak classifiers include one heterogeneous least squares twin support vector machine corresponding to all pipeline states; the AdaBoost algorithm is used to train multiple weak classifiers to obtain a strong classifier for classifying pipeline states.
[0165] The computer-readable storage medium storing one or more programs according to the present invention, wherein the one or more programs include instructions, and when the instructions are executed by a computing device, the computing device executes any one of the methods according to claims 1 to 8.
Claims
1. A water supply pipeline leakage diagnosis method based on attention entropy, It is characterized in that The following steps are involved: S1. Collect multiple sets of signal data of multiple dimensions of the liquid in the pipeline under different states, calculate the multi-scale attention entropy of the signal data, and screen out the attention entropy whose correlation with the classification label meets the set requirements to construct a fusion feature data set; S2. Introducing adjustable energy parameters and upper limit L using fusion feature dataset training 2 norm of heterogeneous least squares twin support vector machines, the upper limit L 2 The norm is L 2 The square value of the norm and the minimum value of the set threshold ε; the all-one vector on the right side of the constraint equation of the heterogeneous least squares twin support vector machine is replaced with an adjustable energy parameter; the fused feature data of each pipeline state is used to train multiple heterogeneous least squares twin support vector machines; S3. Construct multiple weak classifiers, wherein the weak classifiers include one heterogeneous least squares twin support vector machine corresponding to all pipeline states; use the AdaBoost algorithm to train the multiple weak classifiers to obtain a strong classifier for classifying the pipeline state.
2. According to claim 1, a water supply pipeline leakage diagnosis method based on attention entropy, Features: The step S1 calculates the attention entropy of the signal data of all dimensions of the liquid in the pipeline at different scales to form a characteristic variable, counts the pipeline state values corresponding to the signal data of all dimensions of the liquid in the pipeline to form a classification label variable, and screens the characteristic variable by calculating the Pearson correlation coefficient between the characteristic variable and the classification label variable.
3. According to claim 2, a water supply pipeline leakage diagnosis method based on attention entropy, Features: The Pearson correlation coefficient calculation formula is: Where r is the Pearson correlation coefficient, is the attention entropy of the lth signal data of the i-th dimension of the liquid in the pipeline at the j-th scale, is the pipeline state value corresponding to the lth signal data of the i-th dimension of the liquid in the pipeline; is the average value of the entropy of all signal data of the i-th dimension of the liquid in the pipeline at the j-th scale; is the average value of the pipeline state values corresponding to all signal data of the i-th dimension of the liquid in the pipeline; Calculate feature variables at different scales in all dimensions With categorical label variables Pearson correlation coefficient, retaining feature variables with an absolute value of r greater than 0.6 Used to construct fusion feature dataset.
4. According to claim 1, a water supply pipeline leakage diagnosis method based on attention entropy, Features: The heterogeneous least squares twin support vector machine in step S2 For linear data sample optimization problem, st-(Bw (1) +eb (1) )+ξ 1 =E (1) st(Aw (2) +eb (2) )+ξ 2 =E (2) Among them, A and B are the feature matrices of sample data of different categories respectively; w (1) and w (2) are the weight vectors of two undetermined hyperplanes; b (1) and b (2) are the bias vectors of the two undetermined hyperplanes; c 1 and c 2 are the penalty coefficients respectively; 1 and 2 are slack variables respectively; e is an all-one vector; E (1) and E (2) They represent the adjustable energy parameters of two undetermined hyperplanes respectively; For the nonlinear sample data optimization problem, s.t.-(K(B,C T )u (1) +eγ (1) )+ξ 1 =E (1) s.t.(K(A,C T )u (1) +eγ (1) )+ξ 2 =E (2) Among them, C = [A; B], u (1) and u (2) They are w (1) and w (2) The weight vectors of the two undetermined hypersurfaces mapped to the kernel space; γ (1) and γ (2) b (1) and b (2) Bias vectors for two undetermined hypersurfaces mapped into kernel space.
5. A water supply pipeline leakage diagnosis method based on attention entropy according to claim 4, Features: The heterogeneous least squares twin support vector machine outputs sample categories through the decision function For linear data samples, the decision function is For nonlinear data samples, the decision function is Among them, x i For the i-th data in the sample, the decision function output value of 1 indicates that the pipeline state is classified as the target pipeline state that can be recognized by the heterogeneous least squares twin vector machine, and the decision function output value of 2 indicates that the pipeline state is classified as a state other than the target pipeline state.
6. A water supply pipeline leakage diagnosis method based on attention entropy according to claim 1, Features: The signal data collected in step S1 is first denoised using a wavelet algorithm and then its multi-scale attention entropy is calculated.
7. A water supply pipeline leakage diagnosis method based on attention entropy according to claim 1, Features: In the step S1, signal data of three dimensions, namely, dynamic pressure, acceleration and sound wave of the liquid in the pipeline, are collected.
8. A water supply pipeline leakage diagnosis method based on attention entropy according to claim 1, Features: In the step S1, signal data of the liquid in the pipeline under normal state and four leakage states are collected.
9. A water supply pipeline leakage diagnosis system based on attention entropy, It is characterized in that The system comprises: Data collection and screening module: used to collect multiple sets of signal data of multiple dimensions of the liquid in the pipeline under different states, calculate the multi-scale attention entropy of the signal data, and screen out the attention entropy that meets the set requirements for correlation with the classification label to construct a fusion feature data set; Support vector machine training module: used to introduce adjustable energy parameters and upper limit L using fusion feature data set training 2 norm of heterogeneous least squares twin support vector machines, the upper limit L 2 The norm is L 2 The minimum value of the norm square value and the set threshold ε; the all-one vector on the right side of the heterogeneous least squares twin support vector machine constraint equation is replaced with an adjustable energy parameter; multiple heterogeneous least squares twin support vector machines are trained for each state of the pipeline; Strong classifier construction module: used to construct multiple weak classifiers, wherein the weak classifiers include one heterogeneous least squares twin support vector machine corresponding to all pipeline states; the AdaBoost algorithm is used to train multiple weak classifiers to obtain a strong classifier for classifying pipeline states.
10. A computer-readable storage medium storing one or more programs, Features : The one or more programs include instructions, which, when executed by a computing device, cause the computing device to perform any of the methods according to claims 1 to 8.
