Rainfall identification method and system based on MFCC and PSO-SVM

By combining the MFCC dynamic and static features and PSO-SVM model in the rainfall recognition method, and using the random forest algorithm for feature selection and PSO algorithm to optimize SVM parameters, the problems of insufficient dynamic change characterization of rain sound signals and limited application capabilities in the existing technology are solved, and the accuracy of rainfall recognition is significantly improved.

CN119939368AActive Publication Date: 2025-05-06NANTONG INST OF TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510027373.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-05-06
Estimated Expiration
2045-01-08

AI Technical Summary

Technical Problem

In the existing rainfall recognition methods, the MFCC static characteristics cannot effectively characterize the dynamic changes of rain sound signals, resulting in low recognition accuracy of light rain and heavy rain, and the neural network model has problems of local optimality and slow convergence speed, which limits its application capabilities.

Method used

The rainfall recognition method based on MFCC and PSO-SVM is adopted to obtain the dynamic change information of the rain sound signal through MFCC dynamic and static feature extraction, and the feature selection is used to reduce the feature dimensions and improve the generalization ability of the model. At the same time, the PSO algorithm is used to optimize the regularization parameters and kernel function parameters of the SVM model to improve the recognition performance.

Benefits of technology

The accuracy of rainfall recognition was effectively improved, the overall accuracy was improved by 8%, the accuracy after feature selection was increased by 5%, the overall rainfall recognition accuracy of the PSO-SVM model reached 91.1%, and the accuracy of heavy rain and light rain both exceeded 90%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119939368A_ABST
    Figure CN119939368A_ABST
Patent Text Reader

Abstract

The invention discloses a rainfall identification method and system based on MFCC and PSO-SVM, and relates to the technical field of signal processing, and the method comprises the following steps: obtaining a rain sound signal, and carrying out the preprocessing of the rain sound signal; performing fast Fourier transform and discrete cosine transform on the preprocessed signal, calculating MFCC static characteristics, and calculating dynamic characteristics according to a dynamic solution formula; performing feature importance evaluation by using a random forest algorithm, and screening high-correlation features as input; optimizing the SVM model by using a PSO algorithm, searching an optimal parameter combination of a regularization parameter c and a kernel function parameter g of the SVM model, and analyzing rainfall recognition performance; according to the method, the dynamic features and the static features are combined, the recognition performance of the model is improved, the random forest algorithm is used for feature selection, feature dimensions are reduced, the generalization ability of the model is improved, meanwhile, the PSO algorithm is used for optimizing regularization parameters and kernel function parameters of the SVM model, the recognition performance is improved, and the rainfall recognition accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of signal processing, and in particular to a rainfall recognition method and system based on MFCC and PSO-SVM. Background Art

[0002] Precipitation is an important indicator reflecting the climate conditions of a region. Changes in a region's climate can be more directly reflected in changes in rainfall in that region. Precipitation forecasting plays an important role in agricultural production and urban work and life, but it is a difficult problem to accurately and timely forecast rainfall. Therefore, the accurate identification of rainfall is of great research significance in meteorological research and disaster prevention and mitigation.

[0003] Traditional rainfall measurement methods usually rely on equipment such as tipping bucket rain gauges to predict rainfall types by directly collecting and measuring the amount of rainwater. However, as these devices age, they often experience problems such as mechanical wear and measurement errors. With the continuous development of information intelligence and machine learning technology, various pattern recognition technologies have gradually received attention, and rain sound signal recognition is one of the emerging monitoring methods. Rain sound signal recognition realizes real-time monitoring and evaluation of rainfall conditions by analyzing the sound produced by raindrops hitting objects. Ferroudj uses machine learning technology to detect rain sounds in environmental recordings, which can effectively predict the rainfall types of heavy rain and non-heavy rain and the real-time rainfall intensity. Wang et al. used monitoring audio as input to build an automatic classification system, converting the rainfall observation task into an audio classification task, which provides an effective supplement to traditional rainfall monitoring technology. Alkhatib et al. designed an acoustic rainfall sensing system based on scientific citizen participation, and used the Gaussian process regression model to test and analyze parameters such as rainfall intensity and duration. Teng Shaohua et al. used multi-neural network models such as probabilistic neural network (PNN) and radial basis function (RBF) to identify rainfall types and predict rainfall. The rainfall prediction method based on rain sound recognition is still one of the hot topics in academic research. The above method has improved the accuracy of rainfall recognition to a certain extent, but there are still the following problems: the extracted MFCC static features cannot represent the dynamic changes of rain sound signals, resulting in slightly lower recognition accuracy for light rain and heavy rain. In addition, the neural network model has limited application capabilities in a large number of training data samples due to the shortcomings of local optimality and slow convergence. Therefore, a rainfall recognition method and system based on MFCC and PSO-SVM is needed to solve the above problems. Summary of the invention

