A method for lossless identification of internal quality of nuts based on voiceprint features
Through voiceprint feature detection, the use of collective empirical modal decomposition and Lib-SVM classifiers, the lossless recognition of the internal quality of nuts is achieved, and the problem of traditional detection is solved. The problem of destroying the nut shell is improved, and the detection efficiency and accuracy are improved. It is suitable for automated production lines. , has environmental protection and economical characteristics.
Patent Information
- Application Number
- CN202411203309.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-08-30
AI Technical Summary
The existing technology is difficult to effectively and non-destructively identify the internal quality of nuts, especially to distinguish between healthy seeds, moldy seeds and inner deflated seeds. Traditional detection methods require the damage to the nut shell, and X-ray identification is relatively risky and has limitations.
The voiceprint feature detection method is used to remove noise and redundant information through collection empirical modal decomposition, extract time domain, frequency domain, and time frequency domain features, and use recursive feature screening and Lib-SVM classifier for classification identification to realize internal nuts Quality high-precision grade classification.
Realize non-destructive testing, ensures the integrity of nuts, improves the testing speed and efficiency, ensures product quality, has the characteristics of efficiency, accuracy and environmental protection, is suitable for various nuts, reduces labor costs, is suitable for automated production lines, and has significant economic and social benefits. .
Smart Images

