Water supply pipeline leakage detection method and system based on support vector weighted model
The support vector weighted model is used to process the sound pressure sample data of water supply pipelines, balance the proportions of different types of samples, and use the target multi-classification leak detection model to solve the problem of false negatives caused by sample imbalance in the existing technology and improve the accuracy of leak detection. accuracy.
Patent Information
- Application Number
- CN202410890736.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-07-04
AI Technical Summary
The existing water supply pipeline leakage detection model fails to effectively consider the problem of sample imbalance, resulting in frequent false alarms and reducing the accuracy of leakage detection.
A method based on the support vector weighted model is adopted to collect sound pressure sample data, divide the support vector area sample set and the non-support vector area sample set, generate balanced sample data, and detect it through the target multi-classification leakage detection model to ensure that each The proportion of type samples is the same, thereby improving detection accuracy.
It effectively solves the problem of underreporting caused by unbalanced samples, improves the accuracy and effectiveness of water supply pipeline leak detection, and enhances the ability to detect leaks.
Smart Images

Figure CN118408162B
Abstract
Description
Technical Field
[0001] The present application relates to the field of signal processing technology, and in particular to a water supply pipeline leakage detection method and system based on a support vector weighted model. Background Art
[0002] As one of the main ways to transport water resources, water supply pipelines are used to ensure people's most basic living and production needs. The environment in which water supply pipelines are located is relatively complex, and pipelines are often easily damaged. As pipelines age, leaks also occur from time to time. If a leak in a water supply pipeline cannot be discovered and handled in time, it will not only cause a waste of water resources, but also affect people's normal life and production, and even cause serious accidents such as ground collapse, posing a threat to people's lives and safety.
[0003] At present, the existing water supply pipeline leakage detection is usually based on artificial intelligence algorithms to classify and detect the leakage data in the pipeline, for example: classification based on neural networks, deep learning and other models.
[0004] However, it is difficult to obtain data when a pipeline leaks, and the amount of pipeline leakage data is far less than the data under normal pipeline conditions, that is, the samples used for pipeline leakage detection are unbalanced samples. Most classification models used for pipeline leakage detection do not consider the situation of sample imbalance, which will cause underreporting when used, thereby greatly reducing the accuracy of pipeline leakage detection. Summary of the invention
[0005] The present application provides a water supply pipeline leakage detection method and system based on a support vector weighted model to solve the technical problem that most of the current classification models used for pipeline leakage detection do not take into account the sample imbalance, which will cause underreporting when used, thereby greatly reducing the accuracy of pipeline leakage detection.
[0006] The first aspect of the present application provides a water supply pipeline leakage detection method based on a support vector weighted model, comprising:
[0007] Collecting sound pressure sample data of the water supply pipeline to be tested;
[0008] Based on a support vector weighted model, the sound pressure sample data is divided into a first number of support vector area sample sets and a second number of support vector area sample sets; the first number is smaller than the second number;
[0009] generating sample data based on the first number of support vector region sample sets and the second number of support vector region sample sets;
[0010] Based on the support vector weighted model, the sound pressure sample data is divided into a first number of non-support vector area sample sets and a second number of non-support vector area sample sets;
[0011] Generate target sample data based on the first number of non-support vector area sample sets, the second number of non-support vector area sample sets and sample data;
[0012] The target sample data is detected and classified using a target multi-classification leakage detection model to generate a leakage detection result for the water supply pipeline.
[0013] In some embodiments, collecting the sound pressure sample data of the water supply pipe to be tested includes:
[0014] Collecting the acoustic wave signal of the water supply pipeline to be detected, and determining the energy, root mean square, effective value, standard deviation, kurtosis number, pulse coefficient, average amplitude and peak value of the acoustic wave signal;
[0015] The energy, root mean square, effective value, standard deviation, kurtosis number, pulse coefficient, average amplitude and peak value are normalized to obtain the sound pressure sample data.
[0016] In some embodiments, before generating the target sample data, the method further includes:
[0017] Decomposing the sound pressure sample data based on an empirical mode decomposition model of adaptive noise, decomposing the sound pressure sample data into a plurality of eigenmode components;
[0018] Based on the intrinsic mode component, a noise target in the sound pressure sample data is determined, and the noise target is filtered out to obtain the sound pressure sample data from which the noise target is filtered out.
[0019] In some embodiments, determining the noise target in the sound pressure sample data based on the intrinsic mode component includes:
[0020] Based on the intrinsic mode component, obtaining a mutual information value between the intrinsic mode component and a sound pressure signal;
[0021] Determining a high-correlation eigenmode component and a low-correlation eigenmode component based on a mutual information value between the eigenmode component and the sound pressure signal;
[0022] The high-correlation intrinsic mode component and the low-correlation intrinsic mode component are reconstructed by using the Hurst exponent to obtain the noise target.
[0023] In some embodiments, the high-correlation eigenmode component is the eigenmode component corresponding to the maximum mutual information value; the low-correlation eigenmode component is the eigenmode component corresponding to the minimum mutual information value.
[0024] In some embodiments, reconstructing the high-correlation intrinsic mode component and the low-correlation intrinsic mode component by using the Hurst exponent to obtain the noise target, filtering the noise target, and obtaining the sound pressure sample data after filtering out the noise target includes:
[0025] The low-correlation intrinsic mode component is divided into a low-entropy high-persistence component, a noisy component and a useless component by using the Hurst index; the noisy component contains a noise target;
[0026] The noise target is removed through a wavelet transform model, and the high-correlation intrinsic mode component, the low-entropy high-persistence component, and the noisy component after the noise target is removed are reconstructed to obtain the sound pressure sample data after the noise target is filtered out.
[0027] In some embodiments, generating sample data based on the first number of support vector region sample sets and the second number of support vector region sample sets includes:
[0028] Determine the distance density of the first number of support vector area sample sets and the density weight of the second number of support vector area sample sets, and determine the sampling weight based on the distance density and the density weight;
[0029] Determining the sampling number based on the sampling weight, and sampling the sound pressure sample data according to the sampling number to generate a sample set;
[0030] Sample data is generated based on the sample set and the sound pressure sample data.
[0031] In some embodiments, generating target sample data based on the first number of non-support vector region sample sets, the second number of non-support vector region sample sets and the sample data comprises:
[0032] Determine the number of sample copies of the second number of non-support vector area sample sets based on the number of samples of the first number of non-support vector area sample sets and the number of samples of the second number of non-support vector area sample sets;
[0033] According to the number of samples, evenly divide the second number of non-support vector area sample sets into a plurality of second number of non-support vector area sub-sample sets;
[0034] Based on the second number of non-support vector region sub-sample sets, extracting a preset number of majority class samples from the second number of non-support vector region sub-sample sets;
[0035] Target sample data is generated based on the second number of non-support vector area sub-sample sets, majority class samples, the first number of non-support vector area sample sets, and sample data.
[0036] In some embodiments, before detecting and classifying the target sample data using the target multi-classification leakage detection model to generate the leakage detection result of the water supply pipeline, the method includes:
[0037] An initial multi-classification leakage detection model is constructed based on multiple twin bounded support vector machine models;
[0038] Obtaining the sample data and / or a training sample set corresponding to the target sample data;
[0039] Based on the training sample set, the initial multi-classification leakage detection model is trained to obtain a target multi-classification leakage detection model.
[0040] The second aspect of the present application provides a water supply pipeline leakage detection system based on a support vector weighted model, comprising:
[0041] A collection module, the collection module is used to collect sound pressure sample data of the water supply pipeline to be tested;
[0042] A first division module, wherein the first division module is configured to divide the sound pressure sample data into a first number of support vector area sample sets and a second number of support vector area sample sets based on a support vector weighted model; the first number is smaller than the second number;
[0043] A first generating module, wherein the first generating module is configured to generate sample data based on the first number of support vector region sample sets and the second number of support vector region sample sets;
[0044] A second division module, the second division module is used to divide the sound pressure sample data into a first number of non-support vector area sample sets and a second number of non-support vector area sample sets;
[0045] A second generating module, wherein the second generating module is configured to generate target sample data based on the first number of non-support vector area sample sets, the second number of non-support vector area sample sets and the sample data;
[0046] The third generation module is used to detect and classify the target sample data through a target multi-classification leakage detection model to generate a leakage detection result of the water supply pipeline.
[0047] The present application provides a water supply pipeline leakage detection method and system based on a support vector weighted model, the method comprising: collecting sound pressure sample data of a water supply pipeline to be detected; based on a support vector weighted model, dividing the sound pressure sample data into a first number of support vector area sample sets and a second number of support vector area sample sets; the first number is less than the second number; based on the first number of support vector area sample sets and the second number of support vector area sample sets, generating sample data; based on a support vector weighted model, dividing the sound pressure sample data into a first number of non-support vector area sample sets and a second number of non-support vector area sample sets; based on the first number of non-support vector area sample sets, the second number of non-support vector area sample sets and the sample data, generating target sample data; detecting and classifying the target sample data through a target multi-classification leakage detection model, generating a leakage detection result of the water supply pipeline, so as to solve the problem of unbalanced pipeline leakage detection samples, balance the pipeline leakage detection samples through a support vector weighted model, make each different type of sample account for the same proportion, thereby improving the detection accuracy and effectiveness of water supply pipeline leakage. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0049] Figure 1 A flow chart of a method for detecting water supply pipeline leakage in this application;
[0050] Figure 2 It is a structural schematic diagram of a water supply pipe leakage detection system in this application;
[0051] Figure 3 It is a curve diagram of the sound pressure signal under various working conditions before denoising in this application in one embodiment;
[0052] Figure 4 It is a curve diagram of the sound pressure signal under various working conditions before denoising in another embodiment of the present application;
[0053] Figure 5 It is a curve diagram of the sound pressure signal under various working conditions after denoising in this application in one embodiment;
[0054] Figure 6 Schematic diagram of curves of sound pressure signals under various working conditions after denoising in another embodiment of the present application.
[0055] Description of reference numerals:
[0056] 1-acquisition module; 2-first division module; 3-first generation module; 4-second division module; 5-second generation module; 6-third generation module. DETAILED DESCRIPTION
[0057] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application.
[0058] Since in some technologies, most classification models used for pipeline leakage detection do not consider the situation of sample imbalance, it will cause underreporting when used, thereby greatly reducing the accuracy of pipeline leakage detection. In order to solve this technical problem, the present application provides a water supply pipeline leakage detection method and system based on a support vector weighted model. The water supply pipeline leakage detection method and system based on a support vector weighted model are described below:
[0059] Depend on Figure 1 It can be seen that the first aspect of the present application provides a water supply pipeline leakage detection method based on a support vector weighted model, comprising the following steps:
[0060] S100: Collect the sound pressure sample data of the water supply pipeline to be tested; in a specific implementation scenario, the execution end that collects the sound pressure sample data is used as a detection platform for pipeline leakage, and a pipeline with a length of 3km, an inner diameter of 100mm, and water as the medium inside the pipeline is leaked. Among them, sensors and data collectors are installed at both ends of the water supply pipeline to upload the collected sound pressure sample data. Specifically, a PCB106B sound pressure sensor is installed at each end of the pipeline for collecting sound wave data of leakage in the pipeline. The model of the data collector is NIDAQ9181. The data collector processes the data obtained by the sensor and uploads it to the current execution end. The sampling frequency of the collector is set to 1000Hz, which is not specifically limited in this application.
[0061] The acquisition of the sound pressure sample data of the water supply pipeline to be detected includes the following sub-steps: S110: Acquiring the sound wave signal of the water supply pipeline to be detected, and determining the energy, root mean square, effective value, standard deviation, number of kurtosis, pulse coefficient, average amplitude and peak value of the sound wave signal; S120: Normalizing the energy, root mean square, effective value, standard deviation, number of kurtosis, pulse coefficient, average amplitude and peak value to obtain the sound pressure sample data. In order to ensure the validity of the sound pressure sample data, in a specific implementation scenario, the current execution end acquires the sound wave signal on the water supply pipeline to be detected, and determines the energy, root mean square, effective value, standard deviation, number of kurtosis, pulse coefficient, average amplitude and peak value of the sound wave signal, and normalizes the energy, root mean square, effective value, standard deviation, number of kurtosis, pulse coefficient, average amplitude and peak value to construct the sound pressure sample data. Among them, under different working conditions, the values of the four characteristic parameters of energy, root mean square, standard deviation, and average amplitude are all different. Correspondingly, the classification of the classification detection output includes small pipeline leakage, medium leakage, and severe leakage, that is, the leakage detection results of the water supply pipeline, which are not specifically limited in this application. Among them, energy is the difference value generated by the sound pressure signal, which can be calculated based on the propagation fluctuation of the sound pressure signal, which is not specifically limited in this application. The root mean square, effective value, standard deviation, kurtosis number, pulse coefficient, average amplitude and peak value are all calculated based on the sound pressure signal, which are not specifically limited in this application.
[0062] Before generating the target sample data, the method further includes the following steps: S130: decomposing the sound pressure sample data based on the empirical mode decomposition model of adaptive noise, and decomposing the sound pressure sample data into multiple intrinsic mode components; S140: determining the noise target in the sound pressure sample data based on the intrinsic mode components, filtering the noise target, and obtaining the sound pressure sample data with the noise target filtered out. In this embodiment, in order to reduce the inaccurate classification of the leakage detection result caused by the presence of noise in the sound pressure sample data, the current execution end decomposes the sound pressure sample data based on the empirical mode decomposition of adaptive noise to obtain multiple intrinsic mode components. The empirical mode decomposition model ICEEMDAN of adaptive noise is improved on the basis of CEEMDAN, and the empirical mode decomposition ICEEMDAN of adaptive noise adds the Kth intrinsic mode component IMF after Gaussian white noise is decomposed by empirical mode decomposition EMD into the decomposition process. At the same time, the noise target in the sound pressure sample data is determined based on the multiple intrinsic mode components after decomposition, and filtered out. This avoids inaccurate classification of leak detection results caused by noise targets in the sound pressure sample data.
[0063] It should be noted that the specific process of obtaining the intrinsic mode components after decomposing Gaussian white noise using EMD includes: defining x as the information data to be decomposed in the sound pressure sample data, Ek () represents the k-order modal component generated by EMD decomposition, J () represents the local mean of the generated signal, represents Gaussian white noise, is the signal-to-noise ratio, Represents the amount of white noise added. The specific process is as follows: First, add Gaussian white noise to the original sequence, i.e., the sound pressure sample data. , construct a new signal sequence , and then find the residual ; Get the first-order intrinsic mode component IMF1=x-r1; then add white noise to the residual r1, and get , and decompose it to obtain the second-order eigenmode ; For k=2, 3, k, calculate the kth order intrinsic mode function component IMF k =r k-1 -r k ;in, r k , r k-1 is the residual; Repeat the above steps until the decomposition is completed and each eigenmode component and residual are obtained.
[0064] The method of determining the noise target in the sound pressure sample data based on the intrinsic mode component includes the following sub-steps: S141: Based on the intrinsic mode component, obtaining the mutual information value between the intrinsic mode component and the sound pressure signal; S142: Based on the mutual information value between the intrinsic mode component and the sound pressure signal, determining the high-correlation intrinsic mode component and the low-correlation intrinsic mode component; the high-correlation intrinsic mode component is the eigenmode component corresponding to the maximum mutual information value; the low-correlation intrinsic mode component is the eigenmode component corresponding to the minimum mutual information value. S143: Reconstructing the high-correlation intrinsic mode component and the low-correlation intrinsic mode component by Hurst exponent to obtain the noise target.
[0065] In this embodiment, in order to effectively screen the noise target and thus remove the noise, the current information terminal determines the noise target by first determining the mutual information value between each intrinsic mode component and the sound pressure signal, and determines the high-correlation intrinsic mode component and the low-correlation intrinsic mode component through the mutual information value. Mutual information is an information measurement method used to measure how much information one variable contains in another variable, that is, the expression is:
[0066] ;
[0067] In the formula, I ( A ; B) represents the amount of information contained in B in A; A and B are random signals in two sound pressure sample data, p(a, b) is the joint distribution of the two random signals, and p(a) and p(b) are the marginal probability density functions of A and B respectively. At this time, the high-correlation intrinsic mode component and the low-correlation intrinsic mode component are to calculate the mutual information value between each intrinsic mode component IMF component and the sound pressure signal, and determine the high-correlation intrinsic mode component IMF and the low-correlation intrinsic mode component IMF according to the mutual information value.
[0068] Then, the high-correlation intrinsic mode components and low-correlation intrinsic mode components are reconstructed through the Hurst index to obtain the noise target. Among them, the Hurst index HURST is used to determine whether the low-correlation component has continuous correlation. Specifically, the sample entropy is first calculated:
[0069] ;
[0070] Where: E s ( m , z , L ) represents the sample entropy of dimension, similarity tolerance, and length of data; m represents the dimension; z represents the similarity tolerance; L is the length of data; , The mean of the number of vectors whose dimensions are m and m+1 and whose distances are less than or equal to z. In general, the larger the sample entropy of the data, the more complex it is. Calculation of Hurst index: The calculation of Hurst index often uses R / S analysis method. Let any time series be IMF1(t), t=1,2,3,…n. For any positive integer , the average of the time series can be obtained by the following formula:
[0071] ; is a time series, is any positive integer; in this case, the cumulative difference C(t) is:
[0072] ; is the cumulative difference; at this time, the difference between the maximum and minimum values when the cumulative difference takes the same positive integer is defined as the range, and the expression is:
[0073] ;
[0074] In the formula, is the maximum value of the cumulative difference, is the minimum value of the cumulative difference;
[0075] Hurst's standard deviation can be expressed as:
[0076] ;
[0077] is the Hurst standard deviation;
[0078] Based on the Hurst index, a more extensive exponential law can be obtained:
[0079] ; In the formula, R / S is an exponential law; H is the Hurst coefficient.
[0080] The reconstructing the high-correlation intrinsic mode component and the low-correlation intrinsic mode component by using the Hurst index to obtain the noise target, filtering the noise target, and obtaining the sound pressure sample data after filtering out the noise target includes the following steps: S150: dividing the low-correlation intrinsic mode component into a low-entropy high-persistence component, a noisy component, and a useless component by using the Hurst index; the useless component is directly discarded; the noisy component contains the noise target; S160: removing the noise target by using a wavelet transform model, and reconstructing the high-correlation intrinsic mode component, the low-entropy high-persistence component, and the noisy component after removing the noise target, to obtain the sound pressure sample data after filtering out the noise target. In order to achieve accurate filtering of noise targets and thus improve the accuracy of water supply pipe leakage detection, the current execution end, during reconstruction, specifically, divides the low-correlation intrinsic mode components into low-entropy high-persistence components, noise targets and useless components based on the Hurst index, and then removes the noise targets based on the wavelet transform, and reconstructs the high-correlation intrinsic mode components, the low-entropy high-persistence components, and the intrinsic mode components without the noise targets, to obtain the sound pressure sample data after filtering out the noise targets and reconstructing them.
[0081] For example, Figure 3 and Figure 4 The following are the sound pressure signal curves under various working conditions before denoising. Figure 3 (a) is the sound pressure signal when there is no leakage, such as Figure 3 (b) is the sound pressure signal when there is a small leak, such as Figure 4 (a) is the sound pressure signal of medium leakage, such as Figure 4 (b) is the sound pressure signal of a serious leak; after denoising, Figure 5 and Figure 6 The following are the sound pressure signal curves under various working conditions after denoising. Figure 5 (a) is the sound pressure signal after denoising without leakage, such as Figure 5 (b) is the sound pressure signal of a small leak after denoising. Figure 6 (a) is the sound pressure signal of medium leakage after denoising. Figure 6 (b) is the sound pressure signal of a serious leak after denoising. It can be understood that by filtering out the noise target in the sound pressure sample data, the sound pressure signal curve image under various working conditions after denoising can further improve the accuracy of the obtained leakage detection results.
[0082] In a specific implementation scenario, the step of filtering out noise targets includes the following steps:
[0083] Step 1: Decompose the sound pressure sample data collected by the sensor using the ICEEMDAN algorithm to obtain multiple IMFs;
[0084] Step 2: Calculate the mutual information value between each IMF component and the sound pressure signal, and determine the high-correlation IMF component and the low-correlation IMF component according to the mutual information value;
[0085] Step 3: For low-correlation components, the low-correlation components are divided into three parts according to the SE-Hurst index: low-entropy high-persistence components, noisy components (noise targets) and useless components;
[0086] Step 4: For the noisy component obtained in (step 3), the second generation wavelet transform is used to filter out the noise;
[0087] Step 5: reconstruct the obtained high correlation component, low entropy high persistence component and denoised noisy component to obtain pure sound pressure sample data, that is, the sound pressure sample data after filtering out the noise target.
[0088] Exemplarily, sample imbalance is reflected in the uneven proportion of support vectors and non-support vectors in the sound pressure sample data, resulting in low accuracy of the final leakage detection results. For the unbalanced sound pressure sample data in this application, the current execution end appropriately increases the support vectors of the minority class, and needs to under-sample the non-support vectors of the majority class to eliminate the differences between classes, that is, by performing support vector weighted sample balancing processing on the sound pressure sample data, including oversampling of the minority support vectors and undersampling of the majority non-support vectors, so as to obtain the target sample data for final classification detection, and perform detection through the target sample data of the support vectors and non-support vectors with balanced proportions, thereby avoiding the phenomenon of underreporting, thereby greatly improving the accuracy of the leakage detection results.
[0089] S200: Based on a support vector weighting model, the sound pressure sample data is divided into a first number of support vector area sample sets and a second number of support vector area sample sets; the first number is smaller than the second number, and the first number and the second number are divided by artificial regulations and are not limited here; the support vector weighting model is used to balance the support vector area sample sets and non-support vector area sample sets in the sound pressure sample data; S300: Based on the first number of support vector area sample sets and the second number of support vector area sample sets, sample data is generated; the generation of sample data based on the first number of support vector area sample sets and the second number of support vector area sample sets includes the following sub-steps:
[0090] S310: Determine the distance density of the first number of support vector area sample sets, and the density weight of the second number of support vector area sample sets, and determine the sampling weight based on the distance density and the density weight; S320: Determine the number of samples based on the sampling weight, and sample the sound pressure sample data according to the number of samples to generate a sample set; S330: Generate sample data based on the sample set and the sound pressure sample data. In order to reduce the impact of sample differences on the classification error of leakage detection, in this application, for different numbers of support vector area samples, when the current execution end performs sample balancing processing based on support vector weighting, specifically, first divide the sound pressure sample data into a minority support vector area sample set and a majority support vector area sample set, and then determine the distance density of the minority support vector area sample set, i.e., the first number of support vector area sample sets, and the density weight of the majority support vector area sample set, i.e., the second number of support vector area sample sets, and determine the sampling weight based on the distance density and the density weight. In addition, the number of samples can be configured based on the detection requirements of water supply pipe leakage, including but not limited to 50, 100, etc., and then sampling is performed according to this number of samples to obtain a sample set, and sample data is generated based on the sample set and the sound pressure sample data as target sample data for leakage detection.
[0091] In a specific implementation scenario, the oversampling of the minority support vector region sample set based on density distance specifically includes the following steps:
[0092] Step 1: Divide all samples in the support vector (SV) area into a minority class support vector sample set Dsv-min and a majority class support vector sample set Dsv-max. The number of samples in the minority class support vector sample set is Nsv-min; the number of samples in the majority class support vector sample set is Nsv-max.
[0093] Step 2: Calculate the number of new samples to be sampled: Hsv=|Nsv-min-Nsv-max|; Hsv represents the number of new samples to be sampled;
[0094] Step 3: For each support vector belonging to Dsv-min, find the 6 nearest neighbors in the set Dsv-max, and calculate the distance and JHi between each vector and its nearest neighbor sample;
[0095] Step 4: Repeat step 3 until the sum of the distances of all samples in Dsv-min is found, and the inverse of the sum of the distances is taken, and then normalized. The result is the distance density gi of the sample. The calculation formula is:
[0096] ;
[0097] In the formula, g i is the distance density of the sample; JH i is the sum of the distances between each vector and its nearest neighbor samples; N sv-min is the number of samples in the minority class support vector sample set;
[0098] Step 5: For each support vector belonging to Dsv-min, find the 6 nearest neighbors in the set Dsv-max and calculate the distance and JAi between these 6 nearest neighbor samples. After all the distances and normalization are processed, the result is the density weight qi of the sample, which is calculated as follows:
[0099] ;
[0100] q i is the density weight of the sample;
[0101] Step 6: Zi is the sampling weight of each sample, let , normalize all zi, and the result is the sampling weight Zi. The calculation formula is:
[0102] ;
[0103] Where Zi is the sampling weight;
[0104] Step 7: Order , Yi is the number of samples corresponding to the samples in Dsv-min;
[0105] Step 8: Use the SMOTE algorithm to oversample all samples and generate Hsv new samples. The generated new samples and the sample set Dsv constitute the new first target sample data Dh, eliminating the negative impact of the samples on the classification performance and improving the contribution of sample classification.
[0106] S400: Based on the support vector weighted model, the sound pressure sample data is divided into a first number of non-support vector area sample sets and a second number of non-support vector area sample sets; S500: Based on the first number of non-support vector area sample sets, the second number of non-support vector area sample sets and the sample data, target sample data is generated; the generating target sample data based on the first number of non-support vector area sample sets, the second number of non-support vector area sample sets and the sample data comprises the following sub-steps:
[0107] S510: Based on the number of samples of the first number of non-support vector area sample sets and the second number of non-support vector area sample sets, determine the number of samples of the second number of non-support vector area sample sets; S520: According to the number of samples, evenly divide the second number of non-support vector area sample sets into multiple second number of non-support vector area sub-sample sets; S530: Based on the second number of non-support vector area sub-sample sets, extract a preset number of majority class samples from the second number of non-support vector area sub-sample sets; S540: Generate target sample data based on the second number of non-support vector area sub-sample sets, majority class samples, the first number of non-support vector area sample sets, and sample data. In order to reduce the impact of sample differences on the classification error of leak detection, in this application, for different numbers of support vector area samples, when the current execution end performs sample balancing based on support vector weighting, specifically, after generating the first target sample data according to the first sample set and the sound pressure sample data, the sound pressure sample data can also be divided into a minority non-support vector area MinNSV sample set Dnsv-min and a majority non-support vector area MaxNSV sample set Dnsv-max, so as to determine the number of samples of the majority non-support vector area sample set based on the number of samples of the minority non-support vector area sample set and the majority non-support vector area sample set. Among them, the number of samples can be configured based on the detection requirements of water supply pipeline leakage, including but not limited to 100, 200, etc., so as to extract the majority class samples from each sample number, and generate the target sample data based on the second number of non-support vector area sub-sample sets, the majority class samples, the first number of non-support vector area sample sets, and the sample data, so as to detect and classify the target sample data through a multi-classification leak detection model, and eliminate the classification influence caused by the difference in sound pressure sample data.
[0108] In a specific implementation scenario, the majority support vector area sample set oversampling specifically includes the following steps:
[0109] Step 1: Calculate the number of samples Nnsv1 and Nnsv2 in Dnsv-min and Dnsv-max respectively;
[0110] Step 2: The samples of the sample set Dnsv-max are divided into M parts on average, namely in, ;
[0111] In the formula, M is the number of samples; N nsv1 is the number of samples in the minority non-support vector region; N nsv2 is the number of samples in the majority non-support vector region;
[0112] Step 3: For each Fi in step 2, you need to randomly select from each Dnsv-max in the average distribution majority class samples FFi;
[0113] Step 4: Fi, FFi, Dnsv-min and the obtained Dh are combined to form a new second target sample data Dp, and the target sample data Dp is used as the object of classification. The target sample data further eliminates the negative impact of the sample on the classification performance and improves the contribution of the sample classification.
[0114] Before detecting and classifying the target sample data through the target multi-classification leakage detection model and generating the leakage detection result of the water supply pipeline, the following steps are included: S550: constructing an initial multi-classification leakage detection model based on multiple twin bounded support vector machine models; S560: obtaining the sample data and, or the training sample set corresponding to the target sample data; S570: based on the training sample set, training the initial multi-classification leakage detection model to obtain a target multi-classification leakage detection model. In order to achieve accurate leakage detection based on the twin bounded support vector machine model, the current execution end constructs an initial multi-classification leakage detection model based on a combination of multiple twin bounded support vector machine models SV-WTBSVM, and obtains the training sample set corresponding to the sample data and / or the target sample data for model training. Among them, the penalty parameter in the multi-classification leakage detection model is determined based on the grid search algorithm, and this application does not make specific restrictions.
[0115] In this application, the training methods of the twin bounded support vector machine model for linear and nonlinear are different. The training method of the linear SV-WTBSVM algorithm is: Input: training sample , output: Accuracy Acc, F-Measure (an indicator obtained by calculating the harmonic mean of accuracy and recall) and G-Mean (an indicator for evaluating the performance of classifiers in binary or multi-classification problems), until Acc, F-Measure and G-Mean meet the expected values of the model to complete the training. The specific process is as follows: 1. Define the balanced sample ; 2. Define numerical matrices G and H, ; and is a column vector whose two components are both 1;A Is the size of , representing the data points of the first type of samples; B Is the size of , representing the data points of the second type of samples; ; A m1 (1) is the first sequence after adding noise; B m2 (1) is the second sequence after adding noise; and are the number of positive samples and negative samples respectively; n is the data dimension. 3. Determine the optimal value of the penalty parameter through the grid search algorithm and obtain the two hyperplanes shown in the above formula; 4. According to the above formula, classify the new input samples; 5. Obtain the values of Acc, F-Measure and G-Mean.
[0116] The training method of the nonlinear SV-WTBSVM algorithm is: input: training samples, output: Acc, F-Measure and G-Mean. The specific process is as follows: 1. Balanced samples ; 2. Define numerical matrices S and R, ; and is a column vector whose two components are both 1; A Is the size of , representing the data points of the first type of samples; B Is the size of The matrix represents the data points of the second type of samples; ; A m1 (1) is the first sequence after adding noise; B m2 (1) is the second sequence after adding noise; and are the number of positive samples and negative samples respectively; n is the data dimension; K () represents the kernel function; Cis the penalty function; 3. Determine the optimal value of the penalty parameter and the value of the kernel parameter through the grid search algorithm, and obtain the two hyperplanes shown in the above formula; 4. Determine the type of kernel function; 5. According to the above formula, classify the new input samples; 6. Obtain the values of Acc, F-Measure and G-Mean. It should be noted that in the training set, when the i-th and j-th class samples are used to train its sub-classifier, the two classification hyperplanes to be determined can be expressed as:
[0117] ;
[0118] In the formula, , , , is the optimal parameter;
[0119] At this time, the corresponding optimal parameters can be obtained through the solution method of the binary classification TBSVM , , and , and then the above two hyperplanes can be determined. After constructing a multi-classifier by combining multiple twin bounded support vector machine models SV-WTBSVM, the "Maxwins voting method" is used to determine the category to which the final sample belongs. After the training is completed, each sub-classifier will distinguish the test samples in turn. When voting, if the classifier determines that the sample belongs to the i-th class instead of the j-th class, the number of votes for the i-th class will increase by one. On the contrary, the number of votes for the j-th class will increase by one. When all the test samples are traversed, the category to which the sample belongs can be determined based on the number of votes obtained.
[0120] In addition, when processing unbalanced data, the accuracy of the classifier refers to the proportion of correctly classified samples to all samples, and the calculation formula is:
[0121] ;
[0122] In the formula, Acc Represents the accuracy rate; TP represents that the predicted result is positive and correct; FP represents that the predicted result is positive and wrong; TN represents that the predicted result is negative and correct; FN represents that the predicted result is negative and wrong.
[0123] At this time, Acc reflects the overall classification effect of the classifier. When processing unbalanced data, due to the imbalance of positive and negative samples, the classification results of a few samples may be ignored when pursuing maximum accuracy, causing a certain deviation in the classifier. Therefore, this article adds F-Measure and G-Mean as evaluation indicators of classifier performance. In this application, the definitions of accuracy and error rate are as follows:
[0124] ;
[0125] In the formula, R tp is the accuracy, R fp is the error rate.
[0126] At this point, the calculation formulas for F-Measure and G-Mean can be obtained as follows:
[0127] ;
[0128] Where P r is the learning accuracy of positive samples ; .
[0129] in, R tn It is the intermediate quantity for calculating G-Mean.
[0130] In addition, in this application, the kernel function is the key to TBSVM in dealing with nonlinear problems. The radial basis function (RBF) has good mapping and generalization capabilities when dealing with nonlinear problems. The RBF kernel function used in this application can be expressed as:
[0131] ;
[0132] In the formula, is the kernel parameter, x For the data set, i and j All are variables.
[0133] S600: Detect and classify the target sample data through the target multi-classification leakage detection model to generate a leakage detection result of the water supply pipeline. The leakage detection result can be a small leakage, a medium leakage, or a serious leakage of the pipeline, which is not specifically limited in this application.
[0134] In this embodiment, the current execution end uses a combination of multiple twin bounded support vector machine models as the basic model of the multi-classification detection model for model training to achieve the purpose of detecting water supply pipeline leakage. Among them, the process of constructing the twin bounded support vector machine model TBSVM specifically includes the following linear conditions. The two hyperplanes of TBSVM can be expressed as: , where , and are the normal vector and bias term of the hyperplane, respectively. x is the data set. Then, the optimization problem of linear TBSVM is as follows:
[0135] ;
[0136] ;
[0137] In the formula, is the penalty parameter; and is a column vector whose two components are both 1; and is a slack variable that controls the tolerance to noise; and are the normal vector and bias term of the hyperplane respectively; A is the size , representing the data points of the first type of samples, and B is a matrix of size The matrix represents the data points of the second type of samples ; A m1 (1) is the first sequence after adding noise; B m2 (1) is the second sequence after adding noise; and are the number of positive samples and negative samples respectively; n is the data dimension; T is the transposed vector. From the above formula, we can see that the constraint of one objective function is determined by the mode of another objective function, and the two hyperplanes restrict each other. In the linear state, the Lagrangian dual formula of TBSVM is:
[0138] ;
[0139] In the formula, All non-negative Lagrange multipliers , ; , is the transpose of the Lagrange multiplier. Therefore, under linear conditions, in order to have an optimal solution to the linear programming problem, the dual problem can be obtained from the KKT condition as follows:
[0140] ;
[0141] ;
[0142] In the formula, G and H are both numerical matrices. . is the Lagrange multiplier. I represents the identity matrix of appropriate dimension; T is the transposed vector. At this time, when a new sample input is to be determined, the linear TBSVM can determine the label to which the sample belongs according to the following formula.
[0143] ; wk is the normal vector of the hyperplane; b k is the bias term of the hyperplane; where k =1 or 2. When the data is linearly inseparable in the low-dimensional space, SVM uses the kernel function to map it to the high-dimensional space and then classifies the data. Similar to the processing method of SVM, TBSVM also uses the kernel function to map the data and then classifies the data using the method under linear conditions. After the kernel function is introduced, the two hyperplanes of TBSVM can be expressed as:
[0144] ; In the formula, , u 1 and u 2 is the normal vector of the hyperplane under nonlinear conditions. The optimization problem of nonlinear TBSVM is as follows:
[0145] ;
[0146] ;
[0147] At this point, define: At this point, the Langrange dual problem corresponding to TBSVM is:
[0148] ;
[0149] ;
[0150] At this time, when a new sample input is to be determined, the nonlinear TBSVM can determine the label to which the sample belongs according to the following formula.
[0151] .
[0152] In the formula, u k is the normal vector of the hyperplane under nonlinear conditions, b k is the bias term of the hyperplane under nonlinear conditions; k =1 or 2.
[0153] Among them, the parameters in the above formula can refer to the implementation example of constructing a twin bounded support vector machine model TBSVM when no kernel function is referenced.
[0154] Depend on Figure 2It can be seen that the second aspect of the present application provides a water supply pipeline leakage detection system based on a support vector weighted model, characterized in that it includes: an acquisition module 1, the acquisition module 1 is used to collect sound pressure sample data of the water supply pipeline to be detected; a first division module 2, the first division module 2 is configured to divide the sound pressure sample data into a first number of support vector area sample sets and a second number of support vector area sample sets based on a support vector weighted model; the first number is less than the second number; a first generation module 3, the first generation module 3 is configured to generate sample data based on the first number of support vector area sample sets and the second number of support vector area sample sets; a second division module 4, the second division module 4 is used to divide the sound pressure sample data into a first number of non-support vector area sample sets and a second number of non-support vector area sample sets; a second generation module 5, the second generation module 5 is configured to generate target sample data based on the first number of non-support vector area sample sets, the second number of non-support vector area sample sets and sample data; a third generation module 6, the third generation module 6 is used to detect and classify the target sample data through a target multi-classification leakage detection model to generate a leakage detection result of the water supply pipeline. The effects of each part of the above system during operation can be found in the above method embodiment.
[0155] The above specific implementation methods further explain in detail the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above are only specific implementation methods of the embodiments of the present application and are not used to limit the protection scope of the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims
1. A water supply pipeline leakage detection method based on support vector weighted model, characterized in that: include: Collecting sound pressure sample data of the water supply pipeline to be tested; Based on a support vector weighted model, the sound pressure sample data is divided into a first number of support vector area sample sets and a second number of support vector area sample sets; the first number is smaller than the second number; the support vector weighted model is: ; In the formula, is the penalty parameter; and is a column vector whose two components are both 1; and is a slack variable that controls the tolerance to noise; and are the normal vector and bias term of the hyperplane respectively; A Is the size of , representing the data points of the first type of samples; B Is the size of , representing the data points of the second type of samples; ; A m1 (1) is the first sequence after adding noise; B m2 (1) is the second sequence after adding noise; n is the data dimension; and are the number of positive samples and negative samples respectively; T is the transposed vector; generating sample data based on the first number of support vector region sample sets and the second number of support vector region sample sets; Based on the support vector weighted model, the sound pressure sample data is divided into a first number of non-support vector area sample sets and a second number of non-support vector area sample sets; Generate target sample data based on the first number of non-support vector area sample sets, the second number of non-support vector area sample sets and sample data; The target sample data is detected and classified by a target multi-classification leakage detection model to generate a leakage detection result of the water supply pipeline; the target multi-classification leakage detection model is: ; In the formula, Class i Indicates the label to which the sample belongs; T is the transposed vector; x Represents sample data; w k is the normal vector of the hyperplane; b k is the bias term of the hyperplane; where k =1 or 2; The generating sample data based on the first number of support vector area sample sets and the second number of support vector area sample sets comprises: Determine the distance density of the first number of support vector area sample sets and the density weight of the second number of support vector area sample sets, and determine the sampling weight based on the distance density and the density weight; Determining the sampling number based on the sampling weight, and sampling the sound pressure sample data according to the sampling number to generate a sample set; generating sample data based on the sample set and the sound pressure sample data; The generating target sample data based on the first number of non-support vector area sample sets, the second number of non-support vector area sample sets and the sample data comprises: Determine the number of sample copies of the second number of non-support vector area sample sets based on the number of samples of the first number of non-support vector area sample sets and the number of samples of the second number of non-support vector area sample sets; According to the number of samples, evenly divide the second number of non-support vector area sample sets into a plurality of second number of non-support vector area sub-sample sets; Based on the second number of non-support vector region sub-sample sets, extracting a preset number of majority class samples from the second number of non-support vector region sub-sample sets; Target sample data is generated based on the second number of non-support vector area sub-sample sets, majority class samples, the first number of non-support vector area sample sets, and sample data.
2. A water supply pipeline leakage detection method based on support vector weighted model according to claim 1, characterized in that: The acquisition of the sound pressure sample data of the water supply pipeline to be tested includes: Collecting the acoustic wave signal of the water supply pipeline to be detected, and determining the energy, root mean square, effective value, standard deviation, kurtosis number, pulse coefficient, average amplitude and peak value of the acoustic wave signal; The energy, root mean square, effective value, standard deviation, kurtosis number, pulse coefficient, average amplitude and peak value are normalized to obtain the sound pressure sample data.
3. A water supply pipeline leakage detection method based on support vector weighted model according to claim 1, characterized in that: Before generating the target sample data, the method further includes: Decomposing the sound pressure sample data based on an empirical mode decomposition model of adaptive noise, decomposing the sound pressure sample data into a plurality of eigenmode components; Based on the intrinsic mode component, a noise target in the sound pressure sample data is determined, and the noise target is filtered out to obtain the sound pressure sample data from which the noise target is filtered out.
4. A water supply pipeline leakage detection method based on support vector weighted model according to claim 3, characterized in that: The determining, based on the intrinsic mode component, a noise target in the sound pressure sample data comprises: Based on the intrinsic mode component, obtaining a mutual information value between the intrinsic mode component and a sound pressure signal; Determining a high-correlation eigenmode component and a low-correlation eigenmode component based on a mutual information value between the eigenmode component and the sound pressure signal; The high-correlation intrinsic mode component and the low-correlation intrinsic mode component are reconstructed by using the Hurst exponent to obtain the noise target.
5. A water supply pipeline leakage detection method based on support vector weighted model according to claim 4, characterized in that: The high-correlation eigenmode component is the eigenmode component corresponding to the maximum mutual information value; the low-correlation eigenmode component is the eigenmode component corresponding to the minimum mutual information value.
6. A water supply pipeline leakage detection method based on support vector weighted model according to claim 4, characterized in that: The reconstructing the high-correlation intrinsic mode component and the low-correlation intrinsic mode component by using the Hurst exponent to obtain the noise target, filtering the noise target, and obtaining the sound pressure sample data after filtering out the noise target includes: The low-correlation intrinsic mode component is divided into a low-entropy high-persistence component, a noisy component and a useless component by using the Hurst index; the noisy component contains a noise target; The noise target is removed through a wavelet transform model, and the high-correlation intrinsic mode component, the low-entropy high-persistence component, and the noisy component after the noise target is removed are reconstructed to obtain the sound pressure sample data after the noise target is filtered out.
7. A water supply pipeline leakage detection method based on support vector weighted model according to claim 1, characterized in that: Before the target sample data is detected and classified by the target multi-classification leakage detection model to generate the leakage detection result of the water supply pipeline, the method includes: An initial multi-classification leakage detection model is constructed based on multiple twin bounded support vector machine models; Obtaining the sample data and / or a training sample set corresponding to the target sample data; Based on the training sample set, the initial multi-classification leakage detection model is trained to obtain a target multi-classification leakage detection model.
8. A water supply pipeline leakage detection system based on support vector weighted model, characterized in that: include: A collection module (1), the collection module (1) is used to collect sound pressure sample data of the water supply pipeline to be tested; A first division module (2), wherein the first division module (2) is configured to divide the sound pressure sample data into a first number of support vector area sample sets and a second number of support vector area sample sets based on a support vector weighted model; the first number is smaller than the second number; the support vector weighted model is: ; In the formula, is the penalty parameter; and is a column vector whose two components are both 1; and is a slack variable that controls the tolerance to noise; and are the normal vector and bias term of the hyperplane respectively; A Is the size of , representing the data points of the first type of samples; B Is the size of , representing the data points of the second type of samples; ; A m1 (1) is the first sequence after adding noise; B m2 (1) is the second sequence after adding noise; n is the data dimension; and are the number of positive samples and negative samples respectively; T is the transposed vector; A first generating module (3), the first generating module (3) being configured to generate sample data based on the first number of support vector area sample sets and the second number of support vector area sample sets; A second division module (4), the second division module (4) being used to divide the sound pressure sample data into a first number of non-support vector region sample sets and a second number of non-support vector region sample sets; A second generating module (5), the second generating module (5) being configured to generate target sample data based on the first number of non-support vector region sample sets, the second number of non-support vector region sample sets and the sample data; A third generation module (6), the third generation module (6) is used to detect and classify the target sample data through a target multi-classification leakage detection model to generate a leakage detection result of the water supply pipeline; the target multi-classification leakage detection model is: ; In the formula, Class i Indicates the label to which the sample belongs; T is the transposed vector; x Represents sample data; w k is the normal vector of the hyperplane; b k is the bias term of the hyperplane; where k =1 or 2.