[0004] The object of the present invention is to provide a rainfall recognition method and system based on MFCC and PSO-SVM to solve the problems existing in the prior art mentioned in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A rainfall recognition method based on MFCC and PSO-SVM includes the following steps:

[0007] S1: Acquire rain sound signal and pre-process the rain sound signal;

[0008] S2: Extract MFCC dynamic and static features. Perform fast Fourier transform and discrete cosine transform on the preprocessed signal to calculate MFCC static features and dynamic features according to the dynamic solution formula.

[0009] S3: Feature selection, using the random forest algorithm to evaluate feature importance, and selecting highly relevant features as input according to the relevance level;

[0010] S4: Construct a PSO-SVM rainfall recognition model, use the PSO algorithm to optimize the SVM model, find the optimal parameter combination of the regularization parameter c and the kernel function parameter g of the SVM model, combine the training set and the test set to train the optimized SVM model, and analyze the rainfall recognition performance.

[0011] Preferably, the specific steps of preprocessing the rain sound signal in S1 are:

[0012] The original rain sound signal x(n) is subjected to denoising, pre-emphasis, framing, and windowing preprocessing. The signal x(n) is pre-emphasized through a high-pass filter, and then the signal is divided into frames. Each frame is multiplied by a window function. The form of the Hamming window is as follows:

[0013]

[0014] Among them, 0≤n≤N-1, N is the window length, and a is generally taken as 0.46. After preprocessing, the signal s(n) is obtained.

[0015] Preferably, the process of extracting dynamic and static features of MFCC of rain sound signal in S2 comprises the following steps:

[0016] S21: Perform fast Fourier transform on the preprocessed signal s(n) to obtain the spectrum S of each frame i (k), the formula is as follows:

[0017]

[0018] S22: spectrum S i (k) Take the modulus and then square it to get the energy spectrum of the speech signal. Pass the energy spectrum through a set of Mel-scale triangular filter banks, and finally calculate the logarithmic energy of each filter bank output. The formula is:

[0019]

[0020] Among them, H m (k) is a Mel filter bank, which is defined as:

[0021]

[0022] S23: Substitute the obtained logarithmic energy s(m) into discrete cosine transform to obtain MFCC static features. The formula is:

[0023]

[0024] S24: The standard MFCC features only reflect the static characteristics of the rain signal. The dynamic characteristics of the rain signal can be described by the differential spectrum of these static features. The calculation formula of the dynamic characteristics is:

[0025]

[0026] Among them, d t represents the first-order dynamic characteristics of the rain signal. The coefficients from t+n to tn are required to calculate the characteristics of the tth frame. Usually, N is 2. t The same formula can be used to calculate the second-order dynamic features of the rain sound signal; finally, the 39-dimensional MFCC features of the rain sound signal are obtained, including 13-dimensional static features, 13-dimensional first-order dynamic features, and 13-dimensional second-order dynamic features.

[0027] Preferably, the specific steps of using the random forest algorithm to perform feature importance evaluation in S3 are:

[0028] For each feature, the importance weight is calculated using the OUT-OF-BAG error, and the importance V(X j ) is expressed as:

[0029]

[0030] where e t is the out-of-bag error of each decision tree in the random forest, To randomly change the j-th feature variable X of the out-of-bag data j The out-of-bag error after recalculation of the value.

[0031] Preferably, the S4 specifically comprises the following steps:

[0032] S41: Initialize the population: Initialize the local search capability, global search capability, maximum population size, and maximum number of evolutions of PSO-SVM, initialize the speed of each particle, each particle contains a penalty parameter g and a kernel function parameter c, and calculate the initial fitness;