Figure CN118706951B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of acoustic detection technology, and more specifically, to a method for losslessly identifying the internal quality of nuts based on voiceprint features. Background Art
[0002] Nuts are a type of agricultural and forestry product with a hard shell and rich nutritional and medicinal value. They are an important source of healthy diet for humans. Common varieties include walnuts, hazelnuts, almonds, cashews, chestnuts, etc. Due to the influence of the growth environment and cultivation technology, the quality of nuts varies. Moldy seeds and shrunken seeds are two typical inferior products that are very easy to appear in nuts. The former is toxic and harmful. If it is accidentally mixed in during the deep processing process, the toxin content of the product exceeds the maximum limit set by the national food regulatory agency, which will cause huge economic losses to the business and cause serious harm to human health. Although the edible quality of the latter is not as good as that of healthy seeds, it still has the potential for deep processing and can be used as low-grade kernel raw materials after breaking the shell. Therefore, it is of great practical significance to classify nuts before deep processing.
[0003] At present, the methods for nut quality detection are mainly divided into two categories: traditional detection and non-destructive detection. The traditional detection direction requires the use of external force to destroy the shell of the nut, and evaluates it by observing the physical characteristics of the nut such as color and tissue structure or measuring physical and chemical indicators. The non-destructive detection method is to directly detect the external or internal quality of the nut while ensuring the integrity of the nut shell. It is mainly based on the physical and chemical properties of the nuts, and usually uses spectral analysis, machine vision, X-rays, etc. to evaluate the quality of nuts. Due to the hard shell of nuts, spectral analysis and machine vision are difficult to penetrate the thick shell to directly evaluate the internal quality of nuts. Although X-rays can penetrate the shell, their identification risk is relatively high and there are limitations. Therefore, acoustic detection technology methods with many advantages such as simplicity, efficiency, and safety are expected to play a key role in the identification of the internal quality of nuts. Here, a method for non-destructive identification of the internal quality of nuts based on voiceprint features is proposed. Summary of the invention
[0004] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: first, the noise and redundant information in the nut soundprint signal are removed by ensemble empirical mode decomposition; then, the time domain features, frequency domain features, and time-frequency domain features of the nut soundprint signal are extracted, and the recursive feature elimination method is used to perform feature screening; finally, a Lib-SVM classifier is constructed to classify and identify the screened soundprint features, thereby achieving high-precision grade classification of healthy nuts, moldy seeds, and shrunken seeds, providing a new method for non-destructive discrimination of the internal quality of nuts.
[0005] Specifically, a method for losslessly identifying the internal quality of nuts based on voiceprint features comprises the following steps:
[0006] Step 1: Perform ensemble empirical mode decomposition (EEMD) on the collected nut impact soundprint signal;
[0007] Step 2: Use the mutual correlation coefficient method to filter the IMF components and reconstruct the voiceprint signal without noise and redundant information.
[0008] Step 3: Extract the time domain features of the deconstructed and reconstructed voiceprint signal. The time domain features include: peak-to-peak value, rectified mean value, variance, standard deviation, kurtosis, skewness, root mean square, mean square value, root mean amplitude, waveform factor, peak factor, pulse factor, margin factor, clearance factor, approximate entropy, sample entropy, and fuzzy entropy.
[0009] Step 4: Extract the frequency domain features of the deconstructed and reorganized voiceprint signal, and apply Fourier transform (FFT) to convert the signal from the time domain to the frequency domain. The extracted frequency domain features include: average frequency, center frequency, root mean square frequency, frequency standard deviation, power spectrum center frequency, power spectrum mean square frequency, power spectrum root mean square frequency, power spectrum frequency standard deviation, power spectrum entropy;
[0010] Step 5: Extract the time-frequency domain features of the deconstructed and reorganized voiceprint signal, use discrete wavelet transform to convert the signal into the time-frequency domain, calculate the wavelet coefficients and perform PCA dimensionality reduction on each wavelet coefficient, and take the first n principal components of each wavelet coefficient as the time-frequency domain features of the Nut sound signal;
[0011] Step 6: Perform recursive feature screening on the features in time domain, frequency domain, and time-frequency domain;
[0012] Step 7: Construct a support vector machine (SVM) classifier, input the filtered feature set, and select the optimal penalty parameter c and kernel function parameter g to achieve higher classification accuracy for healthy nuts and shrunken nuts.
[0013] Technical effects and advantages of the present invention:
[0014] The present invention uses voiceprint features for detection without destroying the nut shell or internal structure, thereby ensuring the integrity of the nuts and reducing waste and loss. Compared with traditional physical or chemical detection methods, the voiceprint feature detection method has higher detection speed and efficiency, and can quickly screen and classify a large number of nuts. By analyzing the voiceprint features, the quality of the nuts inside can be accurately judged to ensure product quality.
[0015] The present invention provides an efficient, accurate and environmentally friendly detection method, which can greatly improve the efficiency and accuracy of nut quality detection, and at the same time has a high degree of automation and wide applicability, and has significant economic and social benefits. Specifically, the present invention can be combined with an automated production line to realize the automation and intelligence of nut quality detection, reduce labor costs, and improve production efficiency. The voiceprint feature detection method is adopted, and there is no need to use chemical reagents or other consumable materials. It is environmentally friendly and meets the requirements of green detection. The method is applicable to various types of nuts, including but not limited to walnuts, hazelnuts, almonds, etc., and has broad application prospects. Through EEMD (ensemble empirical mode decomposition) and IMF (intrinsic mode function) analysis, noise and redundant information can be effectively eliminated, and the reliability and stability of the detection results can be improved. The present invention is compatible with existing production and detection equipment, easy to integrate into existing production lines, and convenient for promotion and application. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to facilitate understanding by those skilled in the art, the present invention is further described below in conjunction with the accompanying drawings;
[0017] Figure 1 This is a schematic diagram of a method for losslessly identifying the internal quality of nuts based on voiceprint features in the present invention.
[0018] Figure 2 These are the time domain diagram and frequency domain diagram of the soundprint signals of the healthy pecan seeds and the deflated seeds in the present invention.
[0019] Figure 3 This is the EEMD decomposition diagram of the hickory voiceprint signal in the present invention.
[0020] Figure 4 It is the confusion matrix before and after the feature screening of the original sound signal of walnut in the present invention and before and after the feature screening after EEMD processing.
[0021] Figure 5 It is a schematic diagram of the model evaluation results before and after the feature screening of the original sound signal of walnut in the present invention and before and after the feature screening after EEMD processing. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] Reference Figure 1-5 The following embodiments are obtained:
[0024] Embodiment 1: A method for losslessly identifying the internal quality of nuts based on voiceprint features, comprising the following steps:
[0025] 1. Perform ensemble empirical mode decomposition (EEMD) on the collected hickory impact soundprint signal:
[0026] EEMD (Ensemble Empirical Mode Decomposition) is a signal processing method that aims to solve the problem of mode aliasing in traditional empirical mode decomposition (EMD). EEMD adds different white noises to the original signal, performs multiple EMD decompositions, and finally averages the intrinsic mode functions (IMFs) obtained from each decomposition to extract the intrinsic modes of the signal. In this way, EEMD can decompose complex nonlinear and non-stationary signals more stably, making the decomposition results have better physical meaning and interpretability.
[0027] EMD (Empirical Mode Decomposition) is an adaptive decomposition method for analyzing nonlinear and non-stationary signals. It gradually decomposes complex signals into several intrinsic mode functions (IMFs), each of which represents a different frequency component in the signal, thereby achieving multi-scale analysis and processing of the signal. EMD does not require pre-setting of basis functions and completely relies on the characteristics of the data itself for decomposition, which can effectively reveal the intrinsic characteristics of the signal.
[0028] IMF (intrinsic mode function) is the basic decomposition unit of empirical mode decomposition (EMD) and ensemble empirical mode decomposition (EEMD). It is a group of components with specific characteristics decomposed from complex signals. IMF must meet two conditions: first, the number of all local extreme points and zero crossing points of the signal must be the same or differ by at most one; second, at any time, the local average value of the signal is zero. Through these characteristics, IMF can accurately represent the local fluctuation characteristics of the signal and help analyze the instantaneous frequency and amplitude changes of the signal.
[0029] Ensemble empirical mode decomposition (EEMD) is a method to improve the shortcomings of mode aliasing in EMD. EEMD adds different white noises of the same amplitude to the original signal, performs EMD processing on different new signals after adding different noises, and then calculates the average value of IMF obtained by multiple EMDs to offset the added white noise. The voiceprint signal formed after the original signal is decomposed by EEMD is composed of multiple components and residuals, and the expression formula is as follows:
[0030] ; In the formula, t represents the time variable, which indicates the value of the signal at different time points. The time variable t shows that these signals are functions that change with time. Whether it is the original signal, IMF component or residual signal, their values depend on time t. Through this time domain decomposition method, the characteristics of the signal at different time points can be analyzed and processed, thereby achieving non-destructive identification of the internal quality of nuts. is the component signal of each order obtained by EEMD decomposition, is the i-th intrinsic mode function (IMF) component signal obtained by EEMD decomposition, each Represents the characteristics of the original signal at different scales. is the residual component signal, also known as the residual, which is the part of the signal left after all IMF components are decomposed. It represents the part of the original signal that is not represented by any IMF component, usually a trend or noise. M is the total number of IMF components obtained by decomposition. is the original signal, which is the collected nut impact soundprint signal. The soundprint signal of this embodiment is decomposed by EEMD as shown in the figure. Figure 3 As shown, it can be seen that the main information of the voiceprint signal is concentrated in the first four decomposition signals. The ensemble empirical mode decomposition (EEMD) method generates multiple groups of different noise disturbance signals by adding white noise of the same but different amplitudes to the original signal. Each disturbance signal is processed by EMD to obtain multiple IMF components. Then, the corresponding IMF components of all disturbance signals are averaged to offset the influence of noise and obtain the final IMF components. The residual signal is the remaining part after processing all decomposition signals. Finally, the original signal is represented as a combination of each IMF component and the residual signal. This method can effectively separate the useful information and noise in the signal, providing a cleaner and more stable signal basis for subsequent feature extraction and classification.
[0031] 2. The correlation coefficient method is used to filter the IMF components and reconstruct the voiceprint signal without noise and redundant information.
[0032] The correlation coefficient method is used to select sensitive IMF components, that is, to calculate the correlation between each order component obtained by EEMD decomposition and the original signal. The more IMF components with effective components in the original signal, the higher the mutual correlation coefficient. The IMF components with a mutual correlation coefficient R ≥ 0.2 with the original signal are selected for signal reconstruction to obtain the voiceprint signal with noise and redundant information removed. The calculation formula of the mutual correlation coefficient is as follows:
[0033] ; Where R is the cross-correlation coefficient, which represents the correlation between the original signal and the i-th IMF component, is the i-th IMF of EEMD decomposition; and They are and The standard deviation of and yes and The average value of n is the number of sampling points of the signal. The correlation coefficient method is used to quantify the linear correlation between two variables. Here, it is used to quantify the original signal With each IMF component The correlation between them. The value range of the mutual correlation coefficient R is between -1 and 1, and the closer the absolute value is to 1, the stronger the correlation. Among the IMF components obtained in the EEMD decomposition, not all components contribute to the main features of the original signal. Some components may mainly contain noise and redundant information. By calculating the mutual correlation coefficient between the IMF components and the original signal, those IMF components that are highly correlated with the original signal can be screened out, thereby retaining the main features and removing noise and redundant information. By selecting IMF components with a mutual correlation coefficient R ≥ 0.2 for signal reconstruction, it is ensured that the reconstructed signal contains the effective components in the original signal. This helps to improve the accuracy and reliability of recognition in the subsequent feature extraction and classification process. In this way, noise and redundant information can be effectively removed, and more accurate signal features can be obtained, providing a more reliable data basis for the subsequent non-destructive identification of the internal quality of nuts.
[0034] 3. Extract the time domain features of the deconstructed and reconstructed voiceprint signal: Figure 2 It can be seen that, taking the soundprint signals of healthy seeds and shriveled seeds as an example, there are differences in the waveform changes and amplitude ranges of the time domain signals between healthy pecan seeds and shriveled seeds. Therefore, the time domain characteristics of the soundprint signal are extracted to reflect the amplitude fluctuations of the sound signal, the vibration energy intensity, the waveform changes of the pulse factor, etc.
[0035] 3.1. Extract the peak-to-peak value of the voiceprint feature. The peak-to-peak value is the difference between the maximum and minimum values, reflecting the range of the amplitude fluctuation of the sound signal. The calculation formula is as follows:
[0036] ;in, The peak-to-peak value represents the difference between the maximum and minimum values of the voiceprint signal, reflecting the range of signal amplitude fluctuation. is the value of the reconstructed voiceprint signal at the i-th sampling point, is the maximum value of the reconstructed voiceprint signal among all sampling points, is the minimum value of the reconstructed voiceprint signal among all sampling points, i is the index of the sampling point, ranging from 1 to N, and is 2048 in this embodiment.
[0037] 3.2. Extract the rectified average value of the voiceprint feature. The rectified average value is the average value of the absolute value of the voiceprint signal. The calculation formula is as follows:
[0038] ;in, is the rectified average value, which represents the average value of the absolute value of the reconstructed voiceprint signal. is the value of the reconstructed voiceprint signal at the i-th sampling point, N is the number of sampling points, which is 2048 in this embodiment, and i is the index of the sampling point, ranging from 1 to N.
[0039] 3.3. Extract the voiceprint feature variance. The variance is the average of the square value of the difference between the sample value and the mean, which reflects the degree of dispersion between the data. The calculation formula is as follows:
[0040] ;in, is the variance, which represents the average of the squared difference between the sample value and the mean, reflecting the degree of dispersion between the data. is the value of the reconstructed voiceprint signal at the i-th sampling point, is the average value of the reconstructed voiceprint signal, N is the number of sampling points, and this embodiment takes 2048.
[0041] 3.4. Extract the standard deviation of the voiceprint feature. The standard deviation is the arithmetic square root of the variance. The calculation formula is as follows:
[0042] ;in, is the standard deviation, which is the arithmetic square root of the variance and reflects the degree of dispersion of the data. is the value of the reconstructed voiceprint signal at the i-th sampling point, is the average value of the reconstructed voiceprint signal, N is the number of sampling points, and in this embodiment, it is 2048, which represents the number of discretization points when the signal is processed.
[0043] 3.5. Extract the voiceprint feature kurtosis. The kurtosis reflects the distribution and smoothness of the voiceprint signal waveform. The calculation formula is as follows:
[0044] ;in, is the kurtosis, which reflects the distribution and smoothness of the voiceprint signal waveform. is the value of the reconstructed voiceprint signal at the i-th sampling point, N is the number of sampling points, and this embodiment takes 2048.
[0045] 3.6. Extract the voiceprint feature skewness. The skewness reflects the asymmetry of the data around the sample mean. The calculation formula is as follows:
[0046] ;in, is the skewness, which reflects the asymmetry of the data around the sample mean. is the value of the reconstructed voiceprint signal at the i-th sampling point, N is the number of sampling points, and this embodiment takes 2048.
[0047] 3.7. Extract the root mean square of voiceprint features, also known as the effective value, which reflects the energy intensity and stability of the voiceprint signal. The calculation formula is as follows:
[0048] ;in, is the root mean square of the voiceprint feature, is the value of the reconstructed voiceprint signal at the i-th sampling point, N is the number of sampling points, and this embodiment takes 2048.
[0049] 3.8. Extract the mean square value of the voiceprint feature. The mean square value reflects the energy of the voiceprint signal. The calculation formula is as follows:
[0050] ;in, is the mean square value of the voiceprint feature, is the value of the reconstructed voiceprint signal at the i-th sampling point, N is the number of sampling points, and this embodiment takes 2048.
[0051] 3.9. Extract the square root amplitude of the voiceprint feature. The calculation formula is as follows:
[0052] ;
[0053] in, is the root amplitude of the voiceprint feature, reflecting the waveform characteristics of the signal. is the value of the reconstructed voiceprint signal at the i-th sampling point, N is the number of sampling points, and this embodiment takes 2048.
[0054] 3.10. Extract the characteristic waveform factor of the voiceprint. The waveform factor is the ratio of the effective value to the rectified average value, which reflects the waveform characteristics of the signal. The calculation formula is as follows:
[0055] ;in, is the waveform factor, is the value of the reconstructed voiceprint signal at the i-th sampling point, N is the number of sampling points, and this embodiment takes 2048.
[0056] 3.11. Extract the peak factor of the voiceprint feature. The peak factor reflects the peak degree of the peak in the waveform. The calculation formula is as follows:
[0057] ;in, is the peak factor, is the value of the reconstructed voiceprint signal at the i-th sampling point, N is the number of sampling points, and this embodiment takes 2048.
[0058] 3.12. Extract the voiceprint feature pulse factor. The pulse factor can characterize the presence of instantaneous peaks in the vibration signal. The calculation formula is as follows:
[0059] ;in, is the pulse factor, is the value of the reconstructed voiceprint signal at the i-th sampling point, N is the number of sampling points, and this embodiment takes 2048.
[0060] 3.13. Extract the margin factor of the voiceprint feature. The margin factor is the ratio of the signal peak value to the square root amplitude. The calculation formula is as follows:
[0061] ;in, is the margin factor, is the value of the reconstructed voiceprint signal at the i-th sampling point, N is the number of sampling points, and this embodiment takes 2048.
[0062] 3.14. Extract the voiceprint feature clearance factor, and the calculation formula is as follows:
[0063] ;in, is the clearance factor, which represents the mean square value of the signal energy and helps to understand the overall energy and strength of the signal. is the value of the reconstructed voiceprint signal at the i-th sampling point, N is the number of sampling points, and this embodiment takes 2048.
[0064] 3.15. Extract the approximate entropy of voiceprint features. Assume that the signal sequence is , , … , n is the total length of the signal sequence, and the calculation steps and formula of approximate entropy are as follows:
[0065] Step S1: construct a set of m-dimensional vectors in order: , 1; m is the dimension of the constructed vector, is the m-dimensional vector starting from the i-th point in the signal sequence;
[0066] Step S2: Set For two vectors and The maximum difference between elements in corresponding positions is:
[0067] , ;
[0068] Step S3: Setting a similarity tolerance threshold ,like ,Right now exist Approximate the lower number and record the ratio of the approximate number to the total number. The formula is as follows:
[0069] ; is the similarity ratio between vector X(i) and other vectors under tolerance r, that is, the ratio of the approximate number to the total number;
[0070] Step S4: For all i, define ; is the logarithmic mean of the similarity ratios of all vectors in dimension m;
[0071] Let the dimension m=m+1, and repeat the above steps S1-S4 to get , the formula is as follows: ; The calculation formula for the approximate entropy of this signal is:
[0072] ; It is the approximate entropy, which is used to measure the complexity and uncertainty of the signal, and helps to identify the dynamic changes and patterns of the signal. It is particularly suitable for analyzing nonlinear and non-stationary signals. By extracting the approximate entropy, the dynamic characteristics of the voiceprint signal can be better described and analyzed, which helps to improve the accuracy in the subsequent classification and recognition process. When n is a finite value, the calculation formula of the approximate entropy is: ; In this embodiment, m=2, r=0.15std, and n=2048 are taken when calculating the approximate entropy.
[0073] 3.16. Extract the entropy of voiceprint feature samples. Assume that the signal sequence is , , … , the calculation steps and formula of sample entropy are as follows:
[0074] Step W1: construct a set of m-dimensional vectors in order: ;
[0075] 1, m is the dimension of the constructed vector;
[0076] Step W2: Set For two vectors and The maximum difference between elements in corresponding positions is:
[0077] , ; j is the index used to calculate the other vector X(j) corresponding to the vector X(i) at position i, indicating the position of the sampling point for comparison, and the range is also from 1 to n-m+1;
[0078] Step W3: Represents statistical distance The number of (similar tolerance) divided by the total number , that is, the formula is as follows: ;
[0079] Step W4: For all i, define ;
[0080] Let the dimension m=m+1, and repeat the above steps W1-W4 to get ; The sample entropy of this signal is calculated as follows: ; When n is a finite value, the calculation formula of sample entropy is: ; Sample entropy It is used to measure the complexity and uncertainty of signals and help identify the dynamic changes and patterns of signals. It is particularly suitable for analyzing nonlinear and non-stationary signals. By extracting sample entropy, the dynamic characteristics of voiceprint signals can be better described and analyzed, which helps to improve accuracy in subsequent classification and recognition processes. In this embodiment, m=2, r=0.2std, and n=2048 are taken when calculating the approximate entropy.
[0081] 3.17. Extract the fuzzy entropy of voiceprint features. The calculation steps and formula of fuzzy entropy are as follows:
[0082] Step 1: Construct an m-dimensional vector of the voiceprint signal. The expression is as follows:
[0083] ;
[0084] in, , m is the modal dimension, is the modal mean;
[0085] Step 2: Calculate the vector and The distance between them is:
[0086] ; Modal mean is the average value of m data points starting from the i-th position in the signal sequence, the modal mean is the average value of m data points starting from the jth position in the signal sequence; modal mean , modal mean Both are to eliminate unnecessary offsets in the signal, so that the signal analysis is more accurate. The two means represent the local means of the signal when constructing the m-dimensional vector, and are used as a benchmark when calculating the distance between vectors. The role of the modal mean: By calculating the modal mean, the signal can be better standardized, making the comparison between different vectors more fair and accurate, thereby improving the stability and reliability of the fuzzy entropy calculation;
[0087] in, ; k is the index within the range of modal dimension;
[0088] Step 3: Calculate the similarity between vectors. The calculation formula is as follows: ;
[0089] Step 4. Definition ;
[0090] Repeat steps 1-4 to calculate ;
[0091] The calculation formula of fuzzy entropy is: ; Fuzzy entropy It is used to measure the complexity and uncertainty of signals and help identify the dynamic changes and patterns of signals. It is particularly suitable for analyzing nonlinear and non-stationary signals. By extracting fuzzy entropy, the dynamic characteristics of voiceprint signals can be better described and analyzed, which helps to improve accuracy in subsequent classification and recognition processes. In this embodiment, m=2, r=0.15std, n=2, and N=2048.
[0092] 4. Extract the frequency domain features of the deconstructed and reconstructed voiceprint signal: Apply Fourier transform (FFT) to convert the voiceprint signal from the time domain to the frequency domain. The extracted frequency domain features can reflect the dispersion or concentration of the voiceprint signal spectrum, changes in the frequency band position, etc. The power spectrum connects the frequency domain with energy and analyzes the signal from the energy perspective.
[0093] 4.1. Extract the average frequency of voiceprint features. The calculation formula is as follows:
[0094] ; represents the average frequency, which represents the average value of the signal frequency component and reflects the overall frequency level of the signal. K is the number of sampling points. The number of sampling points in this embodiment is 2048. is the amplitude after Fourier transformation, that is, the amplitude of the kth point in the spectrum.
[0095] 4.2. Extract the frequency of the center of gravity of the voiceprint feature to reflect the position change of the main frequency band. The calculation formula is as follows:
[0096] ; Indicates the center of gravity frequency, reflects the position change of the main frequency band, and describes the frequency center of the signal. is the frequency value of the corresponding point.
[0097] 4.3. Extract the root mean square frequency of the voiceprint feature. The calculation formula is as follows:
[0098] ; It stands for root mean square, which indicates the overall amplitude of the signal frequency component and reflects the strength of the signal frequency component.
[0099] 4.4. Extract the characteristic frequency variance of the voiceprint. The calculation formula is as follows:
[0100] ; It represents frequency variance. Frequency variance indicates the discrete degree of signal frequency distribution and describes the dispersion and variation of frequency components.
[0101] 4.5. Extract the centroid frequency of the voiceprint feature power spectrum. The calculation formula is as follows:
[0102] ; Indicates the frequency of the power spectrum center of gravity. The power spectrum center of gravity frequency indicates the center of gravity position of the signal power spectrum, reflecting the main distribution position of the signal energy. is the frequency, is the frequency value of the power spectrum.
[0103] 4.6. Extract the mean square frequency of the voiceprint feature power spectrum. The calculation formula is as follows:
[0104] ; It represents the mean square frequency of power spectrum. The mean square frequency of power spectrum represents the mean square value of the frequency components of the signal power spectrum, and describes the distribution range and intensity of signal energy.
[0105] 4.7. Extract the root mean square frequency of the voiceprint feature power spectrum. The calculation formula is as follows:
[0106] ; It represents the RMS frequency of the power spectrum. The RMS frequency of the power spectrum represents the overall amplitude of the signal frequency components, reflecting the intensity and concentration of the signal frequency components.
[0107] 4.8. Extract the frequency variance of the power spectrum of the voiceprint feature. The calculation formula is as follows:
[0108] ; It represents the power spectrum frequency variance. The power spectrum frequency variance indicates the discrete degree of signal frequency distribution and describes the dispersion and change of frequency components.
[0109] 4.9. Extract the standard deviation of the power spectrum frequency of the voiceprint feature. The calculation formula is as follows:
[0110] ; It represents the standard deviation of power spectrum frequency. The standard deviation of power spectrum frequency indicates the discreteness of signal frequency distribution. It is the square root of frequency variance, which makes it easier to understand and compare the changes in signal frequency.
[0111] 4.10. Extracting Voiceprint Feature Power Spectrum Entropy , power spectrum entropy It is a quantitative description of the complexity of the signal's energy distribution in the frequency domain. Its calculation formula is as follows:
[0112] ;in, It is the spectrum component of the signal after FFT transformation, indicating the frequency The spectral components at are usually calculated by fast Fourier transform (FFT), which reflects the amplitude or power of each frequency component of the signal in the frequency domain. Fast Fourier transform (FFT): First, the original signal is subjected to fast Fourier transform (FFT) to convert the time domain signal into a frequency domain signal. The result of FFT is a complex array, where each element corresponds to the amplitude and phase of a frequency component. is the amplitude part of this complex array, and N is the FFT variable length.
[0113] 5. Extract the time-frequency domain features of the deconstructed and reconstructed voiceprint signal:
[0114] 5.1. Use discrete wavelet transform to convert the signal into time-frequency domain. The discrete wavelet transform (DWT) formula is as follows:
[0115] ; Among them, a is the scale parameter (usually represented by j), which is used to control the expansion and contraction of the wavelet. The larger the scale parameter, the wider the wavelet function is in the time domain, and it can capture the low-frequency components of the signal; the smaller the scale parameter, the narrower the wavelet function is in the time domain, and it can capture the high-frequency components of the signal. b is the translation parameter (usually represented by k), which is used to control the position of the wavelet on the time axis. Through the translation parameter, the wavelet function can be moved on the entire signal, so as to analyze the local characteristics of the signal at different time points. represents the conjugate of the mother wavelet function.
[0116] 5.2. In discrete wavelet transform, the original signal is decomposed into high-frequency band and low-frequency band through a series of high-pass and low-pass filters. This embodiment adopts the Db3 (Daubechies) wavelet function with three-level decomposition to decompose an approximate coefficient and three detail coefficients. The wavelet detail coefficient represents the high-frequency signal part, and the wavelet approximate coefficient represents the low-frequency signal part.
[0117] In discrete wavelet transform, the original signal is decomposed into high frequency band and low frequency band through a series of high pass and low pass filters. The specific steps are as follows: the signal passes through the filter: high pass filter: extract the high frequency component of the signal. Low pass filter: extract the low frequency component of the signal. Down sampling: after each filter processing, the signal is down sampled to reduce the length of the signal. Recursive decomposition: the low frequency component continues to pass through the high pass and low pass filters for further decomposition. In this embodiment, the Db3 wavelet function with three-level decomposition is used. The specific process is as follows: three-level decomposition: through the three-level decomposition, the signal is decomposed into an approximate coefficient and three detail coefficients. Approximate coefficient and detail coefficient: Approximate coefficient: represents the low frequency part of the signal, containing the main signal energy. Detail coefficient: represents the high frequency part of the signal, reflecting the details and edge information of the signal. Specific coefficients: first level decomposition: obtain the first level approximate coefficient and the first level detail coefficient. Second level decomposition: the first level approximate coefficient is decomposed again to obtain the second level approximate coefficient and the second level detail coefficient. Third-level decomposition: The second-level approximate coefficients are decomposed again to obtain the third-level approximate coefficients and the third-level detail coefficients. Wavelet function Db3 (Daubechies): Daubechies wavelet: is a commonly used wavelet basis with good time and frequency localization characteristics, suitable for multi-scale analysis of signals. Db3: A specific instance of the Daubechies wavelet, where "3" means that the vanishing moment number of the wavelet is 3, which has better frequency domain characteristics. Through discrete wavelet transform, the signal can be decomposed into components of different frequency bands, so as to analyze the characteristics of the signal in the time-frequency domain and extract useful features for subsequent classification and recognition.
[0118] 5.3. Perform PCA dimensionality reduction on the obtained approximate coefficients and detail coefficients. In this embodiment, the first six principal components of each wavelet coefficient are taken as the time-frequency domain features of the walnut voiceprint signal. In the process of signal processing and feature extraction, in order to simplify the data and reduce redundant information, it is necessary to perform dimensionality reduction on the high-dimensional data. PCA (Principal Component Analysis) retains the main features of the data by converting high-dimensional data into a low-dimensional space. Specific steps: Extract approximate coefficients and detail coefficients: After wavelet decomposition, multiple approximate coefficients and detail coefficients of the signal are obtained. These coefficients reflect the characteristics of the signal in different frequency bands. PCA dimensionality reduction: The first six principal components of each wavelet coefficient are extracted by the PCA method. These principal components are used as the time-frequency domain features of the walnut voiceprint signal. PCA converts the original high-dimensional data to a new low-dimensional space through linear transformation, retains the largest variance in the data, and reduces the data dimension.
[0119] 6. Recursive feature elimination of features in the time domain, frequency domain, and time-frequency domain: Recursive feature elimination is a feature selection method that fits the model and systematically eliminates the weakest features. Since the prediction results of random forests in different fields are unbiased and stable, this embodiment selects RF-RFE for feature selection. The specific steps are as follows:
[0120] Step R1, run the random forest classifier to calculate the initial feature importance of all voiceprint features;
[0121] Step R2: Sort the voiceprint features according to the calculated feature importance scores, and select the features with the lowest scores to eliminate the feature set;
[0122] Step R3: Retrain the RF model with the removed feature set and calculate the new feature importance;
[0123] Step R4: When the accuracy of the model reaches the highest, stop the iteration, otherwise return to step R2;
[0124] The feature set obtained by the RF-RFE method is considered to be the optimal feature set, which contains the features that contribute most to classification. Retrain the model: Retrain the random forest model with the optimized feature set, calculate the importance of the new features, and perform the final classification and prediction. The features remaining when the model accuracy is the highest are the optimal voiceprint feature subset; among them, the feature subset finally screened out in this embodiment has a total of 21 voiceprint features, namely, rectified mean, kurtosis, peak factor, pulse factor, margin factor, clearance factor, approximate entropy, sample entropy, fuzzy entropy, power spectrum standard deviation, power spectrum entropy and the first five principal components of wavelet approximation coefficients, and the five principal components of the approximate coefficients. From Figure 4 , Figure 5 The results show that RF-RFE can effectively remove redundant features in the entire feature set, find the best combination of features, and obtain the best feature subset. The classification accuracy of the original signal increased from 90% to 91.7%, and the denoised signal increased from 93.3% to 96.7%. This shows that feature screening can improve the classification accuracy of both the original signal and the denoised signal.
[0125] Example 2: Constructing SVM classifier: Support vector machine algorithm is a typical classification method based on statistical learning, which is applicable to linear and nonlinear classification. Linear SVM is to find a separation hyperplane that can correctly divide the training data set and has the largest geometric interval; nonlinear SVM is to transfer the input vector to a high-dimensional space through kernel function mapping, and then classify according to the hyperplane fitted in the new dimensional space based on the support vector and margin. Its steps can be summarized as follows:
[0126] Assume that the data of the training set is ,in, , is the feature vector of the i-th sample, ; is the category label of the i-th sample;
[0127] Solving the maximization of classification interval can be transformed into solving Minimize, that is, satisfy the following minimization function: ;
[0128] Solve the constraint problem using Lagrange multipliers:
[0129] ;
[0130] use Find the maximum value: ;
[0131] The optimal linear classification decision function is as follows: ;in, is the weight coefficient of the optimal separation surface; is bias; is the Lagrange multiplier; sgn is the sign function, which is used to determine the sign of the classification result;
[0132] If the data set is linearly inseparable, the kernel function is used to replace the inner product of the original space, and the problem is transformed into a linearly separable problem. A slack variable greater than or equal to 0 is introduced, that is: ;
[0133] The final result is: .
[0134] The SVM classifier finds the optimal hyperplane by maximizing the classification margin and is suitable for both linear and nonlinear classification. Lagrangian optimization and dual problem solving methods enable SVM to handle high-dimensional data and nonlinear problems. = ; Kernel function The introduction of mapping nonlinear problems into high-dimensional space for processing enhances the application scope and flexibility of SVM.
[0135] In this embodiment, a total of 200 pecan impact sound signals were collected, including 100 healthy seeds and 100 shrunken seeds. 70 sound signals of each type were extracted, a total of 140 sound signals were used as training sets, and the remaining 60 were used as test sets. The Lib-SVM software package developed by Professor Lin Zhiren's team in Taiwan, China based on MATLAB was selected to classify the healthy seeds and shrunken seeds of pecans. The construction of the nonlinear SVM classifier is mainly divided into the following steps: the first step is to select a suitable kernel function. The kernel function selected in this embodiment is the radial basis function. In this data set, the SVM model using the radial basis function can also achieve a high classification accuracy rate when the sample size is small; the second step is to test the kernel function and select the optimal parameters (usually c and g). In order to obtain better classification performance, the 5-fold cross-validation method is used to search for the global optimal solution when constructing the classifier, and the optimal penalty coefficient (c) and gamma (g) parameters of the Lib-SVM classifier are selected.
[0136] Result analysis: Figure 4 , Figure 5 The results show that EEMD combined with mutual information method is used to remove noise and redundant information from voiceprint signals, and then combined with RF-RFE to select the best feature subset of multi-domain fusion, and finally the feature subset is input into Lib-SVM for grade classification. This method greatly improves the recognition accuracy of shriveled seeds in pecans and provides a new method for lossless grading of the internal quality of nuts.
[0137] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0138] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0139] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for losslessly identifying the internal quality of nuts based on voiceprint features, characterized in that: The following steps are involved: Step 1: Perform ensemble empirical mode decomposition on the collected nut impact soundprint signal; Step 2: Use the cross-correlation coefficient method to screen the components of the intrinsic mode function and reconstruct the voiceprint signal without noise and redundant information; Step 3: respectively extract the time domain features, frequency domain features, and time-frequency domain features of the deconstructed and reconstructed voiceprint signal; Step 4: Use recursive feature elimination method to screen the extracted time domain features, frequency domain features, and time-frequency domain features; Step 5: construct a support vector machine classifier, input the filtered feature set, and use the constructed support vector machine classifier to classify and identify the internal quality of nuts; Time domain features include: peak-to-peak value, rectified mean value, variance, standard deviation, kurtosis, skewness, root mean square, mean square value, root mean square amplitude, shape factor, peak factor, pulse factor, margin factor, clearance factor, approximate entropy, sample entropy, and fuzzy entropy; Frequency domain features include: average frequency, centroid frequency, frequency root mean square, frequency standard deviation, power spectrum centroid frequency, power spectrum mean square frequency, power spectrum root mean square frequency, power spectrum frequency standard deviation and power spectrum entropy; The time-frequency domain features are extracted by discrete wavelet transform, and the wavelet coefficients are reduced in dimension by principal component analysis, and the first n principal components are taken as features; Integrated empirical mode decomposition decomposes the original signal by adding different white noises, and then calculates the average of multiple decomposed signals to offset the white noise; The recursive feature elimination method calculates the initial feature importance of all voiceprint features by running a random forest classifier and gradually eliminates the features with the lowest scores until the model accuracy reaches the highest; The kernel function of the support vector machine classifier is the radial basis function, and the optimal penalty parameter c and kernel function parameter g are selected by the 5-fold cross validation method; By selecting the components of the intrinsic mode function whose mutual correlation coefficient R ≥ 0.2 with the original signal from the voiceprint signal after the empirical mode decomposition, the signal is reconstructed.
Citation Information
Patent Citations
PSO-SVM (Particle Swarm Optimization-Support Vector Machine) optimization method based on corn kernel collision sound signal multi-domain fusion
CN107300588A
Combined load prediction method fusing sequence decomposition and feature selection
CN115498627A
Bearing state monitoring and fault diagnosis method under multiple working conditions
CN115688018A
Rolling bearing vibration signal noise reduction method and device based on EEMD-ISVD, electronic equipment and medium
CN116578840A
Cutting tool wear prediction method based on MDRSNet
CN118081482A
