Machine learning based method for identifying typical sound signals of valves in a pipe network
By using a machine learning-based method to denoise and extract features from the sound signals of pipeline valves, and constructing exhaust status and water pressure recognition models, the problems of low efficiency and poor accuracy in pipeline valve inspections in existing technologies are solved, automated and intelligent valve management is achieved, and the operational management efficiency of the water supply system is improved.
Patent Information
- Application Number
- CN202410699582.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-05-31
AI Technical Summary
In the existing technology, the inspection and maintenance of valves in urban water supply networks mainly rely on manual analysis, which is inefficient and has poor accuracy. It is unable to detect problems in a timely manner and lacks automated and intelligent analysis methods.
A machine learning-based method is used to denoise the sound signals of pipeline valves, extract features, and construct exhaust state recognition models and water pressure recognition models. Catboost and weighted soft voting fusion models are used to automatically identify valve states and water pressure.
It realizes the automation and intelligent analysis of the sound signals of pipe network valves, improves the recognition efficiency and accuracy, can judge the valve operation status in time, reduce the risk of failure, and improve the management efficiency of the water supply system.
Smart Images

Figure CN118471263B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of sound signal recognition, and relates to a kind of pipe network valve sound signal recognition method. BACKGROUND
[0002] With the accelerated urbanization process in China, water shortage problems gradually highlight, gradually hinder the economic development of the city, affect the people's living standards. More than 60% of water consumption in China is agricultural water, and less than 15% is domestic water. In the water supply, the proportion of groundwater is also decreasing, and artificial ecological environment water replenishment is increasing. Water resources are scarce, and good drinking water is even more scarce. The urban water supply network is a large and complex pipeline network system, which is the necessary infrastructure for the normal operation of the city. In the traditional water supply facility maintenance and management concept, the passive management of "blow pipe first and repair later" is often used, which is not compatible with the advanced concept of "prevention first, maintenance and repair first" emphasized in modern urban water supply management. Modern urban water supply management pays more attention to the institutionalization of pipeline inspection, the coordination between pipeline repair plan and implementation, the process of valve and valve well maintenance, and other comprehensive management measures to ensure the stable operation and efficient service of the water supply system.
[0003] The valve in the water supply network is a crucial facility, which plays an important role in the daily operation of the water supply pipeline, and is used for transportation, shutdown, regulation of water flow, pressure and change of flow direction, etc. However, the opening and closing of the valve still needs to be operated manually by workers on site. When the valve fails, it will cause water loss and waste. More importantly, in the case of handling pipe burst and other emergencies, because the staff cannot make timely judgment on the running state of the valve, the valve cannot be closed in time, which will cause the delay of repair time and cause serious consequences to the city. Therefore, people need to pay high attention to the operation and management of the valve in the water supply network, and how to effectively manage and monitor the valve equipment becomes more and more important for the construction and operation management of the pipeline network.
[0004] Daily valve inspection and maintenance work needs to find problems and solve problems in time. At present, the inspection and maintenance of urban pipeline valves are mostly reflected in the modeling of water supply pipeline system, and there is no research on the judgment of valve running state based on valve sound signal. The existing analysis of pipeline valve sound signal is mainly manual analysis, which not only needs a lot of manpower, but also has poor effect, low problem discovery efficiency and cannot guarantee timely problem discovery. Therefore, there is currently a lack of a fast, automated and intelligent analysis method. SUMMARY
[0005] The present application is to solve the problem of low efficiency and poor accuracy of manual analysis of urban pipeline valve sound signal.
[0006] A machine learning-based pipe network valve typical sound signal recognition method, comprising:
[0007] Each audio signal collected from the pipe network valve during operation is denoised, and a three-threshold pulse extraction algorithm is used to extract pulses from each audio signal. Then, initial features are extracted and normalized, including pulse area s, left-right symmetry degree dczy, pulse rise percentage Tp, duration T1, energy density MD, pulse proportion ZB, peak factor bf, pulse up-down symmetry dcsx, area proportion dp, amplitude maximum value max_value, amplitude minimum value min_value, amplitude mean value mean, peak-to-peak value p_p_value, amplitude absolute mean value abs_mean, square root amplitude square_root_amplitude, amplitude standard deviation std, kurtosis, skewness, root mean square amplitude rms, amplitude root mean square difference rmscha, amplitude variance fangcha, clearance factor clearance_factor, shape factor shape_factor, impulse factor impulse_factor, crest factor crest_factor, kurtosis factor kurtosis_factor, zero crossing rate zerorate, spectral centroid mainHz, frequency variance VF, mean frequency MF, root mean square frequency RMSF, and standard 13-dimensional MFCC features. The first to thirteenth features in the standard 13-dimensional MFCC features are denoted as mfcc_1, mfcc_2, …, mfcc_13, respectively.
[0008] For the normalized initial features, select features for classification, including pulse area s, pulse rise percentage Tp, duration T1, pulse up-down symmetry dcsx, kurtosis, shape factor shape_factor, impulse factor impulse_factor, crest factor crest_factor, kurtosis factor kurtosis_factor, zero crossing rate zerorate, spectral centroid mainHz, frequency variance VF, mean frequency MF, root mean square frequency RMSF, mfcc_1, mfcc_2, and mfcc_3. The features for classification are input into an exhaust state recognition model to predict the exhaust state type of the pipe network valve, including large exhaust sound state, small exhaust sound state, and other sound state.
[0009] For the pipe network valve predicted as a large exhaust sound state, the features for the soft voting fusion model are selected based on the normalized initial features, the features for the soft voting fusion model corresponding to the large exhaust include: pulse area s, pulse rise percentage Tp, duration T1, square root amplitude mean, square_root_amplitude, kurtosis, shape_factor, kurtosis_factor, zerorate, mainHz, MF, RMSF, mfcc_2, mfcc_7, mfcc_9, mfcc_12, and the features for the soft voting fusion model corresponding to the large exhaust are input into the weighted soft voting water pressure recognition model corresponding to the large exhaust to predict the water pressure value.
[0010] For the pipe network valve predicted as a small exhaust sound state, the features for the soft voting fusion model are selected based on the normalized initial features, the features for the soft voting fusion model corresponding to the small exhaust include: pulse area s, duration T1, square root amplitude mean, square_root_amplitude, kurtosis, shape_factor, kurtosis_factor, zerorate, mainHz, MF, RMSF, mfcc_5, mfcc_7, mfcc_8, mfcc_9, mfcc_10, and the features for the soft voting fusion model corresponding to the small exhaust are input into the weighted soft voting water pressure recognition model corresponding to the small exhaust to predict the water pressure value.
[0011] Then, based on the predicted water pressure value, the water pressure range interval into which the predicted water pressure value falls is determined as the final determined water pressure range.
[0012] Further, in the process of denoising each audio signal collected from the pipe network valve to be identified, first, a pass filter is used to filter out 300Hz-3400Hz, and then a denoising algorithm is used for secondary denoising.
[0013] Preferably, the water pressure range interval includes 0.25-0.3MPa, 0.35-0.45MPa, 0.5-0.55MPa.
[0014] Further, the exhaust state recognition model uses a Catboost machine learning model.
[0015] Further, the weighted soft voting water pressure recognition model is a weighted fusion model composed of multiple machine learning models.
[0016] Further, the plurality of machine learning models constituting the weighted fusion model include GBDT, XGboost and Catboost models.
[0017] Further, the exhaust state recognition model is pre-constructed and trained, and the specific process includes:
[0018] The audio signals collected when the valve of the pipe network is working include audio signals corresponding to the large exhaust and small exhaust states, and the audio signals corresponding to the large exhaust and small exhaust states are respectively denoted as a large exhaust sound state and a small exhaust sound state.
[0019] First, for each audio signal collected, denoising is performed; then, a three-threshold pulse extraction algorithm is used to extract pulses from each audio signal; then, features are extracted and a first feature set is constructed, including pulse area s, pulse rise percentage Tp, duration T1, pulse up-down symmetry dcsx, kurtosis, shape_factor, impulse_factor, crest_factor, kurtosis_factor, zerorate, mainHz, VF, MF, RMSF, and standard 13-dimensional MFCC features, as well as square_root_amplitude and mean.
[0020] The first feature set is dimensionally reduced to obtain a third feature set.
[0021] The features in the third feature set are normalized, and the normalized third feature set is divided into a third feature set training set and a third feature set test set, and the sample labels in the third feature set training set and the third feature set test set are large exhaust sound state, small exhaust sound state and other sound state; a plurality of machine learning models are trained using the third feature set training set, and the plurality of machine learning models are tested using the third feature set test set, and the machine learning model with the highest classification accuracy is selected as the exhaust state recognition model.
[0022] Further, the process of dimensionally reducing the first feature set to obtain the third feature set includes the following steps:
[0023] The Gini coefficient-based random forest importance ranking method is selected to rank the importance of the features in the first feature set, features with scores lower than a first score threshold are deleted to obtain a second feature set; the Pearson correlation coefficient method is used to further filter the features in the second feature set to obtain a third feature set.
[0024] Further, the water pressure recognition model is pre-constructed and trained, and the specific process includes:
[0025] The collected audio signals of the pipe network valve during operation include audio signals corresponding to large exhaust and small exhaust states, and the pressure values, i.e., water pressure values, of the pipe network valve under large exhaust and small exhaust states are collected simultaneously; the audio signals corresponding to the large exhaust and small exhaust states are denoted as large exhaust sound state and small exhaust sound state respectively, and the sound signals not belonging to the large exhaust sound state and the small exhaust sound state are denoted as other sound state;
[0026] First, the SMOTE oversampling algorithm is used to process data imbalance, and then for each audio signal collected, noise reduction processing is performed; then a three-threshold pulse extraction algorithm is used to extract pulses from each audio signal; then the first feature set is constructed by extracting features, including pulse area s, pulse rise percentage Tp, duration T1, pulse up-down symmetry dcsx, kurtosis, shape_factor, impulse_factor, crest_factor, kurtosis_factor, zerorate, mainHz, VF, MF, RMSF, and standard 13-dimensional MFCC features, as well as mean, square_root_amplitude;
[0027] For the large exhaust sound state, the first feature set is reduced to obtain the fourth feature set; for the small exhaust sound state, the first feature set is reduced to obtain the fifth feature set; the features in the fourth and fifth feature sets are normalized;
[0028] The normalized fourth feature set is divided into a fourth feature set training set and a fourth feature set test set, and the sample labels in the fourth feature set training set and the fourth feature set test set are water pressure values; multiple machine learning models are used as base classifiers, the fourth feature set training set is used to train each base classifier, an optimization algorithm is used to optimize the parameters of the base classifier, then the fourth feature set test set is used to test each base classifier after parameter optimization, weights are assigned according to the classification performance of each base classifier, and multiple base classifiers are combined to form a weighted soft voting fusion model, i.e., a large exhaust corresponding weighted soft voting water pressure recognition model;
[0029] The normalized fifth feature set is divided into a fifth feature set training set and a fifth feature set test set, the sample labels in the fifth feature set training set and the fifth feature set test set are water pressure values; a plurality of machine learning models are used as base classifiers, each base classifier is trained using the fifth feature set training set, an optimization algorithm is used to optimize the parameters of the base classifier, then each base classifier after parameter optimization is tested using the fifth feature set test set, weights are assigned according to the classification performance of each base classifier, and the plurality of base classifiers form a weighted soft voting fusion model, that is, a weighted soft voting water pressure recognition model corresponding to small exhaust.
[0030] Further, the first feature set is dimensionally reduced to obtain a fourth feature set, and the process of dimensionally reducing the first feature set to obtain a fifth feature set includes the following steps:
[0031] For the large exhaust sound state, the random forest importance ranking method based on the Gini coefficient is selected to rank the importance of the features in the first feature set, and the features with scores lower than 0.022 are deleted; and the Pearson correlation coefficient method is further used for screening to obtain the fourth feature set.
[0032] For the small exhaust sound state, the random forest importance ranking method based on the Gini coefficient is selected to rank the importance of the features in the first feature set, and the features with scores lower than 0.003 are deleted; and the Pearson correlation coefficient method is further used for screening to obtain the fifth feature set.
[0033] Beneficial effects:
[0034] The application carries out noise reduction processing on the pipe network valve sound signal data, effectively eliminates noise, thereby obtaining relatively pure valve sound data, reduces the influence of noise on valve operation recognition effect, and guarantees the effect of later recognition. In addition, the application obtains a data set through pulse extraction, trains an exhaust state recognition model based on a machine learning method and a water pressure recognition model based on weighted soft voting, and combines the two models, thereby improving the accuracy and efficiency of recognition of different sound types.
[0035] The application utilizes the method and technology of deep machine learning to realize automatic recognition of typical pipe network valve sound signals, and overcomes the problems of low efficiency, lack of automatic and intelligent analysis means in the traditional method of manual analysis. The application realizes automatic and intelligent analysis, greatly improves the efficiency and accuracy of signal analysis. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 It is a schematic diagram of the construction process of the machine learning-based pipe network valve typical sound signal recognition model.
[0037] Figure 2(a) is a time-frequency diagram of a typical small exhaust and large exhaust state sound signal; Figure 2(b) is a time-frequency diagram of two typical valve sound signals collected from the valve sound signals with the voices of the field staff; Figure 2(c) is a time-frequency diagram of the typical water flow sound and knocking sound in the two collected sounds.
[0038] Figure 3 is the time-frequency domain waveform diagram of the background noise of the pipe network valve sound signal before and after denoising.
[0039] Figure 4 is the overall denoising effect comparison diagram of the pipe network valve sound signal under the conditions of small exhaust and large exhaust.
[0040] Figure 5 is a step diagram of the exhaust state recognition model based on machine learning.
[0041] Figure 6 is a topology structure diagram of the weighted soft voting algorithm. DETAILED DESCRIPTION
[0042] The daily valve inspection and maintenance work needs to find problems in time, record problems in time, and solve problems in time. With the rise and development of machine learning, its related theories are gradually applied to the pipe network valve sound signal recognition research. The pipe network valve typical sound signal recognition technology based on machine learning provided in the present application can recognize the sound emitted by the valve under different exhaust states, different water pressure ranges, etc. to judge the valve operation state. Through real-time monitoring of the water supply pipe network flow, early warning analysis and evaluation of the pipe network operation condition, a scientific operation management system can be established. The system can improve the management personnel's control ability of the entire water supply pipe network system, thereby improving the operation management efficiency. The present application can provide effective basis for field workers to judge the valve operation state, thereby reducing the valve operation failure risk, and has important significance for the management of urban underground pipe network system. The following will be described in conjunction with specific embodiments.
[0043] Specific embodiment one: combined with Figure 1 The present embodiment is explained,
[0044] The present embodiment is a pipe network valve typical sound signal recognition method based on machine learning, which actually includes two parts. One part is the pipe network valve typical sound signal recognition model construction method based on machine learning in the early stage, which constructs a network model for pipe network valve typical sound signal classification and pressure range recognition, corresponding to steps 1 to 4. The other part is the part of using the pipe network valve sound signal recognition model finally obtained to recognize the pipe network valve sound signal after the model is constructed, that is, the actual pipe network valve typical sound signal recognition method, corresponding to step 5. The two parts are taken as a whole to form the pipe network valve typical sound signal recognition method based on machine learning, which includes the following steps:
[0045] Step 1, collate the sound signal data of the split pipe network valve
[0046] The sound signal collected when the pipe network valve is working is read, and the components contained in the background noise thereof are analyzed. Since the on-site environment is noisy, the sound collected by the microphone includes not only the pipe network valve operating sound required for research and analysis, but also other interference components in the on-site environment, mainly including human voice, machine sound, water flow sound, and knocking sound. Through analysis of a large number of valve sound signals with background noise, it is found that human voice in the background noise exists in the low-frequency part, and other noises are relatively dispersed. Therefore, according to the low-frequency noise in the noise, the present embodiment filters out the sound in the specified audio segment 300Hz-3400Hz through a band-pass filtering mode to preliminarily reduce the noise. Using only the band-pass filtering mode cannot completely eliminate the noise, and then the residual noise in each frequency segment after preliminary noise reduction is selected for secondary filtering processing by using other noise reduction algorithms to obtain relatively pure valve sound signals.
[0047] Exhaust valves are used to vent fluids in fluid piping systems. During water transfer, air is continuously released from the water, forming air pockets that hinder delivery. When gas overflows the system, it rises up the pipe and eventually accumulates at the highest point in the system. This is when the exhaust valve, operating via a float lever, begins to release the gas. A "full exhaust" refers to the sound produced when a large amount of gas is expelled from the valve when the valve is turned, while a "soft exhaust" refers to the sound produced when a small amount of gas is expelled when the valve is turned. Research has found significant differences in the time domain waveforms of the two exhaust states. The "full exhaust" state produces a more rapid and shorter waveform, while the "soft exhaust" state produces a slower, longer waveform. The waveform shapes of the two states are significantly different. Furthermore, the frequency distribution of the two states indicates that the frequency distribution of both exhaust states is mostly between 3000Hz and 8000Hz. The frequency range of human speech, as defined by international communication standards, is 300Hz to 3400Hz. In a real factory environment, human voices primarily exist in the low-frequency range. Human speech typically has a relatively fixed frequency range, while the valve operating sounds collected contain a significant amount of noise. The valve exhaust sounds required for the experiment also have a wide frequency distribution, generally exceeding 3400Hz. In addition to human voices, background noise also includes the sounds of water flowing from valves operating within the factory and knocking sounds from machinery operating. The frequency distribution of water flow is relatively broad, ranging from 0Hz to 8000Hz. Depending on the situation, the water flow sound has a larger distribution and more pronounced peaks between 0Hz-1000Hz, 4000Hz-5500Hz, and 7000Hz-8000Hz. The knocking sound has a larger amplitude and a wider amplitude distribution, but its frequency peaks are more dispersed, concentrated between 1000Hz and 2200Hz.
[0048] Because the human voice has a relatively fixed range, mostly between 300Hz and 3400Hz, bandpass filtering is used to filter out the human voice and achieve preliminary noise suppression. Because some noise still exists above 3400Hz, such as the sound of flowing water and knocking in the on-site work environment, residual noise can be observed in each frequency band from the spectrum graph, so secondary noise reduction is required. During secondary noise reduction, multiple noise reduction algorithms can be selected for comparative analysis. These noise reduction algorithms include but are not limited to spectral subtraction, improved multi-window spectral subtraction, Wiener filtering, and wavelet decomposition. After overall noise reduction of the voice signal, it can be found that the background noise has been effectively filtered.
[0049] Step 2: Extracting sound pulses from pipe network valves
[0050] For the valve audio signal de-noised by twice filtering, further analysis is needed, that is, pulse extraction is needed for the signal, so as to classify and identify the sound type subsequently. The exhaust signal pulse of each wav audio obtained during collection is extracted by using a three-threshold pulse extraction algorithm, so as to realize accurate detection and extraction of the pulse event in the signal. The three-threshold endpoint detection algorithm has more thresholds to distinguish different changes of the sound signal than the double-threshold algorithm, can provide more detailed endpoint position information, and can adapt to different signal characteristics and noise levels.
[0051] Step 3, constructing an exhaust state recognition model based on machine learning
[0052] According to the fact that the valve sound signals are obviously different under different exhaust states, from the perspective of machine learning feature engineering, the feature importance sorting method and the Pearson correlation coefficient method are used to analyze the correlation, and the best feature combination is designed. According to the comparison results of various machine learning algorithms, the Catboost model with the best classification recognition effect is selected as the final model. Since the sound collection site contains not only the sound of large exhaust and small exhaust, but also human voice, water flow sound, mechanical sound and other different types of sound, after twice filtering, some sounds similar to the valve exhaust sound cannot be filtered out, which interferes with the recognition of the exhaust state, therefore, in the present application, such sound is uniformly divided into the third type of sound, that is, other sound. It is determined that the Catboost model is used to distinguish the three sound states of large exhaust, small exhaust and other sound of the collected sound.
[0053] More specifically,
[0054] Firstly, according to the non-stationary and non-continuous characteristics of the valve sound signal of the pipe network, the application considers extracting from the time domain, the frequency domain and the MFCC. A total of 44 characteristic parameters are extracted, including: pulse area s, left-right symmetry degree dczy, pulse rising percentage Tp, duration T1, energy density MD, pulse proportion ZB, wave crest coefficient bf, pulse up-down symmetry degree dcsx, area proportion dp, amplitude maximum value max_value, amplitude minimum value min_value, amplitude mean value mean, peak-peak value p_p_value, amplitude absolute mean value abs_mean, square root amplitude square_root_amplitude, amplitude standard deviation std, kurtosis, skewness, root mean square amplitude rms, amplitude root mean square difference rmscha, amplitude variance fangcha, clearance factor clearance_factor, waveform factor shape_factor, pulse factor impulse_factor, crest factor crest_factor, kurtosis factor kurtosis_factor, zero-crossing rate zerorate, spectral centroid mainHz, frequency variance VF, mean frequency MF, root mean square frequency RMSF and standard 13-dimensional MFCC characteristics.
[0055] Since a large number of feature sets are used to train the model, a long training time is required, and the correlation between many features is not high. The commonly used feature importance sorting methods include Pearson correlation coefficient method and random forest feature importance sorting method, etc. From the perspective of data correlation and information gain, the application selects the random forest importance sorting method based on Gini coefficient to screen the extracted features, thereby improving the generalization performance of the classifier algorithm. Feature screening by the random forest importance sorting method can better reflect the contribution of features to the performance of the model. Random forest can assign a relative importance score to each feature. By sorting the features according to the importance, features with high importance can be selected, and these features are more critical to the prediction ability of the model. According to the feature importance sorting, features with scores lower than 0.015 are deleted, and finally the top 19 features with high feature importance scores are obtained as the second feature set. After screening by the random forest importance sorting method, the 19 screened features are plotted into a feature correlation heat map based on the Pearson correlation coefficient method, and further screening is performed according to the correlation degree between the features. From the feature heat correlation map, it can be found that the energy density MD and the pulse rise percentage Tp, the pulse area s and the square root amplitude square_root_amplitude, and the spectral centroid mainHz and the average frequency MF have strong correlation. Strong correlation means that there is a significant linear relationship between the two variables, so only one needs to be retained. Therefore, according to the comprehensive consideration of the feature importance score, the two features MD and square_root_amplitude are discarded, and finally seventeen features are selected to form a new feature set, i.e. the third feature set, including 4 frequency domain features, 10 time domain features and 3 MFCC features, which are specifically: pulse area s, pulse rise percentage Tp, duration T1, pulse symmetry dcsx, kurtosis, shape_factor, impulse_factor, crest_factor, kurtosis_factor, zerorate, spectral centroid mainHz, frequency variance VF, average frequency MF, frequency root mean square RMSF, mfcc_1, mfcc_2 and mfcc_3, wherein mfcc_1, mfcc_2 and mfcc_3 are the first, second and third features in the standard 13-dimensional MFCC feature.
[0056] In order to remove the dimensional difference between the characteristic parameters, the characteristics in the third feature set need to be normalized. This process can adjust the feature values to a similar scale, ensure that all feature data are at the same order of magnitude, and make different indicators comparable. In this way, the machine learning model can more accurately capture the relationship between the characteristics when further analyzing, and thus improve the prediction performance of the model. Since the difference between the feature values after screening is large, in order to better adapt to the needs of the model and improve the stability and training performance of the model, the present application considers using the standardization method to normalize the data, by converting the features to a normal distribution with a mean of 0 and a standard deviation of 1, to eliminate the dimensional difference between the features. For each feature, calculate its mean and standard deviation over the entire dataset.
[0057] Nine machine learning models and two deep learning models are used for classification training on the third feature set after normalization. The evaluation indicators of the model training results in this stage are accuracy (Accuracy), precision (Precision), recall (Recall) and F1 value. Since the accuracy of the machine learning classification algorithm is all above 90%, among which the prediction classification accuracy of decision tree, random forest, gradient boosting tree, XGboost and Catboost all reaches above 99%, and the recognition accuracy of Catboost algorithm is optimal, reaching 99.61%. The other three indicators, precision, recall and F1 value, all reach 99.61%, which is the highest among other models, indicating the best recognition effect. Therefore, in this stage, the present application selects Catboost algorithm as the final classification model. In order to ensure that the classification effect of Catboost model has reached the optimal, the Catboost algorithm is further optimized to obtain the final Catboost model.
[0058] Step 4, constructing a water pressure recognition model based on weighted soft voting
[0059] Since the valve emits sound in different water pressure ranges under different exhaust states, the water pressure in the application is divided into three ranges based on the collected different water pressure conditions, which are: 0.25-0.3MPa, 0.35-0.45MPa, 0.5-0.55MPa. The function of this stage model is to realize the classification and identification of three different water pressure ranges under large exhaust and small exhaust states respectively. The water pressure identification model of weighted soft voting predicts different water pressure values, and then based on the predicted water pressure value, the water pressure range interval where the predicted water pressure falls is determined as the final water pressure range. After using the SMOTE algorithm to enhance the data, by comparing the optimization algorithms GA algorithm and PSO algorithm, the PSO algorithm is selected to optimize the parameters of each machine learning model trained under the conditions of large exhaust and small exhaust. Through the same steps as the previous construction of the exhaust state recognition model based on machine learning, after feature extraction, the top sixteen features with high scores are selected to establish feature engineering. Through the model training result, the top three algorithms GBDT, XGboost and Catboost with the best recognition effect are selected to calculate the weight, and the fusion model based on weighted soft voting is established by weighted summation. According to the identified water pressure value, the sound of different water pressure ranges is finally determined. The experimental results show that the model has an identification accuracy of 97% for water pressure range under large exhaust state, and an identification accuracy of 98% for water pressure range under small exhaust state, which is more advantageous than the traditional method.
[0060] More specifically,
[0061] By using the SMOTE oversampling algorithm to process the original data imbalance, the number of samples is mainly increased, so that the number of positive and negative samples is close, and then learning. The SMOTE algorithm generates synthetic samples along the decision boundary between real samples in the feature space by interpolation, effectively increasing the number of minority class samples. In the SMOTE algorithm, the decision boundary refers to the boundary or hyperplane between real samples. This helps to improve the learning ability of the classifier for minority class samples and improve the overall classification performance, and improve the accuracy of the classification model.
[0062] After processing the unbalanced data set, the number of data sets was increased to make the number of audio data sets in different water pressure ranges under each diameter equal, which improved the performance of the classifier on the minority class. The next processing steps were consistent with the design process of the exhaust state recognition model based on machine learning in the previous section. Since a new model was established, feature extraction and feature selection needed to be performed again on the data. From the 44 extracted features, the features with scores lower than 0.022 for large exhaust and lower than 0.03 for small exhaust were deleted according to the importance ranking of the random forest, and the top-ranked features were selected. Then, according to the Pearson correlation analysis, the features with strong correlation were removed from the selected features to complete the feature engineering. Sixteen features were obtained, and the sixteen feature sets for large exhaust and small exhaust were respectively referred to as the fourth feature set and the fifth feature set. The sixteen features in the fourth feature set / fifth feature set were the required features for the respective weighted soft voting fusion model at this stage. Among them, the soft voting fusion model features for large exhaust state included: pulse area s, pulse rise percentage Tp, duration T1, square root amplitude mean, square_root_amplitude, kurtosis, shape_factor, kurtosis_factor, zerorate, mainHz, MF, RMSF, mfcc_2, mfcc_7, mfcc_9, mfcc_12. The soft voting fusion model features for small exhaust state included: pulse area s, duration T1, square root amplitude mean, square_root_amplitude, kurtosis, shape_factor, kurtosis_factor, zerorate, mainHz, MF, RMSF, mfcc_5, mfcc_7, mfcc_8, mfcc_9, mfcc_10.
[0063] The water pressure recognition accuracy of most models under the small exhaust state is high, close to 100%, and the accuracy under the large exhaust state is relatively low, so the parameters are optimized according to the different model recognition effects to improve the model classification and recognition accuracy. Genetic algorithm (Genetic Algorithm, GA) and particle swarm optimization algorithm (Particle Swarm Optimization, PSO) are two common heuristic algorithms used to solve parameter optimization problems. The parameters can be optimized by using these two methods. Since the overall optimization effect of the PSO algorithm is better than that of the GA algorithm, the PSO algorithm is used to optimize the parameters of the machine learning model with better recognition effect.
[0064] The specific implementation steps of the weighted soft voting are as follows: first, input the training set data for training different base classifiers. Then, each base classifier generates an independent prediction result, and the weight is assigned according to the performance of each base classifier. The performance of the base classifier is determined by the training results of different models. The weight can be determined according to the accuracy, error rate, F1 score, etc. of the classifier. The better the performance of the classifier, the higher the weight, so as to have greater influence in the integration process. Then, multiply each base classifier prediction result by the corresponding weight, and sum them up to get the weighted prediction result. This step can integrate different classifier opinions and better capture sample features and decision boundaries. Finally, soft voting is performed on the weighted prediction result. For each sample, each base classifier will give a probability distribution of a class, indicating its confidence in each class. By weightedly averaging these probability distributions, the final integrated prediction result is obtained.
[0065] Step 5, based on the final machine learning-based exhaust state recognition model and the water pressure recognition model based on weighted soft voting, a pipe network valve sound signal recognition platform is built to recognize pipe network valve sound signals:
[0066] The trained machine learning-based exhaust state recognition model and the water pressure recognition model based on weighted soft voting are loaded to recognize the sound generated under different water pressure ranges under the large and small exhaust states of the valve, respectively, and the recognition results are displayed on the software platform.
[0067] Embodiment
[0068] The machine learning-based pipe network valve typical sound signal recognition method described in this embodiment has the following specific steps:
[0069] 1. Organize and segment pipe network valve sound signal data
[0070] The valve sound signal data collected by the microphone is complex, and there are many types of background noise. Through analysis of a large number of valve sound signals with background noise, it is found that the human voice in the background noise exists in the low frequency part, and other noises are relatively dispersed. Fig. 2(a) shows the time-frequency diagram of two typical small exhaust and large exhaust state sound signals, Fig. 2(b) shows the time-frequency diagram of two typical valve sound signals with the voices of on-site workers, and Fig. 2(c) shows the time-frequency diagram of two typical water flow and knocking sounds in the collected sound signals. Therefore, a method for reducing low-frequency noise can be used to filter out the specified audio segment sound for preliminary noise reduction, and by comparing the residual noise of each frequency segment after preliminary noise reduction, a secondary filtering process is selected for secondary noise reduction, to obtain relatively pure valve sound signals, wherein the secondary noise reduction algorithm includes but is not limited to wavelet decomposition method.
[0071] The embodiment first uses a band-pass filtering method to reduce the noise of the low-frequency voice, to achieve preliminary noise suppression. The signal-to-noise ratio of the voice signal after preliminary noise reduction is still not high, and from the frequency spectrum, it can be observed that there is residual noise in each frequency segment, and from the background noise spectrum, it can be seen that there is still some noise in the high-frequency part, so secondary noise reduction is needed for the high-frequency noise, and a wavelet decomposition method is used for processing, and the time-frequency spectrum after processing is shown in Fig. 3. Figure 3 As shown in Fig. 4, the waveforms of the two signals before and after overall filtering are compared, which proves that after overall noise reduction of the valve sound signal, the noise has been effectively filtered out. Figure 4
[0072] Through noise reduction processing of the valve sound data, the valve sound data can be more accurately extracted, which promotes the identification and classification of the valve sound data. At the same time, these noise reduction methods also provide a necessary data basis for subsequent machine learning-based pipe network valve typical sound signal identification, so that different types of typical valve sound types can be more accurately identified.
[0073] Therefore, through secondary noise reduction processing of the valve sound data, the present application can better construct the pipe network valve sound model data set, improve the understanding and mastery of the typical valve sound, and more accurately and efficiently identify the typical valve sound data.
[0074] 2. Valve sound pulse extraction
[0075] For the valve audio signal de-noised by twice filtering, further analysis is needed, and then pulse extraction is needed to classify the sound types. The present application extracts single pulse in the whole wav audio signal by using three threshold pulse extraction algorithm, realizes accurate detection and extraction of pulse events in the signal. The length of each pulse obtained after pulse extraction and segmentation is about 1 second for large exhaust, and is between 4-10 seconds for small exhaust. In addition to these two typical exhaust sounds, the duration of noise audio containing human voice, water flow sound and knocking sound is about 10 seconds. The obtained pulse signal meets the required data effect.
[0076] 3. Constructing an exhaust state recognition model based on machine learning
[0077] The specific design steps of the exhaust state recognition model based on machine learning are shown in Figure 5 Since there are audio segments containing other sounds in the recognition process of exhaust state, the sound types are divided into three categories during the research, specifically including: large exhaust, small exhaust and other sounds. Through specific analysis of the relationship between the three states of valve large exhaust, small exhaust and other sounds and the characteristic parameters, the features with high importance ranking are selected according to the score of random forest feature importance ranking, and the best recognition model is finally selected through experimental comparison and analysis to recognize the three sound states of large exhaust, small exhaust and other sounds, and the exhaust state recognition model based on machine learning is designed.
[0078] The accuracy of nine machine learning classification algorithms is above 90%, among which the prediction classification effect of decision tree, random forest, gradient boosting tree, XGboost and Catboost reaches more than 99%, and the recognition accuracy of Catboost algorithm is optimal, reaching 99.61%. The other three indicators of precision, recall and F1 value all reach 99.61%, which is the highest compared with other models, indicating that the recognition effect is best, so the Catboost algorithm is selected as the final classification model. To ensure that the classification effect of the Catboost model has reached the best, the parameters of the Catboost algorithm are optimized below. The CatBoost model has multiple important hyperparameters that can be optimized, including learning rate, number of trees, tree depth, column sampling rate, and row sampling rate. To find the best combination of hyperparameters, the invention selects to optimize the learning rate, number of trees, and tree depth. The grid search method is used to perform an exhaustive search within the predefined hyperparameter range, and the best parameter combination is selected through cross-validation. The specific hyperparameter tuning process includes: first, define the hyperparameter space and determine the value range of each hyperparameter; next, select the initial parameter combination according to the search method; next, use the selected parameter combination to train the model and evaluate the model performance using the evaluation indicators; then, update the parameter combination according to the evaluation results; finally, iterate the optimization, repeat the first two steps until the maximum iteration number is reached or the performance no longer improves, and get the optimal parameter combination. The optimal parameter optimization results obtained finally are shown in Table 1. After parameter optimization, the accuracy of the Catboost model reaches 99.64%, which is a certain improvement compared with before optimization.
[0079] Table 1 Optimal parameter optimization results
[0080]
[0081] 4. Constructing a water pressure recognition model based on weighted soft voting
[0082] To solve the problem that the valve signal of the pipe network is difficult to quantitatively predict the water pressure range under different exhaust states, the present application further classifies and identifies different water pressure values under each exhaust condition for three valve diameters. Based on the collected different water pressure values, the present application divides them into three ranges: 0.25-0.3 MPa, 0.35-0.45 MPa and 0.5-0.55 MPa. The present application uses a fusion model method based on weighted soft voting to classify and identify three different water pressure ranges under large exhaust and small exhaust conditions. The core of this method is to use the ratio of different weights of machine learning classification algorithms to build a fusion integrated recognition model. The topology structure diagram of the weighted soft voting algorithm is shown in Figure 6
[0083] After using the SMOTE algorithm to enhance the data and completing the data imbalance processing, the present application extracts 44 features for the sound under two exhaust conditions. Then, according to the feature importance score ranking, 16 representative features are retained after feature screening. In the design of the fusion model, the PSO algorithm is used for parameter optimization, and the top three GBDT, XGboost and Catboost models with high accuracy after optimization are selected for weighted fusion. The weighted sum is performed according to the weight assigned by each classifier, and the recognition result of the fusion model is finally obtained. The results show that the recognition accuracy of the water pressure range under large exhaust condition reaches 97%, and the recognition accuracy of the water pressure range under small exhaust condition reaches 98%, which is more advantageous than the traditional method.
[0084] 5. Build a pipe network valve sound signal recognition system software platform to identify the state of the valve sound:
[0085] By combining the trained exhaust state recognition model based on machine learning with the water pressure recognition model based on weighted soft voting, the localization recognition of the sound is realized, and the recognition result is displayed on the software platform.
[0086] The above examples of the present application are only used to illustrate the calculation model and calculation process of the present application, and are not limited to the embodiments of the present application. For ordinary skilled persons in the art, other different forms of changes or variations can be made on the basis of the above description, and it is impossible to enumerate all the embodiments here. Any obvious changes or variations derived from the technical solutions of the present application still fall within the protection scope of the present application.
Claims
1. A method for identifying typical sound signals of pipe network valves based on machine learning, characterized in that: include: De-noising is performed on each audio signal collected when the valve to be identified is working; Then use the three-threshold pulse extraction algorithm to extract the pulses from each audio segment; Then the initial features are extracted and normalized. The extracted initial features include: pulse area s, left-right symmetry dczy, pulse rise percentage Tp, duration T1, energy density MD, pulse proportion ZB, crest factor bf, pulse upper and lower symmetry dcsx, area proportion dp, maximum amplitude max_value, minimum amplitude min_value, amplitude mean mean, peak-to-peak value p_p_value, absolute amplitude mean abs_mean, square root amplitude square_root_amplitude, amplitude standard deviation std, kurtosis, skewness, root mean square amplitude rms, amplitude root mean square difference rmscha, amplitude variance fangcha, margin index clearance_factor, waveform index shape_factor, pulse index impulse_factor, peak index crest_factor, kurtosis index kurtosis_factor, zero crossing rate zerorate, spectrum centroid mainHz, frequency variance VF, mean frequency MF, root mean square frequency RMSF and standard 13-dimensional MFCC features, and the features of the 1st to 13th dimensions in the standard 13-dimensional MFCC features are recorded as mfcc_1, mfcc_2, ..., mfcc_13 respectively; Based on the normalized initial features, features for classification are selected, including: pulse area s, pulse rise percentage Tp, duration T1, pulse upper and lower symmetry dcsx, kurtosis, waveform index shape_factor, pulse index impulse_factor, peak index crest_factor, kurtosis index kurtosis_factor, zero crossing rate zerorate, spectrum centroid mainHz, frequency variance VF, mean frequency MF, root mean square frequency RMSF, mfcc_1, mfcc_2, and mfcc_3; the features used for classification are input into the exhaust state recognition model to predict the exhaust state type of the pipeline network valve, wherein the exhaust state includes a large exhaust sound state, a small exhaust sound state, and other sound states; For pipe network valves predicted to be in a large exhaust sound state, features for the soft voting fusion model are selected based on the normalized initial features. The features corresponding to large exhaust for the soft voting fusion model include: pulse area s, pulse rise percentage Tp, duration T1, square root amplitude mean, square_root_amplitude, kurtosis, waveform index shape_factor, kurtosis index kurtosis_factor, zero crossing rate zerorate, spectrum centroid mainHz, mean frequency MF, root mean square frequency RMSF, mfcc_2, mfcc_7, mfcc_9, and mfcc_12. The features corresponding to large exhaust for the soft voting fusion model are input into the weighted soft voting water pressure identification model corresponding to large exhaust to predict the water pressure value. For pipe network valves predicted to be in a small exhaust sound state, features for the soft voting fusion model are selected based on the normalized initial features. The features corresponding to the small exhaust sound state include: pulse area s, duration T1, square root amplitude mean, square_root_amplitude, kurtosis, waveform index shape_factor, kurtosis index kurtosis_factor, zero crossing rate zerorate, spectrum centroid mainHz, mean frequency MF, root mean square frequency RMSF, mfcc_5, mfcc_7, mfcc_8, mfcc_9, and mfcc_10. The features corresponding to the small exhaust sound state are input into the weighted soft voting water pressure identification model corresponding to the small exhaust sound state to predict the water pressure value. Then, based on the predicted water pressure value, the water pressure range interval into which the predicted water pressure value falls is used as the final determined water pressure range.
2. The method for recognizing typical sound signals of pipe network valves based on machine learning according to claim 1 is characterized in that: In the process of denoising each audio signal collected when the valve to be identified is working, the 300Hz-3400Hz is first filtered out using a pass filter, and then the denoising algorithm is used for secondary noise reduction.
3. The method for identifying typical sound signals of pipe network valves based on machine learning according to claim 1 is characterized in that: The water pressure ranges include 0.25-0.3MPa, 0.35-0.45MPa, and 0.5-0.55MPa.
4. The method for recognizing typical sound signals of pipe network valves based on machine learning according to claim 1, characterized in that: The exhaust state recognition model uses the Catboost machine learning model.
5. The method for recognizing typical sound signals of pipe network valves based on machine learning according to claim 1 is characterized in that: The water pressure identification model of weighted soft voting is a weighted fusion model composed of multiple machine learning models.
6. The method for recognizing typical sound signals of pipe network valves based on machine learning according to claim 4 is characterized in that: The multiple machine learning models that make up the weighted fusion model include GBDT, XGboost, and Catboost models.
7. A method for recognizing typical sound signals of pipe network valves based on machine learning according to any one of claims 1 to 4, characterized in that: The exhaust state recognition model is pre-built and trained. The specific process includes: Audio signals collected when the pipe network valves are operating, including audio signals corresponding to large exhaust and small exhaust states, are recorded as large exhaust sound state and small exhaust sound state, respectively, and sound signals that do not belong to the large exhaust sound state or the small exhaust sound state are recorded as other sound states; First, denoising is performed on each audio signal collected; then the three-threshold pulse extraction algorithm is used to extract pulses from each audio segment; then features are extracted and the first feature set is constructed. The extracted features include: pulse area s, left-right symmetry dczy, pulse rise percentage Tp, duration T1, energy density MD, pulse proportion ZB, crest factor bf, pulse upper and lower symmetry dcsx, area proportion dp, maximum amplitude max_value, minimum amplitude min_value, amplitude mean mean, peak-to-peak value p_p_value, absolute amplitude mean abs_mean, square root amplitude square_root _amplitude, amplitude standard deviation std, kurtosis, skewness, root mean square amplitude rms, amplitude root mean square error rmscha, amplitude variance fangcha, margin index clearance_factor, waveform index shape_factor, pulse index impulse_factor, peak index crest_factor, kurtosis index kurtosis_factor, zero crossing rate zerorate, spectrum centroid mainHz, frequency variance VF, mean frequency MF, root mean square frequency RMSF and standard 13-dimensional MFCC features; Perform dimensionality reduction on the first feature set to obtain the third feature set; The features in the third feature set are normalized, and the normalized third feature set is divided into a third feature set training set and a third feature set test set. The sample labels in the third feature set training set and the third feature set test set are large exhaust sound state, small exhaust sound state, and other sound state. The third feature set training set is used to train multiple machine learning models, and the third feature set test set is used to test multiple machine learning models, and the machine learning model with the highest classification accuracy is selected as the exhaust state recognition model.
8. The method for recognizing typical sound signals of pipe network valves based on machine learning according to claim 7, characterized in that: The process of reducing the dimension of the first feature set to obtain the third feature set includes the following steps: The random forest importance ranking method based on the Gini coefficient is selected to rank the features in the first feature set, and the features with scores lower than the first score threshold are deleted to obtain the second feature set; then the features in the second feature set are further screened based on the Pearson correlation coefficient method to obtain the third feature set.
9. A method for identifying typical sound signals of pipe network valves based on machine learning according to any one of claims 1, 2, 3, 5, and 6, characterized in that: The water pressure recognition model is pre-built and trained. The specific process includes: The audio signals collected when the pipe network valve is operating include audio signals corresponding to the large exhaust and small exhaust states. At the same time, the pressure values of the pipe network valve in the large exhaust and small exhaust states, i.e., the water pressure values, are collected. The audio signals corresponding to the large exhaust and small exhaust states are respectively recorded as the large exhaust sound state and the small exhaust sound state, and the sound signals that do not belong to the large exhaust sound state or the small exhaust sound state are recorded as other sound states. First, the SMOTE oversampling algorithm is used to process the data imbalance, and then denoising is performed on each audio signal collected; then the three-threshold pulse extraction algorithm is used to extract the pulse of each audio segment; then the features are extracted and the first feature set is constructed. The extracted features include: pulse area s, left-right symmetry dczy, pulse rise percentage Tp, duration T1, energy density MD, pulse proportion ZB, crest factor bf, pulse upper and lower symmetry dcsx, area proportion dp, maximum amplitude max_value, minimum amplitude min_value, amplitude mean mean, peak-to-peak value p_p_value, absolute amplitude average abs_mean, square root Amplitude square_root_amplitude, amplitude standard deviation std, kurtosis, skewness, root mean square amplitude rms, amplitude root mean square error rmscha, amplitude variance fangcha, margin index clearance_factor, waveform index shape_factor, pulse index impulse_factor, peak index crest_factor, kurtosis index kurtosis_factor, zero crossing rate zerorate, spectrum centroid mainHz, frequency variance VF, mean frequency MF, root mean square frequency RMSF and standard 13-dimensional MFCC features; For the large exhaust sound state, the first feature set is reduced in dimension to obtain the fourth feature set; for the small exhaust sound state, the first feature set is reduced in dimension to obtain the fifth feature set; the features in the fourth and fifth feature sets are normalized; The normalized fourth feature set is divided into a fourth feature set training set and a fourth feature set test set, and the sample labels in the fourth feature set training set and the fourth feature set test set are water pressure values; multiple machine learning models are used as base classifiers, and each base classifier is trained using the fourth feature set training set. The optimization algorithm is used to optimize the parameters of the base classifier, and then the fourth feature set test set is used to test each base classifier after parameter optimization. Weights are assigned according to the classification performance of each base classifier, and multiple base classifiers are combined to form a weighted soft voting fusion model, that is, a weighted soft voting water pressure recognition model corresponding to large exhaust; The normalized fifth feature set is divided into a fifth feature set training set and a fifth feature set test set, and the sample labels in the fifth feature set training set and the fifth feature set test set are water pressure values; multiple machine learning models are used as base classifiers, and the fifth feature set training set is used to train each base classifier. The optimization algorithm is used to optimize the parameters of the base classifier, and then the fifth feature set test set is used to test each base classifier after parameter optimization. Weights are assigned according to the classification performance of each base classifier, and multiple base classifiers are combined to form a weighted soft voting fusion model, that is, a weighted soft voting water pressure recognition model corresponding to small exhaust.
10. The method for recognizing typical sound signals of pipe network valves based on machine learning according to claim 9, characterized in that: The process of reducing the dimension of the first feature set to obtain the fourth feature set and reducing the dimension of the first feature set to obtain the fifth feature set includes the following steps: For the loud exhaust sound condition, the random forest importance ranking method based on the Gini coefficient was used to rank the features in the first feature set, and features with scores below 0.022 were deleted. Further screening was performed based on the Pearson correlation coefficient method to obtain the fourth feature set. For the small exhaust sound state, the random forest importance ranking method based on the Gini coefficient was selected to rank the features in the first feature set, and features with scores lower than 0.003 were deleted. Then, further screening was performed based on the Pearson correlation coefficient method to obtain the fifth feature set.