[0033] S42: Calculate the fitness value of the particle: In the PSO-SVM algorithm, each particle represents a parameter combination, and its fitness value is calculated through the fitness function. Then each particle updates the individual optimal position and the global optimal position according to the result of the fitness function; finally, the particle is driven to move in the optimal direction according to the individual optimal and global optimal positions to search for the minimum value of the fitness function and find the optimal parameter combination. The fitness function based on the cross-validation accuracy of SVM is defined as:

[0034]

[0035] S43: Find individual extreme values ​​and group extreme values: Compare the fitness value of each particle with the individual extreme value. If the fitness function value is smaller, the fitness value is called the new individual extreme value. Then compare the new individual extreme value with the global optimal fitness value. If the individual extreme value is smaller, it is regarded as the current group extreme value.

[0036] S44: Update particle velocity and particle position. The formula is as follows:

[0037]

[0038] Where w is the weight factor; t is the current iteration number; c1 and c2 are acceleration factors; r1 and r2 are uniform random numbers in the range [0,1], which are used to limit the position and speed of the particle; x ij is the position of the ith particle; v ij represents the velocity of the ith particle; p ij is the best position that the particle experiences;

[0039] S45: Determine whether the current particle meets the termination condition, which is the error threshold of the fitness function. If it is less than the error threshold, the current iteration is terminated and the optimal parameter combination is output. Otherwise, return to step S42 to continue iterative calculation.

[0040] S46: Obtain the optimal parameter combination, train the optimized SVM model with the training set and the test set, and analyze the rainfall recognition performance.

[0041] The present invention also provides a rainfall recognition system based on MFCC and PSO-SVM, comprising:

[0042] Rain sound signal preprocessing module: used to perform denoising, pre-emphasis, and window preprocessing on the collected rain sound signals to obtain relatively pure rain sound signals;

[0043] Rain sound signal feature extraction module: used to solve MFCC static and dynamic features of the pre-processed rain sound signal through fast Fourier transform and discrete cosine transform;

[0044] Rain signal feature selection module: It is used to extract the 39-dimensional MFCC features of the rain signal, calculate the importance weight of each dimension of the feature using the built-in feature importance evaluation mechanism of the random forest, select features according to the relevant level classification, and select features with high correlation as input;

[0045] SVM model optimization module: used to optimize the SVM model, using the global search capability of PSO to optimize the regularization parameter c and kernel function parameter g of SVM to obtain the optimal parameter combination;

[0046] Rainfall recognition module: used to identify rainfall amount, input the selected features into the optimized SVM model for rainfall amount recognition, and analyze the model recognition performance.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] The MFCC dynamic features extracted by the present invention describe the dynamic change information of rain sound, and the dynamic features are combined with the static features to effectively improve the recognition performance of the model. The random forest algorithm is used for feature selection, which can effectively reduce the feature dimension and improve the generalization ability of the model. At the same time, the PSO algorithm is used to optimize the regularization parameters and kernel function parameters of the SVM model, which effectively improves the recognition performance and the accuracy of rainfall recognition. Compared with the traditional method of using only the MFCC static features, after the dynamic features are combined with the static features, the overall accuracy of rainfall recognition is improved by 8%, and the overall rainfall recognition accuracy after random forest feature selection is improved by 5%. When the PSO-SVM model is used for rainfall recognition, the overall rainfall recognition accuracy reaches 91.1%, wherein the rainfall recognition accuracy of heavy rain and light rain also exceeds 90%. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 The flowchart of the rainfall identification method of the present invention is shown in FIG.

[0050] Figure 2 It is a schematic diagram of the basic model framework of the present invention.

[0051] Figure 3 This is a schematic diagram comparing the accuracy of rainfall recognition based on different characteristics in the present invention.

[0052] Figure 4 It is a schematic diagram of the particle fitness curve of the PSO optimization algorithm of the present invention.

[0053] Figure 5 This is a schematic diagram of the rainfall recognition accuracy based on PSO-SVM in the present invention.

[0054] Figure 6This is a schematic diagram of the confusion matrix for rainfall recognition based on PSO-SVM in the present invention.

[0055] Figure 7 Schematic diagram of the system structure of the present invention. DETAILED DESCRIPTION

[0056] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below in conjunction with specific implementation methods.

[0057] See also Figure 1-7 , the present invention provides the following technical solutions:

[0058] A rainfall recognition method based on MFCC and PSO-SVM includes the following steps:

[0059] S1: Acquire a rain sound signal and pre-process the rain sound signal. The specific steps of pre-processing the rain sound signal are as follows:

[0060] The original rain sound signal x(n) is subjected to denoising, pre-emphasis, framing, and windowing preprocessing. The signal x(n) is pre-emphasized through a high-pass filter, and then the signal is divided into frames. Each frame is multiplied by a window function. The form of the Hamming window is as follows:

[0061]

[0062] Among them, 0≤n≤N-1, N is the window length, and a is generally taken as 0.46. After preprocessing, the signal s(n) is obtained.

[0063] S2: Extract MFCC dynamic and static features. Perform fast Fourier transform and discrete cosine transform on the preprocessed signal, calculate MFCC static features, and calculate dynamic features according to the dynamic solution formula. The process of extracting MFCC dynamic and static features of rain sound signal includes the following steps:

[0064] S21: Perform fast Fourier transform on the preprocessed signal s(n) to obtain the spectrum S of each frame i (k), the formula is as follows:

[0065]

[0066] S22: spectrum S i (k) Take the modulus and then square it to get the energy spectrum of the speech signal. Pass the energy spectrum through a set of Mel-scale triangular filter banks, and finally calculate the logarithmic energy of each filter bank output. The formula is:

[0067]

[0068] Among them, H m(k) is a Mel filter bank, which is defined as:

[0069]

[0070] S23: Substitute the obtained logarithmic energy s(m) into discrete cosine transform to obtain MFCC static features. The formula is:

[0071]

[0072] S24: The standard MFCC features only reflect the static characteristics of the rain signal. The dynamic characteristics of the rain signal can be described by the differential spectrum of these static features. The calculation formula of the dynamic characteristics is:

[0073]

[0074] Among them, d t represents the first-order dynamic characteristics of the rain signal. The coefficients from t+n to tn are required to calculate the characteristics of the tth frame. Usually, N is 2. t The same formula can be used to calculate the second-order dynamic features of the rain sound signal; finally, the 39-dimensional MFCC features of the rain sound signal are obtained, including 13-dimensional static features, 13-dimensional first-order dynamic features, and 13-dimensional second-order dynamic features.

[0075] S3: Feature selection, using the random forest algorithm to evaluate feature importance, according to the correlation level classification, select high-correlation features as input; the specific steps of using the random forest algorithm to evaluate feature importance are:

[0076] For each feature, the importance weight is calculated using the OUT-OF-BAG error, and the importance V(X j ) is expressed as:

[0077]

[0078] where e t is the out-of-bag error of each decision tree in the random forest, To randomly change the j-th feature variable X of the out-of-bag data j The out-of-bag error after recalculation of the value.

[0079] S4: construct a PSO-SVM rainfall recognition model, use the PSO algorithm to optimize the SVM model, find the optimal parameter combination of the regularization parameter c and the kernel function parameter g of the SVM model, combine the training set and the test set to train the optimized SVM model, and analyze the rainfall recognition performance; specifically, the following steps are included:

[0080] S41: Initialize the population: Initialize the local search capability, global search capability, maximum population size, and maximum number of evolutions of PSO-SVM, initialize the speed of each particle, each particle contains a penalty parameter g and a kernel function parameter c, and calculate the initial fitness;

[0081] S42: Calculate the fitness value of the particle: In the PSO-SVM algorithm, each particle represents a parameter combination, and its fitness value is calculated through the fitness function. Then each particle updates the individual optimal position and the global optimal position according to the result of the fitness function; finally, the particle is driven to move in the optimal direction according to the individual optimal and global optimal positions to search for the minimum value of the fitness function and find the optimal parameter combination. The fitness function based on the cross-validation accuracy of SVM is defined as:

[0082]

[0083] S43: Find individual extreme values ​​and group extreme values: Compare the fitness value of each particle with the individual extreme value. If the fitness function value is smaller, the fitness value is called the new individual extreme value. Then compare the new individual extreme value with the global optimal fitness value. If the individual extreme value is smaller, it is regarded as the current group extreme value.

[0084] S44: Update particle velocity and particle position. The formula is as follows:

[0085]

[0086] Where w is the weight factor; t is the current iteration number; c1 and c2 are acceleration factors; r1 and r2 are uniform random numbers in the range [0,1], which are used to limit the position and speed of the particle; x ij is the position of the ith particle; v ij represents the velocity of the ith particle; p ij is the best position that the particle experiences;

[0087] S45: Determine whether the current particle meets the termination condition, which is the error threshold of the fitness function. If it is less than the error threshold, the current iteration is terminated and the optimal parameter combination is output. Otherwise, return to step S42 to continue iterative calculation.

[0088] S46: Obtain the optimal parameter combination, train the optimized SVM model with the training set and the test set, and analyze the rainfall recognition performance.

[0089] like Figure 3 As shown, Figure 3The BP neural network model is used to extract the rainfall recognition results of the MFCC static features of the rain sound signal and the MFCC static features plus dynamic features. The experimental results show that compared with the case of using only the MFCC static features for rainfall recognition, the present invention combines the MFCC dynamic features to improve the rainfall recognition accuracy of light rain and heavy rain, and the recognition rate of moderate rain is slightly reduced, but it also reaches 80%, and the overall rainfall recognition accuracy is improved by 8%. Therefore, combining the static and dynamic features of MFCC can effectively improve the accuracy of rainfall recognition.

[0090] Table 1 Average importance weights of 39-dimensional MFCC features

[0091]

[0092] As shown in Table 1, in order to further improve the accuracy of rainfall recognition, the most representative features are selected and the feature importance is evaluated by the RF algorithm. Table 1 shows the average importance weight of the 39-dimensional MFCC features after 20 calculations. According to Table 1 and the correlation level, 0.30 is used as the feature threshold, the micro-correlation features are removed, and the 32-dimensional rain sound signal MFCC features are left as input. The SVM model is used for rainfall recognition and the rainfall recognition performance is analyzed. The experimental results show that after the micro-correlation features are removed through feature selection, the overall rainfall recognition accuracy is improved by 5%, and the recognition of medium and light rainfall conditions is improved, with the recognition accuracy increased by 14% and 10.2% respectively. Therefore, it is feasible to perform feature selection before rainfall recognition.

[0093] like Figure 4 As shown by Figure 4 It can be seen that in the first 32 iterations, the particle fitness value basically remained at 0.161538, which may have fallen into a local optimal solution. However, from the 32nd iteration to the 33rd iteration, the fitness value dropped significantly, indicating that the PSO algorithm found a better solution and quickly converged to it. After that, the fitness value remained stable, indicating that the algorithm reached the optimal solution and no longer improved. The optimal penalty parameter c it found was 3.5122 and the optimal kernel function parameter g was 7.4566.

[0094] like Figure 5 and Figure 6 As shown, Figure 5 , Figure 6 They are respectively the rainfall recognition accuracy and confusion matrix of the PSO-SVM model. Figure 5 , Figure 6It can be seen that after PSO optimization, the rainfall recognition performance of the SVM model has been significantly improved. The PSO-SVM model has only one sample misjudged in the rainfall recognition of light rain and moderate rain, and the overall rainfall recognition accuracy has increased by 20% compared with the unoptimized SVM model. It has also improved in the recognition of heavy, medium and light rainfall conditions, especially the recognition accuracy of heavy rain and light rain has been significantly improved, reaching 85% and 95.5% respectively. Therefore, the method of optimizing the SVM model using PSO has performed well in improving the accuracy of rainfall recognition, verifying its practicality and accuracy.

[0095] Table 2 Rainfall recognition results of different models (%)

[0096]

[0097] As shown in Table 2, in order to further verify the effectiveness of the PSO-SVM rainfall recognition model, a comparative experimental group was set up, using traditional SVM, BP neural network and PSO-SVM models for rainfall recognition. Table 2 shows the rainfall recognition results under different models. Since the purpose of the experiment is to accurately identify the size of rainfall from the rain sound signal, the recognition accuracy is the most important indicator among all evaluation indicators. The experimental results show that the traditional SVM model has the worst rainfall recognition performance, and the rainfall recognition accuracy of this model is only 60.03%; the F1 score reflects the balance between precision and recall. Since the precision and recall of the SVM model are quite different, the F1 score is not high, only 58.8%; the rainfall recognition performance of the BP neural network is better than that of the SVM model, and all indicators have been significantly improved, reaching 80.48% and 79.16% in accuracy and F1 score respectively; and the PSO-SVM model has the highest performance in rainfall recognition, and is better than the SVM and BP neural network models in all evaluation indicators, with the recognition accuracy and F1 score being 91.10% and 90.78% respectively.

[0098] Table 3 Comparison of average recognition accuracy of heavy, moderate and light rain under different models (%)

[0099]

[0100] As shown in Table 3, after comparing the overall average recognition accuracy of different models, the average recognition accuracy of different models for heavy, medium and light rain conditions is further analyzed. Table 3 is a comparison of the average recognition accuracy of heavy, medium and light rain conditions under different models. According to Table 3, it can be seen that the recognition accuracy of light rain and heavy rain under the SVM model is low, and only the recognition effect of medium rain is relatively considerable, reaching 84.45%. The BP neural network model has a considerable recognition effect on light rain, with a recognition accuracy of nearly 90%. It is slightly insufficient in the recognition of medium and heavy rain, but the recognition accuracy is generally higher than that of the SVM model. The recognition accuracy of the PSO-SVM model in all rain conditions is significantly better than that of the traditional SVM and BP neural network models, among which the recognition accuracy of heavy rain and light rain is the most obvious. The recognition accuracy of both rain conditions exceeds 90%, which solves the problem of poor recognition effect of heavy and light rain conditions to a certain extent, proving the effectiveness of the PSO-SVM model. Although it is slightly insufficient in the recognition of medium rain, its recognition accuracy has reached 86.59%.

[0101] like Figure 7 As shown, the present invention also provides a rainfall recognition system based on MFCC and PSO-SVM, comprising:

[0102] Rain sound signal preprocessing module: used to perform denoising, pre-emphasis, and window preprocessing on the collected rain sound signals to obtain relatively pure rain sound signals;

[0103] Rain sound signal feature extraction module: used to solve MFCC static and dynamic features of the pre-processed rain sound signal through fast Fourier transform and discrete cosine transform;

[0104] Rain signal feature selection module: It is used to extract the 39-dimensional MFCC features of the rain signal, calculate the importance weight of each dimension of the feature using the built-in feature importance evaluation mechanism of the random forest, select features according to the relevant level classification, and select features with high correlation as input;

[0105] SVM model optimization module: used to optimize the SVM model, using the global search capability of PSO to optimize the regularization parameter c and kernel function parameter g of SVM to obtain the optimal parameter combination;

[0106] Rainfall recognition module: used to identify rainfall amount, input the selected features into the optimized SVM model for rainfall amount recognition, and analyze the model recognition performance.

[0107] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A rainfall recognition method based on MFCC and PSO-SVM, characterized in that: The following steps are involved: S1: Acquire rain sound signal and pre-process the rain sound signal; S2: Extract MFCC dynamic and static features. Perform fast Fourier transform and discrete cosine transform on the preprocessed signal to calculate MFCC static features and dynamic features according to the dynamic solution formula. S3: Feature selection, using the random forest algorithm to evaluate feature importance, and selecting highly relevant features as input according to the relevance level; S4: Construct a PSO-SVM rainfall recognition model, use the PSO algorithm to optimize the SVM model, find the optimal parameter combination of the regularization parameter c and the kernel function parameter g of the SVM model, combine the training set and the test set to train the optimized SVM model, and analyze the rainfall recognition performance.

2. The rainfall recognition method based on MFCC and PSO-SVM according to claim 1, characterized in that: The specific steps of preprocessing the rain sound signal in S1 are: The original rain sound signal x(n) is subjected to denoising, pre-emphasis, framing, and windowing preprocessing. The signal x(n) is pre-emphasized through a high-pass filter, and then the signal is divided into frames. Each frame is multiplied by a window function. The form of the Hamming window is as follows: Among them, 0≤n≤N-1, N is the window length, and a is generally taken as 0.

46. After preprocessing, the signal s(n) is obtained.

3. The rainfall recognition method based on MFCC and PSO-SVM according to claim 1, characterized in that: The process of extracting dynamic and static features of MFCC of rain sound signal in S2 comprises the following steps: S21: Perform fast Fourier transform on the preprocessed signal s(n) to obtain the spectrum S of each frame i (k), the formula is as follows: S22: spectrum S i (k) Take the modulus and then square it to get the energy spectrum of the speech signal. Pass the energy spectrum through a set of Mel-scale triangular filter banks, and finally calculate the logarithmic energy of each filter bank output. The formula is: Among them, H m (k) is a Mel filter bank, which is defined as: S23: Substitute the obtained logarithmic energy s(m) into discrete cosine transform to obtain MFCC static features. The formula is: S24: The standard MFCC features only reflect the static characteristics of the rain signal. The dynamic characteristics of the rain signal can be described by the differential spectrum of these static features. The calculation formula of the dynamic characteristics is: Among them, d t represents the first-order dynamic characteristics of the rain signal. The coefficients from t+n to tn are required to calculate the characteristics of the tth frame. Usually, N is 2. t The same formula can be used to calculate the second-order dynamic features of the rain sound signal; finally, the 39-dimensional MFCC features of the rain sound signal are obtained, including 13-dimensional static features, 13-dimensional first-order dynamic features, and 13-dimensional second-order dynamic features.

4. The method for rainfall recognition based on MFCC and PSO-SVM according to claim 1, characterized in that: The specific steps of using the random forest algorithm to evaluate feature importance in S3 are: For each feature, the importance weight is calculated using the OUT-OF-BAG error, and the importance V(X j ) is expressed as: where e t is the out-of-bag error of each decision tree in the random forest, e j t To randomly change the j-th feature variable X of the out-of-bag data j The out-of-bag error after recalculation of the value.

5. The method for rainfall recognition based on MFCC and PSO-SVM according to claim 1, characterized in that: The S4 specifically comprises the following steps: S41: Initialize the population: Initialize the local search capability, global search capability, maximum population size, and maximum number of evolutions of PSO-SVM, initialize the speed of each particle, each particle contains a penalty parameter g and a kernel function parameter c, and calculate the initial fitness; S42: Calculate the fitness value of the particle: In the PSO-SVM algorithm, each particle represents a parameter combination, and its fitness value is calculated through the fitness function. Then each particle updates the individual optimal position and the global optimal position according to the result of the fitness function; finally, the particle is driven to move in the optimal direction according to the individual optimal and global optimal positions to search for the minimum value of the fitness function and find the optimal parameter combination. The fitness function based on the cross-validation accuracy of SVM is defined as: S43: Find individual extreme values ​​and group extreme values: Compare the fitness value of each particle with the individual extreme value. If the fitness function value is smaller, the fitness value is called the new individual extreme value. Then compare the new individual extreme value with the global optimal fitness value. If the individual extreme value is smaller, it is regarded as the current group extreme value. S44: Update particle velocity and particle position. The formula is as follows: Where w is the weight factor; t is the current iteration number; c1 and c2 are acceleration factors; r1 and r2 are uniform random numbers in the range [0,1], which are used to limit the position and speed of the particle; x ij is the position of the ith particle; v ij represents the velocity of the ith particle; p ij is the best position that the particle experiences; S45: Determine whether the current particle meets the termination condition, which is the error threshold of the fitness function. If it is less than the error threshold, the current iteration is terminated and the optimal parameter combination is output. Otherwise, return to step S42 to continue iterative calculation. S46: Obtain the optimal parameter combination, train the optimized SVM model with the training set and the test set, and analyze the rainfall recognition performance.

6. A rainfall recognition system based on MFCC and PSO-SVM designed according to the rainfall recognition method according to any one of claims 1 to 5, characterized in that: include: Rain sound signal preprocessing module: used to perform denoising, pre-emphasis, and window preprocessing on the collected rain sound signals to obtain relatively pure rain sound signals; Rain sound signal feature extraction module: used to solve MFCC static and dynamic features of the pre-processed rain sound signal through fast Fourier transform and discrete cosine transform; Rain signal feature selection module: It is used to extract the 39-dimensional MFCC features of the rain signal, calculate the importance weight of each dimension of the feature using the built-in feature importance evaluation mechanism of the random forest, select features according to the relevant level classification, and select features with high correlation as input; SVM model optimization module: used to optimize the SVM model, using the global search capability of PSO to optimize the regularization parameter c and kernel function parameter g of SVM to obtain the optimal parameter combination; Rainfall recognition module: used to identify rainfall amount, input the selected features into the optimized SVM model for rainfall amount recognition, and analyze the model recognition performance.

Citation Information

Patent Citations

  • Short-time wind speed prediction method based on four-parameter mixed kernel function LSSVM

    CN108830428A

  • Insect identification method based on chirp deep learning

    CN115910077A

  • Quantitative rainfall estimation method based on monitoring audio-visual data fusion

    CN117333745A

  • Satellite navigation BOC signal parameter estimation method based on improved PSO-SVM

    CN117368948A